RESOLVED FIXED 236142
Adding padding on a horizontal scroller prevents last item from being fully viewable
https://bugs.webkit.org/show_bug.cgi?id=236142
Summary Adding padding on a horizontal scroller prevents last item from being fully v...
Charlie Croom
Reported 2022-02-04 09:53:32 PST
When a scrollable element has padding added to it, the last item can never be scrolled into view. This appears to be because there's not enough scrollable area added. Potentially related: the `scrollWidth` property appears to be smaller than that of Chrome and Firefox. Reduced repro (see Firefox/Chrome handling): https://jsfiddle.net/comp615/Lf15jkgp/15/ The example kind of illustrates Twitter's use case. We want to show a preview/peek of the next item, or to overflow the parent, while still aligning the scroller to the parent layout). Potentially related bugs: #95032 #201453
Attachments
Test case (1.18 KB, text/html)
2022-02-25 15:05 PST, Simon Fraser (smfr)
no flags
Patch (3.95 KB, patch)
2022-06-16 21:24 PDT, zalan
no flags
Patch (5.43 KB, patch)
2022-06-17 11:49 PDT, zalan
no flags
Patch (8.86 KB, patch)
2022-06-18 07:06 PDT, zalan
no flags
Test reduction (471 bytes, text/html)
2022-06-21 16:57 PDT, zalan
no flags
Patch (3.21 KB, patch)
2022-06-22 11:56 PDT, zalan
no flags
Patch (4.17 KB, patch)
2022-06-22 13:24 PDT, zalan
no flags
Simon Fraser (smfr)
Comment 1 2022-02-04 10:03:06 PST
This does indeed look like a rather serious bug.
Radar WebKit Bug Importer
Comment 2 2022-02-04 10:03:20 PST
Simon Fraser (smfr)
Comment 3 2022-02-25 15:05:05 PST
Created attachment 453268 [details] Test case
Simon Fraser (smfr)
Comment 4 2022-02-25 15:30:34 PST
This works for vertical scrollers, but not horizontal scrollers. For vertical scrollers, the padding is taken into account by the `oldClientAfterEdge` value passed in to `computeOverflow()`, which comes from clientLogicalBottom(). But there is no equivalent logic for horizontal padding.
Simon Fraser (smfr)
Comment 5 2022-02-25 15:30:54 PST
This is about the computation of layout overflow.
zalan
Comment 6 2022-06-16 21:24:56 PDT
zalan
Comment 7 2022-06-17 11:49:42 PDT
zalan
Comment 8 2022-06-18 07:06:01 PDT
Simon Fraser (smfr)
Comment 10 2022-06-20 11:06:12 PDT Comment hidden (obsolete)
zalan
Comment 11 2022-06-21 16:57:39 PDT
Created attachment 460392 [details] Test reduction
zalan
Comment 12 2022-06-22 11:56:02 PDT
zalan
Comment 13 2022-06-22 13:24:22 PDT
EWS
Comment 14 2022-06-22 19:54:56 PDT
Committed r295765 (251770@main): <https://commits.webkit.org/251770@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 460426 [details].
Note You need to log in before you can comment on or make changes to this bug.