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 316ab46c290824bdda94c157bfd1b715590322bb..a21f478ba2b36714cd8a98f8a59b67d18f7e0eb0 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -54,6 +54,7 @@ |
#include "core/dom/ClientRectList.h" |
#include "core/dom/DatasetDOMStringMap.h" |
#include "core/dom/ElementDataCache.h" |
+#include "core/dom/ElementIntersectionObserverData.h" |
#include "core/dom/ElementRareData.h" |
#include "core/dom/ElementTraversal.h" |
#include "core/dom/ExceptionCode.h" |
@@ -105,6 +106,8 @@ |
#include "core/html/HTMLTemplateElement.h" |
#include "core/html/parser/HTMLParserIdioms.h" |
#include "core/inspector/InspectorInstrumentation.h" |
+#include "core/layout/LayoutInline.h" |
+#include "core/layout/LayoutPart.h" |
haraken
2016/01/02 13:47:40
These #includes wouldn't be necessary.
szager1
2016/01/02 19:18:34
Done.
|
#include "core/layout/LayoutTextFragment.h" |
#include "core/layout/LayoutView.h" |
#include "core/loader/DocumentLoader.h" |
@@ -1453,8 +1456,12 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio |
if (!insertionPoint->isInTreeScope()) |
return InsertionDone; |
- if (hasRareData()) |
- elementRareData()->clearClassListValueForQuirksMode(); |
+ if (hasRareData()) { |
+ ElementRareData* rareData = elementRareData(); |
+ rareData->clearClassListValueForQuirksMode(); |
+ if (rareData->intersectionObserverData()) |
+ rareData->ensureIntersectionObserverData().activateValidIntersectionObservers(*this); |
haraken
2016/01/02 13:47:40
Nit: It looks a bit strange to call ensureXXX afte
szager1
2016/01/02 19:18:34
Fixed.
|
+ } |
if (isUpgradedCustomElement() && inDocument()) |
CustomElement::didAttach(this, document()); |
@@ -1532,6 +1539,9 @@ void Element::removedFrom(ContainerNode* insertionPoint) |
if (ElementAnimations* elementAnimations = data->elementAnimations()) |
elementAnimations->cssAnimations().cancel(); |
+ |
+ if (data->intersectionObserverData()) |
+ data->ensureIntersectionObserverData().deactivateAllIntersectionObservers(*this); |
haraken
2016/01/02 13:47:40
Ditto.
szager1
2016/01/02 19:18:34
Fixed.
|
} |
} |
@@ -2582,6 +2592,18 @@ Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionStat |
return nullptr; |
} |
+ElementIntersectionObserverData* Element::intersectionObserverData() const |
+{ |
+ if (elementRareData()) |
+ return elementRareData()->intersectionObserverData(); |
+ return nullptr; |
+} |
+ |
+ElementIntersectionObserverData& Element::ensureIntersectionObserverData() |
+{ |
+ return ensureElementRareData().ensureIntersectionObserverData(); |
+} |
+ |
// Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() |
static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState) |
{ |