Chromium Code Reviews| 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..b48c170693d00c7b5b5c796b55dbde94584ec26a 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); |
| + sizeMayHaveChanged(); |
| + |
| DCHECK(needsAttach()); |
| } |
| @@ -2663,6 +2666,15 @@ HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR |
| return ensureElementRareData().ensureResizeObserverData(); |
| } |
| +void Element::sizeMayHaveChanged() |
| +{ |
| + HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>* roData = resizeObserverData(); |
|
esprehn
2016/08/03 18:06:51
don't abbreviate, I'd either call this |data| or |
atotic1
2016/08/04 23:59:39
Done.
|
| + if (roData) { |
|
esprehn
2016/08/03 18:06:51
I'd early return:
if (!data)
return;
You can e
atotic1
2016/08/04 23:59:39
Done.
|
| + for (auto& iter : *roData) |
|
esprehn
2016/08/03 18:06:51
->values() and make the loop variable |observation
atotic1
2016/08/04 23:59:39
Done. Thanks for providing the solution. Still fee
|
| + iter.value->elementSizeChanged(); |
| + } |
| +} |
| + |
| // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() |
| static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState) |
| { |