Changeset 276135 in webkit
- Timestamp:
- Apr 16, 2021, 6:35:08 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/inline-block/non-overlay-scrollbar-incorrect-padding-expected.txt (added)
-
LayoutTests/fast/inline-block/non-overlay-scrollbar-incorrect-padding.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276134 r276135 1 2021-04-16 Zalan Bujtas <zalan@apple.com> 2 3 [IFC] Incorrect box height when scrollbar takes padding box space 4 https://bugs.webkit.org/show_bug.cgi?id=224546 5 <rdar://problem/76666402> 6 7 Reviewed by Antti Koivisto. 8 9 * fast/inline-block/non-overlay-scrollbar-incorrect-padding-expected.txt: Added. 10 * fast/inline-block/non-overlay-scrollbar-incorrect-padding.html: Added. 11 1 12 2021-04-16 Diego Pino Garcia <dpino@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r276133 r276135 1 2021-04-16 Zalan Bujtas <zalan@apple.com> 2 3 [IFC] Incorrect box height when scrollbar takes padding box space 4 https://bugs.webkit.org/show_bug.cgi?id=224546 5 <rdar://problem/76666402> 6 7 Reviewed by Antti Koivisto. 8 9 This patch fixes the case when a non-overlay scrollbar can't be accomodated in the padding/content box area (e.g <div style="height: 10px; overflow: scroll">...) 10 In the legacy render tree the non-overlay scrollbar size is already taken into account when calling RenderBox::contentWidth/Height (paddingBoxHeight/Width), so 11 we just have to check how much space they actully take (currently maximum of 15px). 12 13 Test: fast/inline-block/non-overlay-scrollbar-incorrect-padding.html 14 15 * layout/integration/LayoutIntegrationLineLayout.cpp: 16 (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): 17 1 18 2021-04-16 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r275214 r276135 146 146 // Always use the physical size here for inline level boxes (this is where the logical vs. physical coords flip happens). 147 147 auto& replacedBoxGeometry = m_layoutState.ensureGeometryForBox(replacedBox); 148 // Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though. 149 auto horizontalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.width() - replacedOrInlineBlock.paddingBoxWidth(), LayoutUnit(replacedOrInlineBlock.verticalScrollbarWidth())); 148 149 // Scrollbars eat into the padding box area. They never stretch the border box but they may shrink the padding box. 150 // In legacy render tree, RenderBox::contentWidth/contentHeight values are adjusted to accomodate the scrollbar width/height. 151 // e.g. <div style="width: 10px; overflow: scroll;">content</div>, RenderBox::contentWidth() won't be returning the value of 10px but instead 0px (10px - 15px). 152 auto horizontalSpaceReservedForScrollbar = replacedOrInlineBlock.paddingBoxRectIncludingScrollbar().width() - replacedOrInlineBlock.paddingBoxWidth(); 150 153 replacedBoxGeometry.setHorizontalSpaceForScrollbar(horizontalSpaceReservedForScrollbar); 151 154 152 auto verticalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.height() - replacedOrInlineBlock.paddingBoxHeight(), LayoutUnit(replacedOrInlineBlock.horizontalScrollbarHeight()));155 auto verticalSpaceReservedForScrollbar = replacedOrInlineBlock.paddingBoxRectIncludingScrollbar().height() - replacedOrInlineBlock.paddingBoxHeight(); 153 156 replacedBoxGeometry.setVerticalSpaceForScrollbar(verticalSpaceReservedForScrollbar); 154 157
Note:
See TracChangeset
for help on using the changeset viewer.