Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: snapshot Dec19 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 6340 matching lines...) Expand 10 before | Expand all | Expand 10 after
6442 return LayoutViewItem(m_layoutView); 6443 return LayoutViewItem(m_layoutView);
6443 } 6444 }
6444 6445
6445 PropertyRegistry* Document::propertyRegistry() { 6446 PropertyRegistry* Document::propertyRegistry() {
6446 // TODO(timloh): When the flag is removed, return a reference instead. 6447 // TODO(timloh): When the flag is removed, return a reference instead.
6447 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) 6448 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled())
6448 m_propertyRegistry = PropertyRegistry::create(); 6449 m_propertyRegistry = PropertyRegistry::create();
6449 return m_propertyRegistry; 6450 return m_propertyRegistry;
6450 } 6451 }
6451 6452
6453 ModuleMap* Document::ensureModuleMap() {
6454 if (!RuntimeEnabledFeatures::moduleScriptsEnabled())
6455 return nullptr;
6456
6457 if (!m_moduleMap && frame()) {
6458 m_moduleMap = ModuleMap::create(&frame()->script(), fetcher());
6459 }
6460
6461 return m_moduleMap;
6462 }
6463
6452 void Document::incrementPasswordCount() { 6464 void Document::incrementPasswordCount() {
6453 ++m_passwordCount; 6465 ++m_passwordCount;
6454 if (isSecureContext() || m_passwordCount != 1) { 6466 if (isSecureContext() || m_passwordCount != 1) {
6455 // The browser process only cares about passwords on pages where the 6467 // The browser process only cares about passwords on pages where the
6456 // top-level URL is not secure. Secure contexts must have a top-level 6468 // top-level URL is not secure. Secure contexts must have a top-level
6457 // URL that is secure, so there is no need to send notifications for 6469 // URL that is secure, so there is no need to send notifications for
6458 // password fields in secure contexts. 6470 // password fields in secure contexts.
6459 // 6471 //
6460 // Also, only send a message on the first visible password field; the 6472 // Also, only send a message on the first visible password field; the
6461 // browser process doesn't care about the presence of additional 6473 // browser process doesn't care about the presence of additional
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
6522 visitor->trace(m_svgExtensions); 6534 visitor->trace(m_svgExtensions);
6523 visitor->trace(m_timeline); 6535 visitor->trace(m_timeline);
6524 visitor->trace(m_compositorPendingAnimations); 6536 visitor->trace(m_compositorPendingAnimations);
6525 visitor->trace(m_contextDocument); 6537 visitor->trace(m_contextDocument);
6526 visitor->trace(m_canvasFontCache); 6538 visitor->trace(m_canvasFontCache);
6527 visitor->trace(m_intersectionObserverController); 6539 visitor->trace(m_intersectionObserverController);
6528 visitor->trace(m_snapCoordinator); 6540 visitor->trace(m_snapCoordinator);
6529 visitor->trace(m_resizeObserverController); 6541 visitor->trace(m_resizeObserverController);
6530 visitor->trace(m_propertyRegistry); 6542 visitor->trace(m_propertyRegistry);
6531 visitor->trace(m_styleReattachDataMap); 6543 visitor->trace(m_styleReattachDataMap);
6544 visitor->trace(m_moduleMap);
6532 Supplementable<Document>::trace(visitor); 6545 Supplementable<Document>::trace(visitor);
6533 TreeScope::trace(visitor); 6546 TreeScope::trace(visitor);
6534 ContainerNode::trace(visitor); 6547 ContainerNode::trace(visitor);
6535 ExecutionContext::trace(visitor); 6548 ExecutionContext::trace(visitor);
6536 SecurityContext::trace(visitor); 6549 SecurityContext::trace(visitor);
6537 SynchronousMutationNotifier::trace(visitor); 6550 SynchronousMutationNotifier::trace(visitor);
6538 } 6551 }
6539 6552
6540 void Document::maybeRecordLoadReason(WouldLoadReason reason) { 6553 void Document::maybeRecordLoadReason(WouldLoadReason reason) {
6541 DCHECK(m_wouldLoadReason == Created || reason != Created); 6554 DCHECK(m_wouldLoadReason == Created || reason != Created);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
6584 } 6597 }
6585 6598
6586 void showLiveDocumentInstances() { 6599 void showLiveDocumentInstances() {
6587 WeakDocumentSet& set = liveDocumentSet(); 6600 WeakDocumentSet& set = liveDocumentSet();
6588 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6601 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6589 for (Document* document : set) 6602 for (Document* document : set)
6590 fprintf(stderr, "- Document %p URL: %s\n", document, 6603 fprintf(stderr, "- Document %p URL: %s\n", document,
6591 document->url().getString().utf8().data()); 6604 document->url().getString().utf8().data());
6592 } 6605 }
6593 #endif 6606 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698