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..1b771e736e67ad7a7ac447436783248de748bfe7 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" |
#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->hasIntersectionObserverData()) |
+ rareData->ensureIntersectionObserverData().activateValidIntersectionObservers(*this); |
haraken
2015/12/22 01:13:29
It looks a bit strange that you call ensureXXX aft
szager1
2015/12/22 07:53:40
Done.
|
+ } |
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->hasIntersectionObserverData()) |
+ data->ensureIntersectionObserverData().deactivateAllIntersectionObservers(*this); |
haraken
2015/12/22 01:13:29
Ditto.
esprehn
2015/12/22 07:50:32
+1
szager1
2015/12/22 07:53:41
Done.
|
} |
} |
@@ -2582,6 +2592,16 @@ Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionStat |
return nullptr; |
} |
+bool Element::hasIntersectionObserverData() const |
+{ |
+ return elementRareData() && elementRareData()->hasIntersectionObserverData(); |
+} |
+ |
+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) |
{ |