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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.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/IntersectionObserver.h
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.h b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
index e07cdb2ec39e1e26f7ed235fb6af548770bde982..79d8c278613d9b812fea1e8e11bc8c8051df0a41 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
@@ -32,8 +32,8 @@ public:
void unobserve(Element*, ExceptionState&);
HeapVector<Member<IntersectionObserverEntry>> takeRecords();
- Element* root() { return m_root.get(); }
- LayoutObject* rootLayoutObject();
+ Node* root() const { return m_root.get(); }
+ LayoutObject* rootLayoutObject() const;
bool hasPercentMargin() const;
const Length& topMargin() const { return m_topMargin; }
const Length& rightMargin() const { return m_rightMargin; }
@@ -53,12 +53,12 @@ public:
DECLARE_TRACE();
private:
- explicit IntersectionObserver(IntersectionObserverCallback&, Element&, const Vector<Length>& rootMargin, const Vector<float>& thresholds);
+ explicit IntersectionObserver(IntersectionObserverCallback&, Node&, const Vector<Length>& rootMargin, const Vector<float>& thresholds);
void checkRootAndDetachIfNeeded();
Member<IntersectionObserverCallback> m_callback;
- WeakPtrWillBeWeakMember<Element> m_root;
+ WeakPtrWillBeWeakMember<Node> m_root;
HeapHashSet<WeakMember<IntersectionObservation>> m_observations;
HeapVector<Member<IntersectionObserverEntry>> m_entries;
Vector<float> m_thresholds;

Powered by Google App Engine
This is Rietveld 408576698