LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2003, 2006, 2007, 2015 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007, 2015 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void setLocation(const LayoutPoint& location) { m_frameRect.setLocation(loca
tion); } | 137 void setLocation(const LayoutPoint& location) { m_frameRect.setLocation(loca
tion); } |
138 ···· | 138 ···· |
139 void setSize(const LayoutSize& size) { m_frameRect.setSize(size); } | 139 void setSize(const LayoutSize& size) { m_frameRect.setSize(size); } |
140 void move(LayoutUnit dx, LayoutUnit dy) { m_frameRect.move(dx, dy); } | 140 void move(LayoutUnit dx, LayoutUnit dy) { m_frameRect.move(dx, dy); } |
141 | 141 |
142 LayoutRect frameRect() const { return m_frameRect; } | 142 LayoutRect frameRect() const { return m_frameRect; } |
143 void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; } | 143 void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; } |
144 | 144 |
145 LayoutRect marginBoxRect() const | 145 LayoutRect marginBoxRect() const |
146 { | 146 { |
147 LayoutRect box = borderBoxRect(); | 147 auto marginLeft = computedCSSPadding(style().marginLeft()); |
148 box.expand(m_marginBox); | 148 auto marginRight = computedCSSPadding(style().marginRight()); |
149 return box; | 149 auto marginTop = computedCSSPadding(style().marginTop()); |
| 150 auto marginBottom = computedCSSPadding(style().marginBottom()); |
| 151 return LayoutRect(-marginLeft, -marginTop, size().width() + marginLeft +
marginRight, size().height() + marginTop + marginBottom); |
150 } | 152 } |
151 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size());
} | 153 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size());
} |
152 LayoutRect paddingBoxRect() const { return LayoutRect(borderLeft(), borderTo
p(), contentWidth() + paddingLeft() + paddingRight(), contentHeight() + paddingT
op() + paddingBottom()); } | 154 LayoutRect paddingBoxRect() const { return LayoutRect(borderLeft(), borderTo
p(), contentWidth() + paddingLeft() + paddingRight(), contentHeight() + paddingT
op() + paddingBottom()); } |
153 LayoutRect borderBoundingBox() const final { return borderBoxRect(); } | 155 LayoutRect borderBoundingBox() const final { return borderBoxRect(); } |
154 | 156 |
155 WEBCORE_EXPORT RoundedRect::Radii borderRadii() const; | 157 WEBCORE_EXPORT RoundedRect::Radii borderRadii() const; |
156 | 158 |
157 // The content area of the box (excludes padding - and intrinsic padding for
table cells, etc... - and border). | 159 // The content area of the box (excludes padding - and intrinsic padding for
table cells, etc... - and border). |
158 LayoutRect contentBoxRect() const; | 160 LayoutRect contentBoxRect() const; |
159 LayoutPoint contentBoxLocation() const; | 161 LayoutPoint contentBoxLocation() const; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 bool usesCompositedScrolling() const; | 473 bool usesCompositedScrolling() const; |
472 ···· | 474 ···· |
473 bool percentageLogicalHeightIsResolvable() const; | 475 bool percentageLogicalHeightIsResolvable() const; |
474 bool hasUnsplittableScrollingOverflow() const; | 476 bool hasUnsplittableScrollingOverflow() const; |
475 bool isUnsplittableForPagination() const; | 477 bool isUnsplittableForPagination() const; |
476 | 478 |
477 bool shouldTreatChildAsReplacedInTableCells() const; | 479 bool shouldTreatChildAsReplacedInTableCells() const; |
478 ···· | 480 ···· |
479 LayoutRect localCaretRect(InlineBox*, unsigned caretOffset, LayoutUnit* extr
aWidthToEndOfLine = nullptr) override; | 481 LayoutRect localCaretRect(InlineBox*, unsigned caretOffset, LayoutUnit* extr
aWidthToEndOfLine = nullptr) override; |
480 | 482 |
481 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragm
entContainer* = nullptr, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarS
ize, PaintPhase = PaintPhaseBlockBackground); | 483 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderFragm
entContainer* = nullptr, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarS
ize, PaintPhase = PaintPhase::BlockBackground); |
482 virtual LayoutRect overflowClipRectForChildLayers(const LayoutPoint& locatio
n, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy) {
return overflowClipRect(location, fragment, relevancy); } | 484 virtual LayoutRect overflowClipRectForChildLayers(const LayoutPoint& locatio
n, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy) {
return overflowClipRect(location, fragment, relevancy); } |
483 LayoutRect clipRect(const LayoutPoint& location, RenderFragmentContainer*); | 485 LayoutRect clipRect(const LayoutPoint& location, RenderFragmentContainer*); |
484 virtual bool hasControlClip() const { return false; } | 486 virtual bool hasControlClip() const { return false; } |
485 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout
Rect(); } | 487 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout
Rect(); } |
486 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); | 488 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); |
487 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint
& accumulatedOffset); | 489 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint
& accumulatedOffset); |
488 | 490 |
489 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE
D(); } | 491 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE
D(); } |
490 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&); | 492 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&); |
491 virtual void paintMask(PaintInfo&, const LayoutPoint&); | 493 virtual void paintMask(PaintInfo&, const LayoutPoint&); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) | 796 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) |
795 deleteLineBoxWrapper(); | 797 deleteLineBoxWrapper(); |
796 } | 798 } |
797 | 799 |
798 m_inlineBoxWrapper = boxWrapper; | 800 m_inlineBoxWrapper = boxWrapper; |
799 } | 801 } |
800 | 802 |
801 } // namespace WebCore | 803 } // namespace WebCore |
802 | 804 |
803 SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderBox, isBox()) | 805 SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderBox, isBox()) |
LEFT | RIGHT |