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

Unified Diff: third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp

Issue 2185533004: ResizeObserver pt4: IDL methods (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
« no previous file with comments | « third_party/WebKit/Source/core/observer/ResizeObserverEntry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp
diff --git a/third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp b/third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp
index e307b8d5e385706b0db70140eec35e6fd9872d6f..8d925bfc41fbe7ec8a5b0bc99c965472197bda6b 100644
--- a/third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp
+++ b/third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp
@@ -5,7 +5,6 @@
#include "core/observer/ResizeObserverEntry.h"
#include "core/dom/ClientRect.h"
-#include "core/dom/DOMRectReadOnly.h"
#include "core/dom/Element.h"
#include "core/layout/LayoutBox.h"
#include "core/observer/ResizeObservation.h"
@@ -17,6 +16,18 @@ class ResizeObservation;
ResizeObserverEntry::ResizeObserverEntry(Element* target)
: m_target(target)
{
+ FloatSize size = FloatSize(ResizeObservation::getTargetSize(m_target));
+ FloatPoint location;
+ LayoutBox* layout = m_target ? m_target->layoutBox() : nullptr;
+ if (layout) {
+ location = FloatPoint(layout->paddingLeft(), layout->paddingTop());
+ }
+ m_contentRect = ClientRect::create(FloatRect(location, size));
+}
+
+LayoutSize ResizeObserverEntry::contentSize() const
+{
+ return LayoutSize(m_contentRect->width(), m_contentRect->height());
}
DEFINE_TRACE(ResizeObserverEntry)
« no previous file with comments | « third_party/WebKit/Source/core/observer/ResizeObserverEntry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698