RESOLVED FIXED224224
WebKit is inconsistent about which side to place scrollbar on (with writing-mode & direction CSS properties)
https://bugs.webkit.org/show_bug.cgi?id=224224
Summary WebKit is inconsistent about which side to place scrollbar on (with writing-m...
Daniel Holbert
Reported 2021-04-05 23:08:10 PDT
STR: (1) View https://bugzilla.mozilla.org/attachment.cgi?id=9213617 (2) Look at the scrollbars inside the two black boxes. (you may have to manually scroll them to make the scrollbars show up, if you've got overlay scrollbars.) EXPECTED RESULTS: The scrollbar should be on the same side of the two black boxes. (Both of these boxes have "right-to-left" content flows, via `direction:rtl` for the first one and via `vertical-rl` for the second one.) In particular: I think the scrollbar should be on the **left side** for both boxes. (In both cases, the left side is the logical "end" side -- it's the inline-end edge of the the first box, and it's the block-end side for the second box.). ACTUAL RESULTS: Safari/WebKit places the scrollbar on the **right side** of the second box (the `vertical-rl` one). This is the logical "start" side (specifically "block-start"), which is an odd place for a scrollbar. I think this is the only case where Safari does this (where they place the scrollbar on a "start" side of a box). Firefox gives EXPECTED RESULTS here. Chrome matches Safari and gives ACTUAL RESULTS, but that's a Chrome bug, and it sounds like they're likely changing to match Firefox on this, per https://bugs.chromium.org/p/chromium/issues/detail?id=1195933#c6 . (That's the Chrome version of this issue.) I tested this in Safari 14 on macOS Big Sur.
Attachments
Patch (49.14 KB, patch)
2021-04-08 01:03 PDT, Cameron McCormack (:heycam)
no flags
Patch (49.04 KB, patch)
2021-04-08 18:45 PDT, Cameron McCormack (:heycam)
no flags
Patch (53.97 KB, patch)
2021-04-08 21:35 PDT, Cameron McCormack (:heycam)
no flags
Squashed patch with dependencies for EWS (62.79 KB, patch)
2021-04-10 19:02 PDT, Cameron McCormack (:heycam)
no flags
Squashed patch with dependencies for EWS (58.12 KB, patch)
2021-04-12 21:41 PDT, Cameron McCormack (:heycam)
no flags
Squashed patch with dependencies for EWS (59.44 KB, patch)
2021-04-12 22:33 PDT, Cameron McCormack (:heycam)
no flags
Squashed patch with dependencies for EWS (59.44 KB, patch)
2021-04-12 23:21 PDT, Cameron McCormack (:heycam)
no flags
Patch (59.07 KB, patch)
2021-04-13 16:47 PDT, Cameron McCormack (:heycam)
ews-feeder: commit-queue-
Patch (59.08 KB, patch)
2021-04-13 17:25 PDT, Cameron McCormack (:heycam)
no flags
Patch (60.39 KB, patch)
2021-04-13 22:42 PDT, Cameron McCormack (:heycam)
no flags
Patch (62.13 KB, patch)
2021-04-15 02:01 PDT, Cameron McCormack (:heycam)
no flags
Patch (62.28 KB, patch)
2021-04-15 14:11 PDT, Cameron McCormack (:heycam)
no flags
Patch (63.60 KB, patch)
2021-04-15 18:08 PDT, Cameron McCormack (:heycam)
no flags
Patch (10.06 KB, patch)
2021-04-16 17:26 PDT, Tyler Wilcock
no flags
Daniel Holbert
Comment 1 2021-04-05 23:12:30 PDT
Note that there's a WPT test that inadvertently depends on this behavior (and fails in Firefox as a result), which is how I ran across cross-browser discrepancy: https://wpt.fyi/results/css/css-flexbox/overflow-auto-005.html I may end up fixing that WPT test over in https://bugzilla.mozilla.org/show_bug.cgi?id=1703074 , and/or it might get fixed as part of the bug report. Either way, it'll likely end up flipping its implicit expectation about scrollbar placement (which isn't really what it's intending to test anyway). (unless there's a case to be made that both behaviors are sensible, and if the text can be relaxed such that it allows both somehow)
Daniel Holbert
Comment 2 2021-04-05 23:12:54 PDT
(In reply to Daniel Holbert from comment #1) > unless there's a case to be made that both > behaviors are sensible, and if the text can be relaxed such that it allows > both somehow) Sorry, s/text/test/
Simon Fraser (smfr)
Comment 3 2021-04-06 09:43:48 PDT
Seems like a bug, yeah.
Smoley
Comment 4 2021-04-07 14:41:40 PDT
I can reproduce this on Safari 13.1.2 as well as TOT 14.2.
Radar WebKit Bug Importer
Comment 5 2021-04-07 14:41:49 PDT
Cameron McCormack (:heycam)
Comment 6 2021-04-08 01:03:27 PDT
Cameron McCormack (:heycam)
Comment 7 2021-04-08 18:45:47 PDT
Cameron McCormack (:heycam)
Comment 8 2021-04-08 20:59:23 PDT
(In reply to Daniel Holbert from comment #1) > Note that there's a WPT test that inadvertently depends on this behavior > (and fails in Firefox as a result), which is how I ran across cross-browser > discrepancy: > https://wpt.fyi/results/css/css-flexbox/overflow-auto-005.html > > I may end up fixing that WPT test over in > https://bugzilla.mozilla.org/show_bug.cgi?id=1703074 , and/or it might get > fixed as part of the bug report. Either way, it'll likely end up flipping > its implicit expectation about scrollbar placement (which isn't really what > it's intending to test anyway). (unless there's a case to be made that both > behaviors are sensible, and if the text can be relaxed such that it allows > both somehow) Hey Daniel, do you think css/css-writing-modes/sizing-orthog-vrl-in-htb-012.xht also needs fixing? That's a case where the reference is using `writing-mode: vertical-rl` on the root, while the test itself has the default horizontal-tb. But scrollbar position is not what's being tested.
Cameron McCormack (:heycam)
Comment 9 2021-04-08 21:01:10 PDT
css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html too.
Cameron McCormack (:heycam)
Comment 10 2021-04-08 21:35:23 PDT
Cameron McCormack (:heycam)
Comment 11 2021-04-08 21:57:56 PDT
Daniel Holbert
Comment 12 2021-04-09 08:32:34 PDT
Yeah, that seems fine (marked r+ in WPT repo). It surprises me that Firefox places the scrollbars on the right side in those tests (I checked, and we do). It seems the root scrollport is special for some reason; I'm not sure if that's intentional or not. But yeah, in any case, scrollbar-side-placement isn't what those testcases are trying to test.
Daniel Holbert
Comment 13 2021-04-09 08:54:14 PDT
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1704122 on the fact that Firefox seems to have special right-side-scrollbars-only behavior on the root element.
Cameron McCormack (:heycam)
Comment 14 2021-04-10 19:02:07 PDT
Created attachment 425694 [details] Squashed patch with dependencies for EWS
Cameron McCormack (:heycam)
Comment 15 2021-04-12 21:41:26 PDT
Created attachment 425831 [details] Squashed patch with dependencies for EWS
Cameron McCormack (:heycam)
Comment 16 2021-04-12 22:33:35 PDT
Created attachment 425835 [details] Squashed patch with dependencies for EWS
Cameron McCormack (:heycam)
Comment 17 2021-04-12 23:21:34 PDT
Created attachment 425839 [details] Squashed patch with dependencies for EWS
Cameron McCormack (:heycam)
Comment 18 2021-04-13 16:47:32 PDT
Cameron McCormack (:heycam)
Comment 19 2021-04-13 17:25:33 PDT
Cameron McCormack (:heycam)
Comment 20 2021-04-13 22:42:54 PDT
Cameron McCormack (:heycam)
Comment 21 2021-04-15 02:01:19 PDT
Cameron McCormack (:heycam)
Comment 22 2021-04-15 14:11:24 PDT
Cameron McCormack (:heycam)
Comment 23 2021-04-15 18:08:12 PDT
EWS
Comment 24 2021-04-16 16:55:24 PDT
Committed r276182 (236665@main): <https://commits.webkit.org/236665@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426168 [details].
Tyler Wilcock
Comment 25 2021-04-16 17:26:55 PDT
Reopening to attach new patch.
Tyler Wilcock
Comment 26 2021-04-16 17:26:58 PDT
EWS Watchlist
Comment 27 2021-04-16 17:27:46 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Tyler Wilcock
Comment 28 2021-04-16 17:34:48 PDT
Sorry, not sure why `webkit-patch` uploaded to this bug. Closing again.
Note You need to log in before you can comment on or make changes to this bug.