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

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

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add RuntimeEnabled flags to all idl's, fix test expectations. 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "core/dom/DocumentFragment.h" 68 #include "core/dom/DocumentFragment.h"
69 #include "core/dom/DocumentLifecycleObserver.h" 69 #include "core/dom/DocumentLifecycleObserver.h"
70 #include "core/dom/DocumentType.h" 70 #include "core/dom/DocumentType.h"
71 #include "core/dom/Element.h" 71 #include "core/dom/Element.h"
72 #include "core/dom/ElementDataCache.h" 72 #include "core/dom/ElementDataCache.h"
73 #include "core/dom/ElementRegistrationOptions.h" 73 #include "core/dom/ElementRegistrationOptions.h"
74 #include "core/dom/ElementTraversal.h" 74 #include "core/dom/ElementTraversal.h"
75 #include "core/dom/ExceptionCode.h" 75 #include "core/dom/ExceptionCode.h"
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/LayoutTreeBuilderTraversal.h" 79 #include "core/dom/LayoutTreeBuilderTraversal.h"
79 #include "core/dom/MainThreadTaskRunner.h" 80 #include "core/dom/MainThreadTaskRunner.h"
80 #include "core/dom/Microtask.h" 81 #include "core/dom/Microtask.h"
81 #include "core/dom/MutationObserver.h" 82 #include "core/dom/MutationObserver.h"
82 #include "core/dom/NodeChildRemovalTracker.h" 83 #include "core/dom/NodeChildRemovalTracker.h"
83 #include "core/dom/NodeComputedStyle.h" 84 #include "core/dom/NodeComputedStyle.h"
84 #include "core/dom/NodeFilter.h" 85 #include "core/dom/NodeFilter.h"
85 #include "core/dom/NodeIterator.h" 86 #include "core/dom/NodeIterator.h"
86 #include "core/dom/NodeRareData.h" 87 #include "core/dom/NodeRareData.h"
87 #include "core/dom/NodeTraversal.h" 88 #include "core/dom/NodeTraversal.h"
(...skipping 4488 matching lines...) Expand 10 before | Expand all | Expand 10 after
4576 4577
4577 ASSERT(doc); 4578 ASSERT(doc);
4578 return *doc; 4579 return *doc;
4579 } 4580 }
4580 4581
4581 WeakPtrWillBeRawPtr<Document> Document::contextDocument() 4582 WeakPtrWillBeRawPtr<Document> Document::contextDocument()
4582 { 4583 {
4583 if (m_contextDocument) 4584 if (m_contextDocument)
4584 return m_contextDocument; 4585 return m_contextDocument;
4585 if (m_frame) { 4586 if (m_frame) {
4586 #if ENABLE(OILPAN) 4587 return createWeakPtr();
4587 return this;
4588 #else
4589 return m_weakFactory.createWeakPtr();
4590 #endif
4591 } 4588 }
4592 return nullptr; 4589 return nullptr;
4593 } 4590 }
4594 4591
4595 PassRefPtrWillBeRawPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionState& exceptionState) 4592 PassRefPtrWillBeRawPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionState& exceptionState)
4596 { 4593 {
4597 if (isHTMLDocument() && name != name.lower()) 4594 if (isHTMLDocument() && name != name.lower())
4598 UseCounter::count(*this, UseCounter::HTMLDocumentCreateAttributeNameNotL owercase); 4595 UseCounter::count(*this, UseCounter::HTMLDocumentCreateAttributeNameNotL owercase);
4599 return createAttributeNS(nullAtom, name, exceptionState, true); 4596 return createAttributeNS(nullAtom, name, exceptionState, true);
4600 } 4597 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
5056 { 5053 {
5057 if (equalIgnoringCase(dnsPrefetchControl, "on") && !m_haveExplicitlyDisabled DNSPrefetch) { 5054 if (equalIgnoringCase(dnsPrefetchControl, "on") && !m_haveExplicitlyDisabled DNSPrefetch) {
5058 m_isDNSPrefetchEnabled = true; 5055 m_isDNSPrefetchEnabled = true;
5059 return; 5056 return;
5060 } 5057 }
5061 5058
5062 m_isDNSPrefetchEnabled = false; 5059 m_isDNSPrefetchEnabled = false;
5063 m_haveExplicitlyDisabledDNSPrefetch = true; 5060 m_haveExplicitlyDisabledDNSPrefetch = true;
5064 } 5061 }
5065 5062
5063 WeakPtrWillBeRawPtr<Document> Document::createWeakPtr()
5064 {
5065 #if ENABLE(OILPAN)
5066 return this;
5067 #else
5068 return m_weakFactory.createWeakPtr();
5069 #endif
5070 }
5071
5072 IntersectionObserverController& Document::ensureIntersectionObserverController()
5073 {
5074 if (!m_intersectionObserverController)
5075 m_intersectionObserverController = new IntersectionObserverController();
5076 return *m_intersectionObserverController;
5077 }
5078
5066 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt) 5079 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt)
5067 { 5080 {
5068 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); 5081 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText);
5069 } 5082 }
5070 5083
5071 void Document::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleM essage) 5084 void Document::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleM essage)
5072 { 5085 {
5073 if (!isContextThread()) { 5086 if (!isContextThread()) {
5074 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message())); 5087 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
5075 return; 5088 return;
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
5859 visitor->trace(m_timers); 5872 visitor->trace(m_timers);
5860 visitor->trace(m_templateDocument); 5873 visitor->trace(m_templateDocument);
5861 visitor->trace(m_templateDocumentHost); 5874 visitor->trace(m_templateDocumentHost);
5862 visitor->trace(m_visibilityObservers); 5875 visitor->trace(m_visibilityObservers);
5863 visitor->trace(m_userActionElements); 5876 visitor->trace(m_userActionElements);
5864 visitor->trace(m_svgExtensions); 5877 visitor->trace(m_svgExtensions);
5865 visitor->trace(m_timeline); 5878 visitor->trace(m_timeline);
5866 visitor->trace(m_compositorPendingAnimations); 5879 visitor->trace(m_compositorPendingAnimations);
5867 visitor->trace(m_contextDocument); 5880 visitor->trace(m_contextDocument);
5868 visitor->trace(m_canvasFontCache); 5881 visitor->trace(m_canvasFontCache);
5882 visitor->trace(m_intersectionObserverController);
5869 WillBeHeapSupplementable<Document>::trace(visitor); 5883 WillBeHeapSupplementable<Document>::trace(visitor);
5870 #endif 5884 #endif
5871 TreeScope::trace(visitor); 5885 TreeScope::trace(visitor);
5872 ContainerNode::trace(visitor); 5886 ContainerNode::trace(visitor);
5873 ExecutionContext::trace(visitor); 5887 ExecutionContext::trace(visitor);
5874 DocumentLifecycleNotifier::trace(visitor); 5888 DocumentLifecycleNotifier::trace(visitor);
5875 SecurityContext::trace(visitor); 5889 SecurityContext::trace(visitor);
5876 } 5890 }
5877 5891
5878 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Document>; 5892 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Document>;
5879 5893
5880 } // namespace blink 5894 } // namespace blink
5881 5895
5882 #ifndef NDEBUG 5896 #ifndef NDEBUG
5883 using namespace blink; 5897 using namespace blink;
5884 void showLiveDocumentInstances() 5898 void showLiveDocumentInstances()
5885 { 5899 {
5886 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5900 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5887 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5901 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5888 for (Document* document : set) 5902 for (Document* document : set)
5889 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5903 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5890 } 5904 }
5891 #endif 5905 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698