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

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

Issue 2204503002: ResizeObserver pt6: integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 ef260adf32dc31fb8e8c0d0dfbfbde675c104369..01aba9e94c81d6788ee8ff82ab3541dd3aaa5c33 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -116,6 +116,7 @@
#include "core/layout/api/LayoutBoxItem.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/loader/DocumentLoader.h"
+#include "core/observer/ResizeObservation.h"
#include "core/page/ChromeClient.h"
#include "core/page/FocusController.h"
#include "core/page/Page.h"
@@ -1623,6 +1624,8 @@ void Element::detachLayoutTree(const AttachContext& context)
if (svgFilterNeedsLayerUpdate())
document().unscheduleSVGFilterLayerUpdateHack(*this);
+ sizeMightHaveChanged();
+
DCHECK(needsAttach());
}
@@ -2663,6 +2666,15 @@ HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR
return ensureElementRareData().ensureResizeObserverData();
}
+void Element::sizeMightHaveChanged()
+{
+ HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>* roData = resizeObserverData();
+ if (roData) {
+ for (auto& iter : *roData)
+ iter.value->elementSizeChanged();
+ }
+}
+
// Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState)
{

Powered by Google App Engine
This is Rietveld 408576698