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

Side by Side Diff: third_party/WebKit/Source/core/observer/ResizeObserverEntry.cpp

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix global-interface-listing test 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/observer/ResizeObserverEntry.h"
6
7 #include "core/dom/ClientRect.h"
8 #include "core/dom/DOMRectReadOnly.h"
9 #include "core/dom/Element.h"
10 #include "core/layout/LayoutBox.h"
11
12 namespace blink {
13
14 class ResizeObservation;
15
16 ResizeObserverEntry::ResizeObserverEntry(Element* target)
17 : m_target(target)
18 {
19 if (!m_target)
20 return;
21 LayoutBox* layout = m_target->layoutBox();
22 if (!layout) {
23 m_contentRect = ClientRect::create(IntRect(0, 0, 0, 0));
24 } else {
25 m_contentRect = ClientRect::create(FloatRect(
26 layout->paddingLeft(), layout->paddingTop(),
eae 2016/07/13 23:39:47 Shouldn't the location include borderLeft and bord
atotic1 2016/07/15 01:43:17 Location does not include borderLeft/Top. See disc
27 layout->contentWidth(), layout->contentHeight()));
28 }
29 }
30
31 LayoutSize ResizeObserverEntry::contentSize() const
32 {
33 return LayoutSize(m_contentRect->width(), m_contentRect->height());
34 }
35
36 DEFINE_TRACE(ResizeObserverEntry)
37 {
38 visitor->trace(m_target);
39 visitor->trace(m_contentRect);
40 }
41
42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698