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

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

Issue 1548523002: Use Document, rather than document element, for implicit root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer
Patch Set: rebaseline Created 4 years, 11 months 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #include "core/dom/ExecutionContextTask.h" 76 #include "core/dom/ExecutionContextTask.h"
77 #include "core/dom/FrameRequestCallback.h" 77 #include "core/dom/FrameRequestCallback.h"
78 #include "core/dom/IntersectionObserverController.h" 78 #include "core/dom/IntersectionObserverController.h"
79 #include "core/dom/LayoutTreeBuilderTraversal.h" 79 #include "core/dom/LayoutTreeBuilderTraversal.h"
80 #include "core/dom/MainThreadTaskRunner.h" 80 #include "core/dom/MainThreadTaskRunner.h"
81 #include "core/dom/Microtask.h" 81 #include "core/dom/Microtask.h"
82 #include "core/dom/MutationObserver.h" 82 #include "core/dom/MutationObserver.h"
83 #include "core/dom/NodeChildRemovalTracker.h" 83 #include "core/dom/NodeChildRemovalTracker.h"
84 #include "core/dom/NodeComputedStyle.h" 84 #include "core/dom/NodeComputedStyle.h"
85 #include "core/dom/NodeFilter.h" 85 #include "core/dom/NodeFilter.h"
86 #include "core/dom/NodeIntersectionObserverData.h"
86 #include "core/dom/NodeIterator.h" 87 #include "core/dom/NodeIterator.h"
87 #include "core/dom/NodeRareData.h" 88 #include "core/dom/NodeRareData.h"
88 #include "core/dom/NodeTraversal.h" 89 #include "core/dom/NodeTraversal.h"
89 #include "core/dom/NodeWithIndex.h" 90 #include "core/dom/NodeWithIndex.h"
90 #include "core/dom/NthIndexCache.h" 91 #include "core/dom/NthIndexCache.h"
91 #include "core/dom/ProcessingInstruction.h" 92 #include "core/dom/ProcessingInstruction.h"
92 #include "core/dom/ScriptRunner.h" 93 #include "core/dom/ScriptRunner.h"
93 #include "core/dom/ScriptedAnimationController.h" 94 #include "core/dom/ScriptedAnimationController.h"
94 #include "core/dom/ScriptedIdleTaskController.h" 95 #include "core/dom/ScriptedIdleTaskController.h"
95 #include "core/dom/SelectorQuery.h" 96 #include "core/dom/SelectorQuery.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // FIXME: consider using ActiveDOMObject. 603 // FIXME: consider using ActiveDOMObject.
603 if (m_scriptedAnimationController) 604 if (m_scriptedAnimationController)
604 m_scriptedAnimationController->clearDocumentPointer(); 605 m_scriptedAnimationController->clearDocumentPointer();
605 m_scriptedAnimationController.clear(); 606 m_scriptedAnimationController.clear();
606 607
607 m_scriptedIdleTaskController.clear(); 608 m_scriptedIdleTaskController.clear();
608 609
609 if (svgExtensions()) 610 if (svgExtensions())
610 accessSVGExtensions().pauseAnimations(); 611 accessSVGExtensions().pauseAnimations();
611 612
613 if (m_intersectionObserverData)
614 m_intersectionObserverData->dispose();
615
612 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); 616 m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
613 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); 617 DocumentLifecycleNotifier::notifyDocumentWasDisposed();
614 618
615 m_canvasFontCache.clear(); 619 m_canvasFontCache.clear();
616 } 620 }
617 #endif 621 #endif
618 622
619 SelectorQueryCache& Document::selectorQueryCache() 623 SelectorQueryCache& Document::selectorQueryCache()
620 { 624 {
621 if (!m_selectorQueryCache) 625 if (!m_selectorQueryCache)
(...skipping 4447 matching lines...) Expand 10 before | Expand all | Expand 10 after
5069 #endif 5073 #endif
5070 } 5074 }
5071 5075
5072 IntersectionObserverController& Document::ensureIntersectionObserverController() 5076 IntersectionObserverController& Document::ensureIntersectionObserverController()
5073 { 5077 {
5074 if (!m_intersectionObserverController) 5078 if (!m_intersectionObserverController)
5075 m_intersectionObserverController = new IntersectionObserverController(); 5079 m_intersectionObserverController = new IntersectionObserverController();
5076 return *m_intersectionObserverController; 5080 return *m_intersectionObserverController;
5077 } 5081 }
5078 5082
5083 NodeIntersectionObserverData& Document::ensureIntersectionObserverData()
5084 {
5085 if (!m_intersectionObserverData)
5086 m_intersectionObserverData = new NodeIntersectionObserverData();
5087 return *m_intersectionObserverData;
5088 }
5089
5079 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt) 5090 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt)
5080 { 5091 {
5081 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); 5092 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText);
5082 } 5093 }
5083 5094
5084 void Document::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleM essage) 5095 void Document::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleM essage)
5085 { 5096 {
5086 if (!isContextThread()) { 5097 if (!isContextThread()) {
5087 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message())); 5098 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
5088 return; 5099 return;
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
5896 #ifndef NDEBUG 5907 #ifndef NDEBUG
5897 using namespace blink; 5908 using namespace blink;
5898 void showLiveDocumentInstances() 5909 void showLiveDocumentInstances()
5899 { 5910 {
5900 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5911 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5901 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5912 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5902 for (Document* document : set) 5913 for (Document* document : set)
5903 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5914 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5904 } 5915 }
5905 #endif 5916 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698