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 a215cf9cc02bbc4ea443f940b799c5c78d6b8f53..9111784280699e90f398d38eb77f4b25155474da 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -55,6 +55,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" |
@@ -106,6 +107,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" |
@@ -1468,8 +1471,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->intersectionObserverData().activateValidIntersectionObservers(*this); |
+ } |
if (isUpgradedCustomElement() && inDocument()) |
CustomElement::didAttach(this, document()); |
@@ -1547,6 +1554,9 @@ void Element::removedFrom(ContainerNode* insertionPoint, Node* next) |
if (ElementAnimations* elementAnimations = data->elementAnimations()) |
elementAnimations->cssAnimations().cancel(); |
+ |
+ if (data->hasIntersectionObserverData()) |
+ data->intersectionObserverData().deactivateAllIntersectionObservers(*this); |
} |
} |
@@ -2599,6 +2609,16 @@ Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionStat |
return nullptr; |
} |
+bool Element::hasIntersectionObserverData() const |
+{ |
+ return elementRareData() && elementRareData()->hasIntersectionObserverData(); |
+} |
+ |
+ElementIntersectionObserverData& Element::intersectionObserverData() |
esprehn
2015/12/17 01:40:28
ensureIntersectionObserverData()
szager1
2015/12/17 20:27:25
Done.
|
+{ |
+ return ensureElementRareData().intersectionObserverData(); |
esprehn
2015/12/17 01:40:28
ensure* for the method on ElementRareData too
szager1
2015/12/17 20:27:25
Done.
|
+} |
+ |
// Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() |
static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState) |
{ |