Title: [270109] trunk/Source/WebCore
- Revision
- 270109
- Author
- [email protected]
- Date
- 2020-11-20 05:32:42 -0800 (Fri, 20 Nov 2020)
Log Message
[LFC] BoxGeometry only tracks the reserved horizontal/vertical space for the scrollbars
https://bugs.webkit.org/show_bug.cgi?id=219178
Reviewed by Antti Koivisto.
BoxGeometry does not care whether it's a horizontal or vertical scrollbar. It only cares about the space we need to reserve for them.
* 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::verticalSpaceForScrollbar const):
(WebCore::Layout::BoxGeometry::horizontalSpaceForScrollbar const):
(WebCore::Layout::BoxGeometry::setVerticalSpaceForScrollbar):
(WebCore::Layout::BoxGeometry::setHorizontalSpaceForScrollbar):
(WebCore::Layout::BoxGeometry::verticalScrollbarWidth const): Deleted.
(WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const): Deleted.
(WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth): Deleted.
(WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (270108 => 270109)
--- trunk/Source/WebCore/ChangeLog 2020-11-20 13:24:35 UTC (rev 270108)
+++ trunk/Source/WebCore/ChangeLog 2020-11-20 13:32:42 UTC (rev 270109)
@@ -1,3 +1,29 @@
+2020-11-20 Zalan Bujtas <[email protected]>
+
+ [LFC] BoxGeometry only tracks the reserved horizontal/vertical space for the scrollbars
+ https://bugs.webkit.org/show_bug.cgi?id=219178
+
+ Reviewed by Antti Koivisto.
+
+ BoxGeometry does not care whether it's a horizontal or vertical scrollbar. It only cares about the space we need to reserve for them.
+
+ * 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::verticalSpaceForScrollbar const):
+ (WebCore::Layout::BoxGeometry::horizontalSpaceForScrollbar const):
+ (WebCore::Layout::BoxGeometry::setVerticalSpaceForScrollbar):
+ (WebCore::Layout::BoxGeometry::setHorizontalSpaceForScrollbar):
+ (WebCore::Layout::BoxGeometry::verticalScrollbarWidth const): Deleted.
+ (WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const): Deleted.
+ (WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth): Deleted.
+ (WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight): Deleted.
+
2020-11-20 Alan Bujtas <[email protected]>
Unreviewed, reverting r270070.
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (270108 => 270109)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-11-20 13:24:35 UTC (rev 270108)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-11-20 13:32:42 UTC (rev 270109)
@@ -130,10 +130,10 @@
auto& replacedBoxGeometry = m_layoutState.ensureGeometryForBox(replacedBox);
// Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though.
auto horizontalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.width() - replacedOrInlineBlock.paddingBoxWidth(), LayoutUnit(replacedOrInlineBlock.verticalScrollbarWidth()));
- replacedBoxGeometry.setVerticalScrollbarWidth(horizontalSpaceReservedForScrollbar);
+ replacedBoxGeometry.setHorizontalSpaceForScrollbar(horizontalSpaceReservedForScrollbar);
auto verticalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.height() - replacedOrInlineBlock.paddingBoxHeight(), LayoutUnit(replacedOrInlineBlock.horizontalScrollbarHeight()));
- replacedBoxGeometry.setHorizontalScrollbarHeight(verticalSpaceReservedForScrollbar);
+ replacedBoxGeometry.setVerticalSpaceForScrollbar(verticalSpaceReservedForScrollbar);
auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine);
replacedBox.setBaseline(roundToInt(baseline));
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp (270108 => 270109)
--- trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp 2020-11-20 13:24:35 UTC (rev 270108)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp 2020-11-20 13:32:42 UTC (rev 270109)
@@ -43,8 +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)
+ , m_verticalSpaceForScrollbar(other.m_verticalSpaceForScrollbar)
+ , m_horizontalSpaceForScrollbar(other.m_horizontalSpaceForScrollbar)
#if ASSERT_ENABLED
, m_hasValidTop(other.m_hasValidTop)
, m_hasValidLeft(other.m_hasValidLeft)
@@ -90,8 +90,8 @@
Rect paddingBox;
paddingBox.setTop(borderBox.top() + borderTop());
paddingBox.setLeft(borderBox.left() + borderLeft());
- paddingBox.setHeight(borderBox.bottom() - horizontalScrollbarHeight() - borderBottom() - borderTop());
- paddingBox.setWidth(borderBox.width() - borderRight() - verticalScrollbarWidth() - borderLeft());
+ paddingBox.setHeight(borderBox.bottom() - verticalSpaceForScrollbar() - borderBottom() - borderTop());
+ paddingBox.setWidth(borderBox.width() - borderRight() - horizontalSpaceForScrollbar() - borderLeft());
return paddingBox;
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h (270108 => 270109)
--- trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h 2020-11-20 13:24:35 UTC (rev 270108)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h 2020-11-20 13:32:42 UTC (rev 270109)
@@ -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() + horizontalScrollbarHeight() + borderBottom(); }
- LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + verticalScrollbarWidth() + borderRight(); }
+ LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + verticalSpaceForScrollbar() + borderBottom(); }
+ LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + horizontalSpaceForScrollbar() + borderRight(); }
LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); }
LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); }
@@ -99,8 +99,8 @@
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; }
+ LayoutUnit verticalSpaceForScrollbar() const { return m_verticalSpaceForScrollbar; }
+ LayoutUnit horizontalSpaceForScrollbar() const { return m_horizontalSpaceForScrollbar; }
Rect marginBox() const;
Rect borderBox() const;
@@ -130,8 +130,8 @@
void setVerticalPadding(Layout::VerticalEdges);
void setPadding(Optional<Layout::Edges>);
- void setVerticalScrollbarWidth(LayoutUnit width) { m_verticalScrollbarWidth = width; }
- void setHorizontalScrollbarHeight(LayoutUnit height) { m_horizontalScrollbarHeight = height; }
+ void setVerticalSpaceForScrollbar(LayoutUnit scrollbarHeight) { m_verticalSpaceForScrollbar = scrollbarHeight; }
+ void setHorizontalSpaceForScrollbar(LayoutUnit scrollbarWidth) { m_horizontalSpaceForScrollbar = scrollbarWidth; }
private:
LayoutUnit logicalTop() const;
@@ -166,8 +166,8 @@
Layout::Edges m_border;
Optional<Layout::Edges> m_padding;
- LayoutUnit m_verticalScrollbarWidth;
- LayoutUnit m_horizontalScrollbarHeight;
+ LayoutUnit m_verticalSpaceForScrollbar;
+ LayoutUnit m_horizontalSpaceForScrollbar;
#if ASSERT_ENABLED
bool m_hasValidTop { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes