Changeset 270049 in webkit


Ignore:
Timestamp:
Nov 19, 2020 1:37:08 PM (3 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Do not stretch the border box with the scrollbars
https://bugs.webkit.org/show_bug.cgi?id=219174

Reviewed by Antti Koivisto.

Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270048 r270049  
     12020-11-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Do not stretch the border box with the scrollbars
     4        https://bugs.webkit.org/show_bug.cgi?id=219174
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though.
     9
     10        * layout/integration/LayoutIntegrationLineLayout.cpp:
     11        (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
     12
    1132020-11-19  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r269912 r270049  
    129129
    130130    auto& replacedBoxGeometry = m_layoutState.ensureGeometryForBox(replacedBox);
    131     replacedBoxGeometry.setVerticalScrollbarWidth(replacedOrInlineBlock.verticalScrollbarWidth());
    132     replacedBoxGeometry.setHorizontalScrollbarHeight(replacedOrInlineBlock.horizontalScrollbarHeight());
     131    // Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though.
     132    auto horizontalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.width() - replacedOrInlineBlock.paddingBoxWidth(), LayoutUnit(replacedOrInlineBlock.verticalScrollbarWidth()));
     133    replacedBoxGeometry.setVerticalScrollbarWidth(horizontalSpaceReservedForScrollbar);
     134
     135    auto verticalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.height() - replacedOrInlineBlock.paddingBoxHeight(), LayoutUnit(replacedOrInlineBlock.horizontalScrollbarHeight()));
     136    replacedBoxGeometry.setHorizontalScrollbarHeight(verticalSpaceReservedForScrollbar);
    133137
    134138    auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine);
Note: See TracChangeset for help on using the changeset viewer.