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

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

Issue 1330633003: Intersection Observer first draft Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Lost newline in merge Created 5 years, 3 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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 class HTMLElement; 118 class HTMLElement;
119 class HTMLFrameOwnerElement; 119 class HTMLFrameOwnerElement;
120 class HTMLHeadElement; 120 class HTMLHeadElement;
121 class HTMLImportLoader; 121 class HTMLImportLoader;
122 class HTMLImportsController; 122 class HTMLImportsController;
123 class HTMLLinkElement; 123 class HTMLLinkElement;
124 class HTMLScriptElement; 124 class HTMLScriptElement;
125 class HitTestRequest; 125 class HitTestRequest;
126 class IdleRequestCallback; 126 class IdleRequestCallback;
127 class InputDeviceCapabilities; 127 class InputDeviceCapabilities;
128 class IntersectionObserver;
128 class LayoutPoint; 129 class LayoutPoint;
129 class LiveNodeListBase; 130 class LiveNodeListBase;
130 class Locale; 131 class Locale;
131 class LocalFrame; 132 class LocalFrame;
132 class Location; 133 class Location;
133 class MainThreadTaskRunner; 134 class MainThreadTaskRunner;
134 class MediaQueryListListener; 135 class MediaQueryListListener;
135 class MediaQueryMatcher; 136 class MediaQueryMatcher;
136 class NodeFilter; 137 class NodeFilter;
137 class NodeIterator; 138 class NodeIterator;
(...skipping 28 matching lines...) Expand all
166 class TreeWalker; 167 class TreeWalker;
167 class VisitedLinkState; 168 class VisitedLinkState;
168 class WebGLRenderingContext; 169 class WebGLRenderingContext;
169 170
170 struct AnnotatedRegionValue; 171 struct AnnotatedRegionValue;
171 struct IconURL; 172 struct IconURL;
172 173
173 using MouseEventWithHitTestResults = EventWithHitTestResults<PlatformMouseEvent> ; 174 using MouseEventWithHitTestResults = EventWithHitTestResults<PlatformMouseEvent> ;
174 using ExceptionCode = int; 175 using ExceptionCode = int;
175 176
177 using IntersectionObservers = WillBeHeapListHashSet<RefPtrWillBeMember<Intersect ionObserver>>;
178
176 enum StyleResolverUpdateMode { 179 enum StyleResolverUpdateMode {
177 // Discards the StyleResolver and rebuilds it. 180 // Discards the StyleResolver and rebuilds it.
178 FullStyleUpdate, 181 FullStyleUpdate,
179 // Attempts to use StyleInvalidationAnalysis to avoid discarding the entire StyleResolver. 182 // Attempts to use StyleInvalidationAnalysis to avoid discarding the entire StyleResolver.
180 AnalyzedStyleUpdate 183 AnalyzedStyleUpdate
181 }; 184 };
182 185
183 enum NodeListInvalidationType { 186 enum NodeListInvalidationType {
184 DoNotInvalidateOnAttributeChanges = 0, 187 DoNotInvalidateOnAttributeChanges = 0,
185 InvalidateOnClassAttrChange, 188 InvalidateOnClassAttrChange,
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 bool hasListenerType(ListenerType listenerType) const { return (m_listenerTy pes & listenerType); } 674 bool hasListenerType(ListenerType listenerType) const { return (m_listenerTy pes & listenerType); }
672 void addListenerTypeIfNeeded(const AtomicString& eventType); 675 void addListenerTypeIfNeeded(const AtomicString& eventType);
673 676
674 bool hasMutationObserversOfType(MutationObserver::MutationType type) const 677 bool hasMutationObserversOfType(MutationObserver::MutationType type) const
675 { 678 {
676 return m_mutationObserverTypes & type; 679 return m_mutationObserverTypes & type;
677 } 680 }
678 bool hasMutationObservers() const { return m_mutationObserverTypes; } 681 bool hasMutationObservers() const { return m_mutationObserverTypes; }
679 void addMutationObserverTypes(MutationObserverOptions types) { m_mutationObs erverTypes |= types; } 682 void addMutationObserverTypes(MutationObserverOptions types) { m_mutationObs erverTypes |= types; }
680 683
684 void activateIntersectionObserver(IntersectionObserver&);
685 void resumeSuspendedIntersectionObservers();
686
681 void updateViewportDescription(); 687 void updateViewportDescription();
682 void processReferrerPolicy(const String& policy); 688 void processReferrerPolicy(const String& policy);
683 689
684 // Returns the owning element in the parent document. 690 // Returns the owning element in the parent document.
685 // Returns nullptr if this is the top level document. 691 // Returns nullptr if this is the top level document.
686 HTMLFrameOwnerElement* ownerElement() const; 692 HTMLFrameOwnerElement* ownerElement() const;
687 693
688 // Returns true if this document belongs to a frame that the parent document 694 // Returns true if this document belongs to a frame that the parent document
689 // made invisible (for instance by setting as style display:none). 695 // made invisible (for instance by setting as style display:none).
690 bool isInInvisibleSubframe() const; 696 bool isInInvisibleSubframe() const;
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 #if !ENABLE(OILPAN) 1064 #if !ENABLE(OILPAN)
1059 void dispose() override; 1065 void dispose() override;
1060 #endif 1066 #endif
1061 1067
1062 virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren(); 1068 virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren();
1063 1069
1064 bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr WillBeRawPtr<ContainerNode> newContainerNode, ExceptionState&); 1070 bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr WillBeRawPtr<ContainerNode> newContainerNode, ExceptionState&);
1065 void lockCompatibilityMode() { m_compatibilityModeLocked = true; } 1071 void lockCompatibilityMode() { m_compatibilityModeLocked = true; }
1066 ParserSynchronizationPolicy parserSynchronizationPolicy() const { return m_p arserSyncPolicy; } 1072 ParserSynchronizationPolicy parserSynchronizationPolicy() const { return m_p arserSyncPolicy; }
1067 1073
1074 void deliverIntersectionObservationsTimerFired(Timer<Document>*);
1075
1068 private: 1076 private:
1069 friend class IgnoreDestructiveWriteCountIncrementer; 1077 friend class IgnoreDestructiveWriteCountIncrementer;
1070 friend class NthIndexCache; 1078 friend class NthIndexCache;
1071 1079
1072 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check. 1080 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check.
1073 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check. 1081 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check.
1074 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check. 1082 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check.
1075 1083
1076 ScriptedAnimationController& ensureScriptedAnimationController(); 1084 ScriptedAnimationController& ensureScriptedAnimationController();
1077 ScriptedIdleTaskController& ensureScriptedIdleTaskController(); 1085 ScriptedIdleTaskController& ensureScriptedIdleTaskController();
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 WeakPtrWillBeWeakMember<Document> m_contextDocument; 1331 WeakPtrWillBeWeakMember<Document> m_contextDocument;
1324 1332
1325 bool m_hasFullscreenSupplement; // For early return in Fullscreen::fromIfExi sts() 1333 bool m_hasFullscreenSupplement; // For early return in Fullscreen::fromIfExi sts()
1326 1334
1327 WillBeHeapVector<RefPtrWillBeMember<Element>> m_topLayerElements; 1335 WillBeHeapVector<RefPtrWillBeMember<Element>> m_topLayerElements;
1328 1336
1329 int m_loadEventDelayCount; 1337 int m_loadEventDelayCount;
1330 Timer<Document> m_loadEventDelayTimer; 1338 Timer<Document> m_loadEventDelayTimer;
1331 Timer<Document> m_pluginLoadingTimer; 1339 Timer<Document> m_pluginLoadingTimer;
1332 1340
1341 Timer<Document> m_deliverIntersectionObservationsTimer;
1342 IntersectionObservers m_activeIntersectionObservers;
1343 IntersectionObservers m_suspendedIntersectionObservers;
1344
1333 ViewportDescription m_viewportDescription; 1345 ViewportDescription m_viewportDescription;
1334 ViewportDescription m_legacyViewportDescription; 1346 ViewportDescription m_legacyViewportDescription;
1335 Length m_viewportDefaultMinWidth; 1347 Length m_viewportDefaultMinWidth;
1336 1348
1337 ReferrerPolicy m_referrerPolicy; 1349 ReferrerPolicy m_referrerPolicy;
1338 1350
1339 DocumentTiming m_documentTiming; 1351 DocumentTiming m_documentTiming;
1340 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher; 1352 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher;
1341 bool m_writeRecursionIsTooDeep; 1353 bool m_writeRecursionIsTooDeep;
1342 unsigned m_writeRecursionDepth; 1354 unsigned m_writeRecursionDepth;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1445 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1434 1446
1435 } // namespace blink 1447 } // namespace blink
1436 1448
1437 #ifndef NDEBUG 1449 #ifndef NDEBUG
1438 // Outside the WebCore namespace for ease of invocation from gdb. 1450 // Outside the WebCore namespace for ease of invocation from gdb.
1439 CORE_EXPORT void showLiveDocumentInstances(); 1451 CORE_EXPORT void showLiveDocumentInstances();
1440 #endif 1452 #endif
1441 1453
1442 #endif // Document_h 1454 #endif // Document_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698