Title: [269825] trunk/Source/WebCore
- Revision
- 269825
- Author
- [email protected]
- Date
- 2020-11-15 06:23:23 -0800 (Sun, 15 Nov 2020)
Log Message
[LFC][Geometry] Add support for horizontal/vertical scrollbar spacing
https://bugs.webkit.org/show_bug.cgi?id=218950
Reviewed by Antti Koivisto.
Let's make room for visible scrollbars between the border and the padding box.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
* layout/layouttree/LayoutBoxGeometry.cpp:
(WebCore::Layout::BoxGeometry::BoxGeometry):
(WebCore::Layout::BoxGeometry::paddingBox const):
* layout/layouttree/LayoutBoxGeometry.h:
(WebCore::Layout::BoxGeometry::borderBoxHeight const):
(WebCore::Layout::BoxGeometry::borderBoxWidth const):
(WebCore::Layout::BoxGeometry::verticalScrollbarWidth const):
(WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const):
(WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth):
(WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (269824 => 269825)
--- trunk/Source/WebCore/ChangeLog 2020-11-15 09:30:54 UTC (rev 269824)
+++ trunk/Source/WebCore/ChangeLog 2020-11-15 14:23:23 UTC (rev 269825)
@@ -1,3 +1,25 @@
+2020-11-15 Zalan Bujtas <[email protected]>
+
+ [LFC][Geometry] Add support for horizontal/vertical scrollbar spacing
+ https://bugs.webkit.org/show_bug.cgi?id=218950
+
+ Reviewed by Antti Koivisto.
+
+ Let's make room for visible scrollbars between the border and the padding box.
+
+ * layout/integration/LayoutIntegrationLineLayout.cpp:
+ (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
+ * layout/layouttree/LayoutBoxGeometry.cpp:
+ (WebCore::Layout::BoxGeometry::BoxGeometry):
+ (WebCore::Layout::BoxGeometry::paddingBox const):
+ * layout/layouttree/LayoutBoxGeometry.h:
+ (WebCore::Layout::BoxGeometry::borderBoxHeight const):
+ (WebCore::Layout::BoxGeometry::borderBoxWidth const):
+ (WebCore::Layout::BoxGeometry::verticalScrollbarWidth const):
+ (WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const):
+ (WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth):
+ (WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight):
+
2020-11-15 Tim Horton <[email protected]>
Initial implementation of DOM rendering via the GPU process
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (269824 => 269825)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-11-15 09:30:54 UTC (rev 269824)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-11-15 14:23:23 UTC (rev 269825)
@@ -127,6 +127,10 @@
// Always use the physical size here for inline level boxes (this is where the logical vs. physical coords flip happens).
replacedBox.setContentSizeForIntegration({ replacedOrInlineBlock.contentWidth(), replacedOrInlineBlock.contentHeight() });
+ auto& replacedBoxGeometry = m_layoutState.ensureGeometryForBox(replacedBox);
+ replacedBoxGeometry.setVerticalScrollbarWidth(replacedOrInlineBlock.verticalScrollbarWidth());
+ replacedBoxGeometry.setHorizontalScrollbarHeight(replacedOrInlineBlock.horizontalScrollbarHeight());
+
auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine);
replacedBox.setBaseline(baseline);
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp (269824 => 269825)
--- trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp 2020-11-15 09:30:54 UTC (rev 269824)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp 2020-11-15 14:23:23 UTC (rev 269825)
@@ -43,6 +43,8 @@
, m_verticalMargin(other.m_verticalMargin)
, m_border(other.m_border)
, m_padding(other.m_padding)
+ , m_verticalScrollbarWidth(other.m_verticalScrollbarWidth)
+ , m_horizontalScrollbarHeight(other.m_horizontalScrollbarHeight)
#if ASSERT_ENABLED
, m_hasValidTop(other.m_hasValidTop)
, m_hasValidLeft(other.m_hasValidLeft)
@@ -88,8 +90,8 @@
Rect paddingBox;
paddingBox.setTop(borderBox.top() + borderTop());
paddingBox.setLeft(borderBox.left() + borderLeft());
- paddingBox.setHeight(borderBox.bottom() - borderTop() - borderBottom());
- paddingBox.setWidth(borderBox.width() - borderLeft() - borderRight());
+ paddingBox.setHeight(borderBox.bottom() - horizontalScrollbarHeight() - borderBottom() - borderTop());
+ paddingBox.setWidth(borderBox.width() - borderRight() - verticalScrollbarWidth() - borderLeft());
return paddingBox;
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h (269824 => 269825)
--- trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h 2020-11-15 09:30:54 UTC (rev 269824)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h 2020-11-15 14:23:23 UTC (rev 269825)
@@ -91,8 +91,8 @@
LayoutUnit paddingBoxHeight() const { return paddingTop().valueOr(0) + contentBoxHeight() + paddingBottom().valueOr(0); }
LayoutUnit paddingBoxWidth() const { return paddingLeft().valueOr(0) + contentBoxWidth() + paddingRight().valueOr(0); }
- LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + borderBottom(); }
- LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + borderRight(); }
+ LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + horizontalScrollbarHeight() + borderBottom(); }
+ LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + verticalScrollbarWidth() + borderRight(); }
LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); }
LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); }
@@ -99,6 +99,9 @@
LayoutUnit verticalMarginBorderAndPadding() const { return marginBefore() + verticalBorder() + verticalPadding().valueOr(0) + marginAfter(); }
LayoutUnit horizontalMarginBorderAndPadding() const { return marginStart() + horizontalBorder() + horizontalPadding().valueOr(0) + marginEnd(); }
+ LayoutUnit verticalScrollbarWidth() const { return m_verticalScrollbarWidth; }
+ LayoutUnit horizontalScrollbarHeight() const { return m_horizontalScrollbarHeight; }
+
Rect marginBox() const;
Rect borderBox() const;
Rect paddingBox() const;
@@ -127,6 +130,9 @@
void setVerticalPadding(Layout::VerticalEdges);
void setPadding(Optional<Layout::Edges>);
+ void setVerticalScrollbarWidth(LayoutUnit width) { m_verticalScrollbarWidth = width; }
+ void setHorizontalScrollbarHeight(LayoutUnit height) { m_horizontalScrollbarHeight = height; }
+
private:
LayoutUnit logicalTop() const;
LayoutUnit logicalLeft() const;
@@ -160,6 +166,9 @@
Layout::Edges m_border;
Optional<Layout::Edges> m_padding;
+ LayoutUnit m_verticalScrollbarWidth;
+ LayoutUnit m_horizontalScrollbarHeight;
+
#if ASSERT_ENABLED
bool m_hasValidTop { false };
bool m_hasValidLeft { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes