Changeset 269825 in webkit
- Timestamp:
- Nov 15, 2020 6:23:23 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269824 r269825 1 2020-11-15 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][Geometry] Add support for horizontal/vertical scrollbar spacing 4 https://bugs.webkit.org/show_bug.cgi?id=218950 5 6 Reviewed by Antti Koivisto. 7 8 Let's make room for visible scrollbars between the border and the padding box. 9 10 * layout/integration/LayoutIntegrationLineLayout.cpp: 11 (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): 12 * layout/layouttree/LayoutBoxGeometry.cpp: 13 (WebCore::Layout::BoxGeometry::BoxGeometry): 14 (WebCore::Layout::BoxGeometry::paddingBox const): 15 * layout/layouttree/LayoutBoxGeometry.h: 16 (WebCore::Layout::BoxGeometry::borderBoxHeight const): 17 (WebCore::Layout::BoxGeometry::borderBoxWidth const): 18 (WebCore::Layout::BoxGeometry::verticalScrollbarWidth const): 19 (WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const): 20 (WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth): 21 (WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight): 22 1 23 2020-11-15 Tim Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r269818 r269825 128 128 replacedBox.setContentSizeForIntegration({ replacedOrInlineBlock.contentWidth(), replacedOrInlineBlock.contentHeight() }); 129 129 130 auto& replacedBoxGeometry = m_layoutState.ensureGeometryForBox(replacedBox); 131 replacedBoxGeometry.setVerticalScrollbarWidth(replacedOrInlineBlock.verticalScrollbarWidth()); 132 replacedBoxGeometry.setHorizontalScrollbarHeight(replacedOrInlineBlock.horizontalScrollbarHeight()); 133 130 134 auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine); 131 135 replacedBox.setBaseline(baseline); -
trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp
r268948 r269825 44 44 , m_border(other.m_border) 45 45 , m_padding(other.m_padding) 46 , m_verticalScrollbarWidth(other.m_verticalScrollbarWidth) 47 , m_horizontalScrollbarHeight(other.m_horizontalScrollbarHeight) 46 48 #if ASSERT_ENABLED 47 49 , m_hasValidTop(other.m_hasValidTop) … … 89 91 paddingBox.setTop(borderBox.top() + borderTop()); 90 92 paddingBox.setLeft(borderBox.left() + borderLeft()); 91 paddingBox.setHeight(borderBox.bottom() - borderTop() - borderBottom());92 paddingBox.setWidth(borderBox.width() - border Left() - borderRight());93 paddingBox.setHeight(borderBox.bottom() - horizontalScrollbarHeight() - borderBottom() - borderTop()); 94 paddingBox.setWidth(borderBox.width() - borderRight() - verticalScrollbarWidth() - borderLeft()); 93 95 return paddingBox; 94 96 } -
trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h
r268948 r269825 92 92 LayoutUnit paddingBoxWidth() const { return paddingLeft().valueOr(0) + contentBoxWidth() + paddingRight().valueOr(0); } 93 93 94 LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + borderBottom(); }95 LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + borderRight(); }94 LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + horizontalScrollbarHeight() + borderBottom(); } 95 LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + verticalScrollbarWidth() + borderRight(); } 96 96 LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); } 97 97 LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); } … … 99 99 LayoutUnit verticalMarginBorderAndPadding() const { return marginBefore() + verticalBorder() + verticalPadding().valueOr(0) + marginAfter(); } 100 100 LayoutUnit horizontalMarginBorderAndPadding() const { return marginStart() + horizontalBorder() + horizontalPadding().valueOr(0) + marginEnd(); } 101 102 LayoutUnit verticalScrollbarWidth() const { return m_verticalScrollbarWidth; } 103 LayoutUnit horizontalScrollbarHeight() const { return m_horizontalScrollbarHeight; } 101 104 102 105 Rect marginBox() const; … … 128 131 void setPadding(Optional<Layout::Edges>); 129 132 133 void setVerticalScrollbarWidth(LayoutUnit width) { m_verticalScrollbarWidth = width; } 134 void setHorizontalScrollbarHeight(LayoutUnit height) { m_horizontalScrollbarHeight = height; } 135 130 136 private: 131 137 LayoutUnit logicalTop() const; … … 160 166 Layout::Edges m_border; 161 167 Optional<Layout::Edges> m_padding; 168 169 LayoutUnit m_verticalScrollbarWidth; 170 LayoutUnit m_horizontalScrollbarHeight; 162 171 163 172 #if ASSERT_ENABLED
Note: See TracChangeset
for help on using the changeset viewer.