Changeset 295765 in webkit


Ignore:
Timestamp:
Jun 22, 2022 7:54:49 PM (23 months ago)
Author:
Alan Bujtas
Message:

Adding padding on a horizontal scroller prevents last item from being fully viewable
https://bugs.webkit.org/show_bug.cgi?id=236142
<rdar://problem/88495053>

Reviewed by Simon Fraser.

Flex box's padding end should be taken into account when computing scrollable overflow.

  • LayoutTests/fast/overflow/flex-box-overflow-with-padding-end-expected.html: Added.
  • LayoutTests/fast/overflow/flex-box-overflow-with-padding-end.html: Added.
  • Source/WebCore/rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeOverflow):

css3/flexbox/overflow-and-padding.html: matching Blink.

Canonical link: https://commits.webkit.org/251770@main

Location:
trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/css3/flexbox/overflow-and-padding-expected.txt

    r267644 r295765  
    11
    2 PASS #scrollable 1
     2FAIL #scrollable 1 assert_equals:
     3<div id="scrollable" data-expected-scroll-height="500" data-expected-scroll-width="400">
     4    <div id="item"></div>
     5</div>
     6scrollWidth expected 400 but got 500
    37Tests that padding bottom on a flexbox works in the face of overflowing content. Padding-right does not work. This matches the Blink/WebKit display:block behavior. Unfortunately, IE and Gecko both lose the padding bottom and the padding right.
    48
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r295633 r295765  
    696696            if (!paddingEnd())
    697697                return;
    698             // FIXME: Expand it to non-grid cases when applicable.
    699             if (!is<RenderGrid>(*this))
     698            // FIXME: Expand it to non-grid/flex cases when applicable.
     699            if (!is<RenderGrid>(*this) && !is<RenderFlexibleBox>(*this))
    700700                return;
    701701
Note: See TracChangeset for help on using the changeset viewer.