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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 9034a842ff08eed765667e4d3dfa4a467b18e33b..21d4af537093e7d207524448712c162371ba2de5 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3560,6 +3560,29 @@ bool Element::supportsStyleSharing() const
return true;
}
+void Element::registerIntersectionObserver(IntersectionObserver* observer)
+{
+ size_t index = m_intersectionObservers.find(observer);
+ if (index != WTF::kNotFound)
+ return;
+
+ m_intersectionObservers.append(observer);
+ if (document().layoutView() && layoutObject())
+ document().layoutView()->addIntersectionObserverTarget(layoutObject());
+}
+
+void Element::unregisterIntersectionObserver(IntersectionObserver* observer)
+{
+ size_t index = m_intersectionObservers.find(observer);
+ if (index == WTF::kNotFound)
+ return;
+
+ m_intersectionObservers.remove(index);
+ if (document().layoutView() && layoutObject())
+ document().layoutView()->removeIntersectionObserverTarget(layoutObject());
+}
+
+
DEFINE_TRACE(Element)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/IntersectionObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698