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

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

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update to master: Vector<WeakMember> no longer ok. Created 4 years, 6 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/ElementRareData.cpp
diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.cpp b/third_party/WebKit/Source/core/dom/ElementRareData.cpp
index b15778b356ff785ff1178a25a179bb029fcf6a1d..a3f7910f8359c1d8b0165594f4a458e329642da7 100644
--- a/third_party/WebKit/Source/core/dom/ElementRareData.cpp
+++ b/third_party/WebKit/Source/core/dom/ElementRareData.cpp
@@ -32,6 +32,8 @@
#include "core/css/cssom/InlineStylePropertyMap.h"
#include "core/dom/CompositorProxiedPropertySet.h"
+#include "core/observer/ResizeObservation.h"
+#include "core/observer/ResizeObserver.h"
#include "core/style/ComputedStyle.h"
namespace blink {
@@ -41,7 +43,7 @@ struct SameSizeAsElementRareData : NodeRareData {
LayoutSize sizeForResizing;
IntSize scrollOffset;
void* pointers[10];
- Member<void*> persistentMember[3];
+ Member<void*> persistentMember[4];
};
CSSStyleDeclaration& ElementRareData::ensureInlineCSSStyleDeclaration(Element* ownerElement)
@@ -66,6 +68,13 @@ AttrNodeList& ElementRareData::ensureAttrNodeList()
return *m_attrNodeList;
}
+ElementRareData::ResizeObserverDataMap& ElementRareData::ensureResizeObserverData()
+{
+ if (!m_resizeObserverData)
+ m_resizeObserverData = new HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>();
+ return *m_resizeObserverData;
+}
+
DEFINE_TRACE_AFTER_DISPATCH(ElementRareData)
{
visitor->trace(m_dataset);
@@ -79,6 +88,7 @@ DEFINE_TRACE_AFTER_DISPATCH(ElementRareData)
visitor->trace(m_pseudoElementData);
visitor->trace(m_customElementDefinition);
visitor->trace(m_intersectionObserverData);
+ visitor->trace(m_resizeObserverData);
NodeRareData::traceAfterDispatch(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698