| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #include "core/dom/ElementCreationOptions.h" | 82 #include "core/dom/ElementCreationOptions.h" |
| 83 #include "core/dom/ElementDataCache.h" | 83 #include "core/dom/ElementDataCache.h" |
| 84 #include "core/dom/ElementRegistrationOptions.h" | 84 #include "core/dom/ElementRegistrationOptions.h" |
| 85 #include "core/dom/ElementTraversal.h" | 85 #include "core/dom/ElementTraversal.h" |
| 86 #include "core/dom/ExceptionCode.h" | 86 #include "core/dom/ExceptionCode.h" |
| 87 #include "core/dom/ExecutionContextTask.h" | 87 #include "core/dom/ExecutionContextTask.h" |
| 88 #include "core/dom/FrameRequestCallback.h" | 88 #include "core/dom/FrameRequestCallback.h" |
| 89 #include "core/dom/IntersectionObserverController.h" | 89 #include "core/dom/IntersectionObserverController.h" |
| 90 #include "core/dom/LayoutTreeBuilderTraversal.h" | 90 #include "core/dom/LayoutTreeBuilderTraversal.h" |
| 91 #include "core/dom/LiveNodeList.h" | 91 #include "core/dom/LiveNodeList.h" |
| 92 #include "core/dom/ModuleMap.h" |
| 92 #include "core/dom/MutationObserver.h" | 93 #include "core/dom/MutationObserver.h" |
| 93 #include "core/dom/NodeChildRemovalTracker.h" | 94 #include "core/dom/NodeChildRemovalTracker.h" |
| 94 #include "core/dom/NodeComputedStyle.h" | 95 #include "core/dom/NodeComputedStyle.h" |
| 95 #include "core/dom/NodeFilter.h" | 96 #include "core/dom/NodeFilter.h" |
| 96 #include "core/dom/NodeIterator.h" | 97 #include "core/dom/NodeIterator.h" |
| 97 #include "core/dom/NodeRareData.h" | 98 #include "core/dom/NodeRareData.h" |
| 98 #include "core/dom/NodeTraversal.h" | 99 #include "core/dom/NodeTraversal.h" |
| 99 #include "core/dom/NodeWithIndex.h" | 100 #include "core/dom/NodeWithIndex.h" |
| 100 #include "core/dom/NthIndexCache.h" | 101 #include "core/dom/NthIndexCache.h" |
| 101 #include "core/dom/ProcessingInstruction.h" | 102 #include "core/dom/ProcessingInstruction.h" |
| (...skipping 6328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6430 return LayoutViewItem(m_layoutView); | 6431 return LayoutViewItem(m_layoutView); |
| 6431 } | 6432 } |
| 6432 | 6433 |
| 6433 PropertyRegistry* Document::propertyRegistry() { | 6434 PropertyRegistry* Document::propertyRegistry() { |
| 6434 // TODO(timloh): When the flag is removed, return a reference instead. | 6435 // TODO(timloh): When the flag is removed, return a reference instead. |
| 6435 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) | 6436 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) |
| 6436 m_propertyRegistry = PropertyRegistry::create(); | 6437 m_propertyRegistry = PropertyRegistry::create(); |
| 6437 return m_propertyRegistry; | 6438 return m_propertyRegistry; |
| 6438 } | 6439 } |
| 6439 | 6440 |
| 6441 ModuleMap* Document::ensureModuleMap() { |
| 6442 if (!RuntimeEnabledFeatures::moduleScriptsEnabled()) |
| 6443 return nullptr; |
| 6444 |
| 6445 if (!m_moduleMap && frame()) { |
| 6446 m_moduleMap = ModuleMap::create(&frame()->script(), fetcher()); |
| 6447 } |
| 6448 |
| 6449 return m_moduleMap; |
| 6450 } |
| 6451 |
| 6440 void Document::incrementPasswordCount() { | 6452 void Document::incrementPasswordCount() { |
| 6441 ++m_passwordCount; | 6453 ++m_passwordCount; |
| 6442 if (isSecureContext() || m_passwordCount != 1) { | 6454 if (isSecureContext() || m_passwordCount != 1) { |
| 6443 // The browser process only cares about passwords on pages where the | 6455 // The browser process only cares about passwords on pages where the |
| 6444 // top-level URL is not secure. Secure contexts must have a top-level | 6456 // top-level URL is not secure. Secure contexts must have a top-level |
| 6445 // URL that is secure, so there is no need to send notifications for | 6457 // URL that is secure, so there is no need to send notifications for |
| 6446 // password fields in secure contexts. | 6458 // password fields in secure contexts. |
| 6447 // | 6459 // |
| 6448 // Also, only send a message on the first visible password field; the | 6460 // Also, only send a message on the first visible password field; the |
| 6449 // browser process doesn't care about the presence of additional | 6461 // browser process doesn't care about the presence of additional |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6510 visitor->trace(m_svgExtensions); | 6522 visitor->trace(m_svgExtensions); |
| 6511 visitor->trace(m_timeline); | 6523 visitor->trace(m_timeline); |
| 6512 visitor->trace(m_compositorPendingAnimations); | 6524 visitor->trace(m_compositorPendingAnimations); |
| 6513 visitor->trace(m_contextDocument); | 6525 visitor->trace(m_contextDocument); |
| 6514 visitor->trace(m_canvasFontCache); | 6526 visitor->trace(m_canvasFontCache); |
| 6515 visitor->trace(m_intersectionObserverController); | 6527 visitor->trace(m_intersectionObserverController); |
| 6516 visitor->trace(m_snapCoordinator); | 6528 visitor->trace(m_snapCoordinator); |
| 6517 visitor->trace(m_resizeObserverController); | 6529 visitor->trace(m_resizeObserverController); |
| 6518 visitor->trace(m_propertyRegistry); | 6530 visitor->trace(m_propertyRegistry); |
| 6519 visitor->trace(m_styleReattachDataMap); | 6531 visitor->trace(m_styleReattachDataMap); |
| 6532 visitor->trace(m_moduleMap); |
| 6520 Supplementable<Document>::trace(visitor); | 6533 Supplementable<Document>::trace(visitor); |
| 6521 TreeScope::trace(visitor); | 6534 TreeScope::trace(visitor); |
| 6522 ContainerNode::trace(visitor); | 6535 ContainerNode::trace(visitor); |
| 6523 ExecutionContext::trace(visitor); | 6536 ExecutionContext::trace(visitor); |
| 6524 SecurityContext::trace(visitor); | 6537 SecurityContext::trace(visitor); |
| 6525 SynchronousMutationNotifier::trace(visitor); | 6538 SynchronousMutationNotifier::trace(visitor); |
| 6526 } | 6539 } |
| 6527 | 6540 |
| 6528 void Document::maybeRecordLoadReason(WouldLoadReason reason) { | 6541 void Document::maybeRecordLoadReason(WouldLoadReason reason) { |
| 6529 DCHECK(m_wouldLoadReason == Created || reason != Created); | 6542 DCHECK(m_wouldLoadReason == Created || reason != Created); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6572 } | 6585 } |
| 6573 | 6586 |
| 6574 void showLiveDocumentInstances() { | 6587 void showLiveDocumentInstances() { |
| 6575 WeakDocumentSet& set = liveDocumentSet(); | 6588 WeakDocumentSet& set = liveDocumentSet(); |
| 6576 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6589 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6577 for (Document* document : set) | 6590 for (Document* document : set) |
| 6578 fprintf(stderr, "- Document %p URL: %s\n", document, | 6591 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6579 document->url().getString().utf8().data()); | 6592 document->url().getString().utf8().data()); |
| 6580 } | 6593 } |
| 6581 #endif | 6594 #endif |
| OLD | NEW |