OLD | NEW |
---|---|
(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 | |
OLD | NEW |