| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index ba5c7821706e1435499ee6ffa341c677a4bd57d5..21613093d8be0f93133441cf6e680f631b111d2f 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -3493,6 +3493,28 @@ 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)
|
|
|