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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObservation.h

Issue 1548523002: Use Document, rather than document element, for implicit root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer
Patch Set: Nits, comments, 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/IntersectionObservation.h
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.h b/third_party/WebKit/Source/core/dom/IntersectionObservation.h
index e832c6213f2c2bae809479537a4c3a587e07aaff..702882a74411ef3e1cf1163e0f82985a87d8314a 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.h
@@ -12,6 +12,7 @@ namespace blink {
class Element;
class IntersectionObserver;
+class Node;
class IntersectionObservation : public GarbageCollectedFinalized<IntersectionObservation> {
public:
@@ -24,7 +25,7 @@ public:
};
IntersectionObserver& observer() const { return *m_observer; }
- Element* target() const { return m_target.get(); }
+ Element* target() const;
bool isActive() const { return m_active; }
void setActive(bool active) { m_active = active; }
unsigned lastThresholdIndex() const { return m_lastThresholdIndex; }
@@ -43,7 +44,12 @@ private:
bool computeGeometry(IntersectionGeometry&);
Member<IntersectionObserver> m_observer;
- WeakPtrWillBeWeakMember<Element> m_target;
+
+ // TODO(szager): Why Node instead of Element? Because NodeIntersectionObserverData::createWeakPtr()
+ // returns a WeakPtr<Node>, which cannot be coerced into a WeakPtr<Element>. When oilpan rolls out,
+ // this can be changed to WeakMember<Element>.
+ WeakPtrWillBeWeakMember<Node> m_target;
+
unsigned m_active : 1;
unsigned m_shouldReportRootBounds : 1;
unsigned m_lastThresholdIndex : 30;
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementRareData.h ('k') | third_party/WebKit/Source/core/dom/IntersectionObservation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698