Title: [276182] trunk
Revision
276182
Author
[email protected]
Date
2021-04-16 16:55:14 -0700 (Fri, 16 Apr 2021)

Log Message

Place vertical scrollbars at (inline/block)-end edge in all writing modes.
https://bugs.webkit.org/show_bug.cgi?id=224224

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt:
* web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt:

Source/WebCore:

Tests: fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html
       fast/scrolling/v-rl-scrollbars-initial-position.html
       fast/scrolling/vertical-scrollbar-position.html

We currently only consider moving a vertical scrollbar to the left for
`writing-mode: horizontal-{tb,bt}; direction: rtl` containers. But
ideally we should always place the vertical scrollbar at the end edge
of the container (whether that's the inline-end edge, when using a
horizontal writing mode, or the block-end edge, when using a vertical
writing mode).

Some functions calling the existing shouldPlaceBlockDirectionScrollbarOnLeft
instead really care about whether the vertical scrollbar is on the
left, not whether the block direction scrollbar is on the left (since
for vertical writing modes, the block direction scrollbar is the
horizontal one on the bottom). So we rename this to
shouldPlaceVerticalScrollbarOnLeft, make it return true for
`writing-mode: vertical-rl`, and adjust callers that really do care
only about block direction scrollbars to additionally check their
writing mode.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* page/FrameView.cpp:
(WebCore::FrameView::shouldPlaceVerticalScrollbarOnLeft const):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin const):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::scrollCornerRect const):
(WebCore::ScrollView::locationOfContents const):
* platform/ScrollableArea.h:
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
(WebCore::ScrollbarThemeAdwaita::paint):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::widgetTypeForScrollbar):
(WebCore::ScrollbarThemeGtk::paint):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp):
* platform/win/PopupMenuWin.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalLeftOffsetForContent const):
(WebCore::RenderBlock::logicalRightOffsetForContent const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paddingBoxRect const):
(WebCore::RenderBox::contentBoxLocation const):
(WebCore::RenderBox::overflowClipRect const):
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::flippedClientBoxRect const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::overflowControlsRects const):
(WebCore::RenderLayer::offsetFromResizeCorner const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::positionForClipLayer const):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceVerticalScrollbarOnLeft const):
* rendering/RenderLayerModelObject.h:
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft const):
(WebCore::RenderLayerScrollableArea::overflowControlsRects const):
(WebCore::RenderLayerScrollableArea::computeScrollOrigin):
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
(WebCore::RenderLayerScrollableArea::drawPlatformResizerImage):
(WebCore::RenderLayerScrollableArea::hitTestResizerInFragments const):
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange):
* rendering/RenderLayerScrollableArea.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::itemBoundingBoxRect):
(WebCore::RenderListBox::paintScrollbar):
(WebCore::RenderListBox::isPointInOverflowControl):
(WebCore::RenderListBox::listIndexAtOffset):
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView const):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar const):
* rendering/RenderListBox.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewRectangle const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::shouldPlaceVerticalScrollbarOnLeft const):
* rendering/style/RenderStyle.h:

Source/WebKit:

* UIProcess/win/WebPopupMenuProxyWin.h:
* WebProcess/Plugins/PDF/PDFPlugin.h:

LayoutTests:

iOS test failure expectations and skips are because we don't support
non-overlay scrollbars on the left on that platform.

* TestExpectations:
* css3/flexbox/child-overflow-expected.html:
* fast/repaint/vertical-overflow-parent-expected.txt:
* fast/repaint/vertical-overflow-same-expected.txt:
* fast/scrolling/v-rl-scrollbars-initial-position-dynamic-expected.html: Added.
* fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html: Added.
* fast/scrolling/v-rl-scrollbars-initial-position-expected.html: Added.
* fast/scrolling/v-rl-scrollbars-initial-position.html: Added.
* fast/scrolling/vertical-scrollbar-position-expected.txt: Added.
* fast/scrolling/vertical-scrollbar-position.html: Added.
* platform/ios/TestExpectations:
* platform/ios/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (276181 => 276182)


--- trunk/LayoutTests/ChangeLog	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/ChangeLog	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,3 +1,27 @@
+2021-04-16  Cameron McCormack  <[email protected]>
+
+        Place vertical scrollbars at (inline/block)-end edge in all writing modes.
+        https://bugs.webkit.org/show_bug.cgi?id=224224
+
+        Reviewed by Simon Fraser.
+
+        iOS test failure expectations and skips are because we don't support
+        non-overlay scrollbars on the left on that platform.
+
+        * TestExpectations:
+        * css3/flexbox/child-overflow-expected.html:
+        * fast/repaint/vertical-overflow-parent-expected.txt:
+        * fast/repaint/vertical-overflow-same-expected.txt:
+        * fast/scrolling/v-rl-scrollbars-initial-position-dynamic-expected.html: Added.
+        * fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html: Added.
+        * fast/scrolling/v-rl-scrollbars-initial-position-expected.html: Added.
+        * fast/scrolling/v-rl-scrollbars-initial-position.html: Added.
+        * fast/scrolling/vertical-scrollbar-position-expected.txt: Added.
+        * fast/scrolling/vertical-scrollbar-position.html: Added.
+        * platform/ios/TestExpectations:
+        * platform/ios/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt: Added.
+        * platform/ios/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt.
+
 2021-04-16  Jiewen Tan  <[email protected]>
 
         Allow using the platform authenticator on non-Touch ID Macs according to Internal requirements

Modified: trunk/LayoutTests/TestExpectations (276181 => 276182)


--- trunk/LayoutTests/TestExpectations	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/TestExpectations	2021-04-16 23:55:14 UTC (rev 276182)
@@ -4866,6 +4866,10 @@
 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOnlyFailure ]
 
+# Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side
+webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ]
+webkit.org/b/224357 imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [ ImageOnlyFailure ]
+
 # @counter-style ref tests that currently fail
 imported/w3c/web-platform-tests/css/css-counter-styles/armenian/css3-counter-styles-006.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-counter-styles/armenian/css3-counter-styles-007.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/css3/flexbox/child-overflow-expected.html (276181 => 276182)


--- trunk/LayoutTests/css3/flexbox/child-overflow-expected.html	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/css3/flexbox/child-overflow-expected.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -28,6 +28,10 @@
 p {
     margin-bottom: 30px;
 }
+
+.topRight {
+    direction: rtl;  /* place scrollbars on the LHS */
+}
 </style>
 </head>
 <body>

Modified: trunk/LayoutTests/fast/repaint/vertical-overflow-parent-expected.txt (276181 => 276182)


--- trunk/LayoutTests/fast/repaint/vertical-overflow-parent-expected.txt	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/fast/repaint/vertical-overflow-parent-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,4 +1,4 @@
 (repaint rects
-  (rect 29 29 100 100)
+  (rect 44 29 100 100)
 )
 

Modified: trunk/LayoutTests/fast/repaint/vertical-overflow-same-expected.txt (276181 => 276182)


--- trunk/LayoutTests/fast/repaint/vertical-overflow-same-expected.txt	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/fast/repaint/vertical-overflow-same-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,4 +1,4 @@
 (repaint rects
-  (rect 29 21 100 100)
+  (rect 44 21 100 100)
 )
 

Added: trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic-expected.html (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic-expected.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; direction: rtl; overflow: scroll;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>
+<div style="width: 100px; height: 100px; direction: ltr; overflow: scroll; margin-top: 1em;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>

Added: trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<div id=one style="width: 100px; height: 100px; writing-mode: horizontal-tb; overflow: scroll;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>
+<div id=two style="width: 100px; height: 100px; writing-mode: vertical-rl; overflow: scroll; margin-top: 1em;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>
+<script>
+document.body.offsetTop;
+one.style.writingMode = "vertical-rl";
+two.style.writingMode = "horizontal-tb";
+</script>

Added: trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-expected.html (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position-expected.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; direction: rtl; overflow: scroll;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>

Added: trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position.html (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/v-rl-scrollbars-initial-position.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; writing-mode: vertical-rl; overflow: scroll;">
+  <div style="width: 192px; height: 192px; border: 4px solid black;"></div>
+</div>

Added: trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position-expected.txt (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,11 @@
+These four containers should have a vertical scrollbar on the right.
+
+
+
+
+These four containers should have a vertical scrollbar on the left.
+
+
+
+
+ PASS

Added: trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position.html (0 => 276182)


--- trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/vertical-scrollbar-position.html	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<style>
+section > div, section > div {
+  display: inline-block;
+  height: 100px;
+  width: 100px;
+  outline: 1px solid black;
+  overflow-x: hidden;
+  overflow-y: scroll;
+  margin: 10px 10px 0 0;
+}
+
+.square {
+  width: 20px;
+  height: 20px;
+  background-color: orange;
+}
+
+.ltr { direction: ltr; }
+.rtl { direction: rtl; }
+.h-tb { writing-mode: horizontal-tb; }
+.h-bt { -webkit-writing-mode: horizontal-bt; }
+.v-rl { writing-mode: vertical-rl; }
+.v-lr { writing-mode: vertical-lr; }
+</style>
+<section class="right">
+  <p>These four containers should have a vertical scrollbar on the right.</p>
+  <div class="h-tb ltr"><div class="square" data-expected="0"></div></div>
+  <div class="h-bt ltr"><div class="square" data-expected="0"></div></div>
+  <div class="v-lr ltr"><div class="square" data-expected="0"></div></div>
+  <div class="v-lr rtl"><div class="square" data-expected="0"></div></div>
+</section>
+
+<section class="left">
+  <p>These four containers should have a vertical scrollbar on the left.</p>
+  <div class="h-tb rtl"><div class="square" data-expected="80"></div></div>
+  <div class="h-bt rtl"><div class="square" data-expected="80"></div></div>
+  <div class="v-rl ltr"><div class="square" data-expected="80"></div></div>
+  <div class="v-rl rtl"><div class="square" data-expected="80"></div></div>
+</section>
+
+<pre id="results">FAIL</pre>
+<script>
+if (window.testRunner) {
+    window.testRunner.dumpAsText(true);
+}
+
+let text = "";
+for (let square of document.querySelectorAll(".square")) {
+    let actual = square.getBoundingClientRect().x - square.parentNode.offsetLeft;
+    let expected = square.getAttribute("data-expected");
+    if (actual != expected) {
+        text += `Position of square in '${square.parentNode.className}' - expected ${expected}, got ${actual}\n`;
+    }
+}
+results.textContent = text || "PASS";
+</script>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (276181 => 276182)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,3 +1,13 @@
+2021-04-16  Cameron McCormack  <[email protected]>
+
+        Place vertical scrollbars at (inline/block)-end edge in all writing modes.
+        https://bugs.webkit.org/show_bug.cgi?id=224224
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt:
+        * web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt:
+
 2021-04-16  Tyler Wilcock  <[email protected]>
 
         [css-counter-styles] Parse and add feature flag for @counter-style

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt (276181 => 276182)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,10 +1,10 @@
 
 PASS Snaps correctly for horizontal-tb writing mode with 'scroll-snap-align: end start' alignment
 FAIL Snaps correctly for vertical-lr writing mode with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected 115 but got 300
-FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected -315 but got -300
+FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on y expected 300 but got 165
 FAIL Snaps correctly for horizontal-tb writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected 115 but got 0
 FAIL Snaps correctly for vertical-lr writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected 300 but got 0
-FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected -500 but got -485
-FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected -500 but got -485
-FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected -315 but got -300
+FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on y expected 165 but got 300
+FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on y expected 165 but got 0
+FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on y expected 300 but got 0
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt (276181 => 276182)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -11,6 +11,6 @@
 PASS writing-mode:horizontal-tb; direction:rtl
 PASS writing-mode:vertical-lr; direction:ltr
 PASS writing-mode:vertical-lr; direction:rtl
-FAIL writing-mode:vertical-rl; direction:ltr assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
-FAIL writing-mode:vertical-rl; direction:rtl assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
+PASS writing-mode:vertical-rl; direction:ltr
+PASS writing-mode:vertical-rl; direction:rtl
 

Modified: trunk/LayoutTests/platform/ios/TestExpectations (276181 => 276182)


--- trunk/LayoutTests/platform/ios/TestExpectations	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1061,6 +1061,7 @@
 fast/attachment/attachment-type-attribute.html [ Skip ]
 
 # RTL Scrollbars are only implemented on certain versions of OS X
+css3/flexbox/child-overflow.html [ Skip ]
 fast/scrolling/rtl-scrollbars-iframe-scrolled.html [ Skip ]
 fast/scrolling/rtl-scrollbars-listbox-scroll.html [ Skip ]
 fast/scrolling/rtl-scrollbars-listbox-select-left.html [ Skip ]
@@ -1068,6 +1069,9 @@
 fast/scrolling/rtl-scrollbars-position-fixed.html [ Skip ]
 fast/scrolling/rtl-scrollbars-text-selection-scrolled.html [ Skip ]
 fast/scrolling/rtl-scrollbars-text-selection.html [ Skip ]
+fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html [ Skip ]
+fast/scrolling/v-rl-scrollbars-initial-position.html [ Skip ]
+fast/scrolling/vertical-scrollbar-position.html [ Skip ]
 
 # This is specific to extensions on macOS
 webkit.org/b/167795 http/tests/security/bypassing-cors-checks-for-extension-urls.html [ Skip ]

Copied: trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt (from rev 276181, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt) (0 => 276182)


--- trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-scroll-snap/snap-inline-block-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,10 @@
+
+PASS Snaps correctly for horizontal-tb writing mode with 'scroll-snap-align: end start' alignment
+FAIL Snaps correctly for vertical-lr writing mode with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected 115 but got 300
+FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected -315 but got -300
+FAIL Snaps correctly for horizontal-tb writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected 115 but got 0
+FAIL Snaps correctly for vertical-lr writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected 300 but got 0
+FAIL Snaps correctly for vertical-rl writing mode with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected -500 but got -485
+FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: end start' alignment assert_equals: aligns correctly on x expected -500 but got -485
+FAIL Snaps correctly for 'direction: rtl' with 'scroll-snap-align: start end' alignment assert_equals: aligns correctly on x expected -315 but got -300
+

Copied: trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt (from rev 276181, trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt) (0 => 276182)


--- trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/cssom-view/scrollLeftTop-expected.txt	2021-04-16 23:55:14 UTC (rev 276182)
@@ -0,0 +1,16 @@
+scrollLeft/scrollTop
+
+writing-mode: horizontal-tb;
+
+writing-mode: vertical-lr;
+
+writing-mode: vertical-rl;
+
+
+PASS writing-mode:horizontal-tb; direction:ltr
+PASS writing-mode:horizontal-tb; direction:rtl
+PASS writing-mode:vertical-lr; direction:ltr
+PASS writing-mode:vertical-lr; direction:rtl
+FAIL writing-mode:vertical-rl; direction:ltr assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
+FAIL writing-mode:vertical-rl; direction:rtl assert_approx_equals: ending scrollLeft expected -165 +/- 0.5 but got -150
+

Modified: trunk/Source/WebCore/ChangeLog (276181 => 276182)


--- trunk/Source/WebCore/ChangeLog	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/ChangeLog	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,3 +1,97 @@
+2021-04-16  Cameron McCormack  <[email protected]>
+
+        Place vertical scrollbars at (inline/block)-end edge in all writing modes.
+        https://bugs.webkit.org/show_bug.cgi?id=224224
+
+        Reviewed by Simon Fraser.
+
+        Tests: fast/scrolling/v-rl-scrollbars-initial-position-dynamic.html
+               fast/scrolling/v-rl-scrollbars-initial-position.html
+               fast/scrolling/vertical-scrollbar-position.html
+
+        We currently only consider moving a vertical scrollbar to the left for
+        `writing-mode: horizontal-{tb,bt}; direction: rtl` containers. But
+        ideally we should always place the vertical scrollbar at the end edge
+        of the container (whether that's the inline-end edge, when using a
+        horizontal writing mode, or the block-end edge, when using a vertical
+        writing mode).
+
+        Some functions calling the existing shouldPlaceBlockDirectionScrollbarOnLeft
+        instead really care about whether the vertical scrollbar is on the
+        left, not whether the block direction scrollbar is on the left (since
+        for vertical writing modes, the block direction scrollbar is the
+        horizontal one on the bottom). So we rename this to
+        shouldPlaceVerticalScrollbarOnLeft, make it return true for
+        `writing-mode: vertical-rl`, and adjust callers that really do care
+        only about block direction scrollbars to additionally check their
+        writing mode.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::selectCursor):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::shouldPlaceVerticalScrollbarOnLeft const):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin const):
+        (WebCore::ScrollView::updateScrollbars):
+        (WebCore::ScrollView::scrollCornerRect const):
+        (WebCore::ScrollView::locationOfContents const):
+        * platform/ScrollableArea.h:
+        * platform/adwaita/ScrollbarThemeAdwaita.cpp:
+        (WebCore::ScrollbarThemeAdwaita::paint):
+        * platform/gtk/ScrollbarThemeGtk.cpp:
+        (WebCore::widgetTypeForScrollbar):
+        (WebCore::ScrollbarThemeGtk::paint):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::didCreateScrollerImp):
+        * platform/win/PopupMenuWin.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::logicalLeftOffsetForContent const):
+        (WebCore::RenderBlock::logicalRightOffsetForContent const):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paddingBoxRect const):
+        (WebCore::RenderBox::contentBoxLocation const):
+        (WebCore::RenderBox::overflowClipRect const):
+        (WebCore::RenderBox::computePositionedLogicalWidth const):
+        (WebCore::RenderBox::flippedClientBoxRect const):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollRectToVisible):
+        (WebCore::RenderLayer::resize):
+        (WebCore::RenderLayer::overflowControlsRects const):
+        (WebCore::RenderLayer::offsetFromResizeCorner const):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::positionForClipLayer const):
+        * rendering/RenderLayerModelObject.cpp:
+        (WebCore::RenderLayerModelObject::shouldPlaceVerticalScrollbarOnLeft const):
+        * rendering/RenderLayerModelObject.h:
+        * rendering/RenderLayerScrollableArea.cpp:
+        (WebCore::RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft const):
+        (WebCore::RenderLayerScrollableArea::overflowControlsRects const):
+        (WebCore::RenderLayerScrollableArea::computeScrollOrigin):
+        (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
+        (WebCore::RenderLayerScrollableArea::drawPlatformResizerImage):
+        (WebCore::RenderLayerScrollableArea::hitTestResizerInFragments const):
+        (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange):
+        * rendering/RenderLayerScrollableArea.h:
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::itemBoundingBoxRect):
+        (WebCore::RenderListBox::paintScrollbar):
+        (WebCore::RenderListBox::isPointInOverflowControl):
+        (WebCore::RenderListBox::listIndexAtOffset):
+        (WebCore::RenderListBox::invalidateScrollbarRect):
+        (WebCore::RenderListBox::convertFromScrollbarToContainingView const):
+        (WebCore::RenderListBox::convertFromContainingViewToScrollbar const):
+        * rendering/RenderListBox.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::repaintViewRectangle const):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::shouldPlaceVerticalScrollbarOnLeft const):
+        * rendering/style/RenderStyle.h:
+
 2021-04-16  Wenson Hsieh  <[email protected]>
 
         [macOS] Refactor some webpage translation code

Modified: trunk/Source/WebCore/page/EventHandler.cpp (276181 => 276182)


--- trunk/Source/WebCore/page/EventHandler.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1518,7 +1518,7 @@
             auto& layerRenderer = downcast<RenderLayerModelObject>(*renderer);
             inResizer = layerRenderer.layer()->isPointInResizeControl(roundedIntPoint(result.localPoint()));
             if (inResizer)
-                return layerRenderer.shouldPlaceBlockDirectionScrollbarOnLeft() ? southWestResizeCursor() : southEastResizeCursor();
+                return layerRenderer.shouldPlaceVerticalScrollbarOnLeft() ? southWestResizeCursor() : southEastResizeCursor();
         }
 
         if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !result.scrollbar())

Modified: trunk/Source/WebCore/page/FrameView.cpp (276181 => 276182)


--- trunk/Source/WebCore/page/FrameView.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/page/FrameView.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -5553,9 +5553,9 @@
     return { *viewportSize.width, *viewportSize.height };
 }
 
-bool FrameView::shouldPlaceBlockDirectionScrollbarOnLeft() const
+bool FrameView::shouldPlaceVerticalScrollbarOnLeft() const
 {
-    return renderView() && renderView()->shouldPlaceBlockDirectionScrollbarOnLeft();
+    return renderView() && renderView()->shouldPlaceVerticalScrollbarOnLeft();
 }
 
 TextStream& operator<<(TextStream& ts, const FrameView& view)

Modified: trunk/Source/WebCore/page/FrameView.h (276181 => 276182)


--- trunk/Source/WebCore/page/FrameView.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/page/FrameView.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -655,7 +655,7 @@
     void show() final;
     void hide() final;
 
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const final;
+    bool shouldPlaceVerticalScrollbarOnLeft() const final;
 
     void didRestoreFromBackForwardCache();
 

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (276181 => 276182)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -422,7 +422,7 @@
 ScrollPosition ScrollView::documentScrollPositionRelativeToViewOrigin() const
 {
     return scrollPosition() - IntSize(
-        shouldPlaceBlockDirectionScrollbarOnLeft() && m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0,
+        shouldPlaceVerticalScrollbarOnLeft() && m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0,
         headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
 }
 
@@ -732,7 +732,7 @@
     if (m_horizontalScrollbar) {
         int clientWidth = visibleWidth();
         IntRect oldRect(m_horizontalScrollbar->frameRect());
-        IntRect hBarRect(shouldPlaceBlockDirectionScrollbarOnLeft() && m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0,
+        IntRect hBarRect(shouldPlaceVerticalScrollbarOnLeft() && m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0,
             height() - m_horizontalScrollbar->height(),
             width() - (m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0),
             m_horizontalScrollbar->height());
@@ -751,7 +751,7 @@
     if (m_verticalScrollbar) {
         int clientHeight = visibleHeight();
         IntRect oldRect(m_verticalScrollbar->frameRect());
-        IntRect vBarRect(shouldPlaceBlockDirectionScrollbarOnLeft() ? 0 : width() - m_verticalScrollbar->width(),
+        IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : width() - m_verticalScrollbar->width(),
             topContentInset(),
             m_verticalScrollbar->width(),
             height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar->occupiedHeight() : 0));
@@ -1179,7 +1179,7 @@
     int heightTrackedByScrollbar = height() - topContentInset();
 
     if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) {
-        cornerRect.unite(IntRect(shouldPlaceBlockDirectionScrollbarOnLeft() ? 0 : m_horizontalScrollbar->width(),
+        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : m_horizontalScrollbar->width(),
             height() - m_horizontalScrollbar->height(),
             width() - m_horizontalScrollbar->width(),
             m_horizontalScrollbar->height()));
@@ -1186,7 +1186,7 @@
     }
 
     if (m_verticalScrollbar && heightTrackedByScrollbar - m_verticalScrollbar->height() > 0) {
-        cornerRect.unite(IntRect(shouldPlaceBlockDirectionScrollbarOnLeft() ? 0 : width() - m_verticalScrollbar->width(),
+        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : width() - m_verticalScrollbar->width(),
             m_verticalScrollbar->height() + topContentInset(),
             m_verticalScrollbar->width(),
             heightTrackedByScrollbar - m_verticalScrollbar->height()));
@@ -1538,7 +1538,7 @@
 IntPoint ScrollView::locationOfContents() const
 {
     IntPoint result = location();
-    if (shouldPlaceBlockDirectionScrollbarOnLeft() && m_verticalScrollbar)
+    if (shouldPlaceVerticalScrollbarOnLeft() && m_verticalScrollbar)
         result.move(m_verticalScrollbar->occupiedWidth(), 0);
     return result;
 }

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (276181 => 276182)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -342,7 +342,7 @@
     virtual bool usesMockScrollAnimator() const { return false; }
     virtual void logMockScrollAnimatorMessage(const String&) const { };
 
-    virtual bool shouldPlaceBlockDirectionScrollbarOnLeft() const = 0;
+    virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0;
     
     virtual String debugDescription() const = 0;
 

Modified: trunk/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp (276181 => 276182)


--- trunk/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -127,7 +127,7 @@
 
         IntRect frame = rect;
         if (scrollbar.orientation() == VerticalScrollbar) {
-            if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft())
+            if (scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft())
                 frame.move(frame.width() - hoveredScrollbarBorderSize, 0);
             frame.setWidth(hoveredScrollbarBorderSize);
         } else
@@ -140,7 +140,7 @@
     IntRect thumb = rect;
     if (scrollbar.hoveredPart() == NoPart && usesOverlayScrollbars()) {
         if (scrollbar.orientation() == VerticalScrollbar) {
-            if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft())
+            if (scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft())
                 thumb.move(hoveredScrollbarBorderSize, thumbPos + thumbBorderSize);
             else
                 thumb.move(scrollbarSize - (overlayThumbSize + thumbBorderSize) + hoveredScrollbarBorderSize, thumbPos + thumbBorderSize);
@@ -153,7 +153,7 @@
         }
     } else {
         if (scrollbar.orientation() == VerticalScrollbar) {
-            if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft())
+            if (scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft())
                 thumb.move(scrollbarSize - (scrollbarSize / 2 + thumbSize / 2) - hoveredScrollbarBorderSize, thumbPos + thumbBorderSize);
             else
                 thumb.move(scrollbarSize - (scrollbarSize / 2 + thumbSize / 2), thumbPos + thumbBorderSize);

Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp (276181 => 276182)


--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -142,7 +142,7 @@
 static RenderThemeScrollbar::Type widgetTypeForScrollbar(Scrollbar& scrollbar, GtkStateFlags scrollbarState)
 {
     if (scrollbar.orientation() == VerticalScrollbar) {
-        if (scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft())
+        if (scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft())
             return scrollbarState & GTK_STATE_FLAG_PRELIGHT ? RenderThemeScrollbar::Type::VerticalScrollbarLeft : RenderThemeScrollbar::Type::VerticalScrollIndicatorLeft;
         return scrollbarState & GTK_STATE_FLAG_PRELIGHT ? RenderThemeScrollbar::Type::VerticalScrollbarRight : RenderThemeScrollbar::Type::VerticalScrollIndicatorRight;
     }
@@ -380,7 +380,7 @@
     // drawing the indicator we need to adjust the rectangle to its actual size in indicator mode.
     if (scrollbar.orientation() == VerticalScrollbar) {
         if (rect.width() != preferredSize.width()) {
-            if (!scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft())
+            if (!scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft())
                 contentsRect.move(std::abs(rect.width() - preferredSize.width()), 0);
             contentsRect.setWidth(preferredSize.width());
         }

Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (276181 => 276182)


--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2021-04-16 23:55:14 UTC (rev 276182)
@@ -159,7 +159,7 @@
 #if PLATFORM(MAC)
     NSScrollerImp *scrollerImp = painterForScrollbar(scrollbar);
     ASSERT(scrollerImp);
-    scrollerImp.userInterfaceLayoutDirection = scrollbar.scrollableArea().shouldPlaceBlockDirectionScrollbarOnLeft() ? NSUserInterfaceLayoutDirectionRightToLeft : NSUserInterfaceLayoutDirectionLeftToRight;
+    scrollerImp.userInterfaceLayoutDirection = scrollbar.scrollableArea().shouldPlaceVerticalScrollbarOnLeft() ? NSUserInterfaceLayoutDirectionRightToLeft : NSUserInterfaceLayoutDirectionLeftToRight;
 #else
     UNUSED_PARAM(scrollbar);
 #endif

Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.h (276181 => 276182)


--- trunk/Source/WebCore/platform/win/PopupMenuWin.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -104,7 +104,7 @@
     IntSize contentsSize() const override;
     IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
     bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override { return false; }
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const final { return false; }
+    bool shouldPlaceVerticalScrollbarOnLeft() const final { return false; }
 
     // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     void scrollTo(int offset);

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1923,7 +1923,7 @@
 LayoutUnit RenderBlock::logicalLeftOffsetForContent(RenderFragmentContainer* fragment) const
 {
     LayoutUnit logicalLeftOffset = style().isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
-    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+    if (shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
         logicalLeftOffset += verticalScrollbarWidth();
     if (!fragment)
         return logicalLeftOffset;
@@ -1934,7 +1934,7 @@
 LayoutUnit RenderBlock::logicalRightOffsetForContent(RenderFragmentContainer* fragment) const
 {
     LayoutUnit logicalRightOffset = style().isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
-    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+    if (shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
         logicalRightOffset += verticalScrollbarWidth();
     logicalRightOffset += availableLogicalWidth();
     if (!fragment)

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -883,7 +883,7 @@
 void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox& child, ApplyLayoutDeltaMode applyDelta)
 {
     LayoutUnit startPosition = borderStart() + paddingStart();
-    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+    if (shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
         startPosition += (style().isLeftToRightDirection() ? 1 : -1) * verticalScrollbarWidth();
     LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth();
 

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -722,7 +722,7 @@
 LayoutRect RenderBox::paddingBoxRect() const
 {
     auto verticalScrollbarWidth = this->verticalScrollbarWidth();
-    LayoutUnit offsetForScrollbar = shouldPlaceBlockDirectionScrollbarOnLeft() ? verticalScrollbarWidth : 0;
+    LayoutUnit offsetForScrollbar = shouldPlaceVerticalScrollbarOnLeft() ? verticalScrollbarWidth : 0;
 
     return LayoutRect(borderLeft() + offsetForScrollbar, borderTop(),
         width() - borderLeft() - borderRight() - verticalScrollbarWidth,
@@ -736,7 +736,7 @@
 
 LayoutPoint RenderBox::contentBoxLocation() const
 {
-    LayoutUnit scrollbarSpace = shouldPlaceBlockDirectionScrollbarOnLeft() ? verticalScrollbarWidth() : 0;
+    LayoutUnit scrollbarSpace = shouldPlaceVerticalScrollbarOnLeft() ? verticalScrollbarWidth() : 0;
     return { borderLeft() + paddingLeft() + scrollbarSpace, borderTop() + paddingTop() };
 }
 
@@ -1964,7 +1964,7 @@
 
     // Subtract out scrollbars if we have them.
     if (auto* scrollableArea = layer() ? layer()->scrollableArea() : nullptr) {
-        if (shouldPlaceBlockDirectionScrollbarOnLeft())
+        if (shouldPlaceVerticalScrollbarOnLeft())
             clipRect.move(scrollableArea->verticalScrollbarWidth(relevancy), 0);
         clipRect.contract(scrollableArea->verticalScrollbarWidth(relevancy), scrollableArea->horizontalScrollbarHeight(relevancy));
     }
@@ -3759,7 +3759,7 @@
     computedValues.m_extent += bordersPlusPadding;
     if (is<RenderBox>(containerBlock)) {
         auto& containingBox = downcast<RenderBox>(containerBlock);
-        if (containingBox.shouldPlaceBlockDirectionScrollbarOnLeft())
+        if (containingBox.shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
             computedValues.m_position += containingBox.verticalScrollbarWidth();
     }
     
@@ -4980,7 +4980,7 @@
     flipForWritingMode(rect);
     // Subtract space occupied by scrollbars. They are at their physical edge in this coordinate
     // system, so order is important here: first flip, then subtract scrollbars.
-    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+    if (shouldPlaceVerticalScrollbarOnLeft() && isHorizontalWritingMode())
         rect.move(verticalScrollbarWidth(), 0);
     rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight());
     return rect;

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -556,7 +556,7 @@
             scrollOffset = FloatPoint() + scrollableArea->scrollOffset();
 
         float scrollbarOffset = 0;
-        if (enclosingClippingBox.hasLayer() && enclosingClippingBox.shouldPlaceBlockDirectionScrollbarOnLeft() && scrollableArea)
+        if (enclosingClippingBox.hasLayer() && enclosingClippingBox.shouldPlaceVerticalScrollbarOnLeft() && scrollableArea)
             scrollbarOffset = scrollableArea->verticalScrollbarWidth(IgnoreOverlayScrollbarSize);
 
         constrainingRect.setLocation(FloatPoint(scrollOffset.x() + scrollbarOffset, scrollOffset.y()));

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -2430,9 +2430,10 @@
         // border edge. Make the rectangle relative to the scrollable area.
         localExposeRect.moveBy(-LayoutPoint(box->borderLeft(), box->borderTop()));
 
-        if (box->shouldPlaceBlockDirectionScrollbarOnLeft()) {
-            // For direction: rtl; writing-mode: horizontal-tb box, the scroll bar is on the left side. The visible rect
-            // starts from the right side of scroll bar. So the x of localExposeRect should start from the same position too.
+        if (box->shouldPlaceVerticalScrollbarOnLeft()) {
+            // For `direction: rtl; writing-mode: horizontal-{tb,bt}` and `writing-mode: vertical-rl`
+            // boxes, the scroll bar is on the left side. The visible rect starts from the right side
+            // of the scroll bar. So the x of localExposeRect should start from the same position too.
             localExposeRect.moveBy(LayoutPoint(-scrollableArea->verticalScrollbarWidth(), 0));
         }
         LayoutRect layerBounds(0_lu, 0_lu, box->clientWidth(), box->clientHeight());
@@ -2676,7 +2677,7 @@
     element->setMinimumSizeForResizing(minimumSize);
     
     LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, oldOffset.height() / zoomFactor);
-    if (renderer->shouldPlaceBlockDirectionScrollbarOnLeft()) {
+    if (renderer->shouldPlaceVerticalScrollbarOnLeft()) {
         newOffset.setWidth(-newOffset.width());
         adjustedOldOffset.setWidth(-adjustedOldOffset.width());
     }
@@ -2733,7 +2734,7 @@
     // Scrollbars sit inside the border box.
     auto overflowControlsPositioningRect = snappedIntRect(renderBox.paddingBoxRectIncludingScrollbar());
 
-    bool placeVerticalScrollbarOnTheLeft = renderBox.shouldPlaceBlockDirectionScrollbarOnLeft();
+    bool placeVerticalScrollbarOnTheLeft = renderBox.shouldPlaceVerticalScrollbarOnLeft();
     bool haveResizer = renderer().style().resize() != Resize::None;
 
     OverflowControlRects result;
@@ -2786,7 +2787,7 @@
 IntSize RenderLayer::offsetFromResizeCorner(const IntPoint& localPoint) const
 {
     auto resizerRect = overflowControlsRects().resizer;
-    auto resizeCorner = renderer().shouldPlaceBlockDirectionScrollbarOnLeft() ? resizerRect.minXMaxYCorner() : resizerRect.maxXMaxYCorner();
+    auto resizeCorner = renderer().shouldPlaceVerticalScrollbarOnLeft() ? resizerRect.minXMaxYCorner() : resizerRect.maxXMaxYCorner();
     return localPoint - resizeCorner;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -2230,7 +2230,7 @@
     auto& frameView = m_renderView.frameView();
 
     return FloatPoint(
-        frameView.shouldPlaceBlockDirectionScrollbarOnLeft() ? frameView.horizontalScrollbarIntrusion() : 0,
+        frameView.shouldPlaceVerticalScrollbarOnLeft() ? frameView.horizontalScrollbarIntrusion() : 0,
         FrameView::yPositionForInsetClipLayer(frameView.scrollPosition(), frameView.topContentInset()));
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -207,7 +207,7 @@
 #endif
 }
 
-bool RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft() const
+bool RenderLayerModelObject::shouldPlaceVerticalScrollbarOnLeft() const
 {
 // RTL Scrollbars require some system support, and this system support does not exist on certain versions of OS X. iOS uses a separate mechanism.
 #if PLATFORM(IOS_FAMILY)
@@ -215,12 +215,12 @@
 #else
     switch (settings().userInterfaceDirectionPolicy()) {
     case UserInterfaceDirectionPolicy::Content:
-        return style().shouldPlaceBlockDirectionScrollbarOnLeft();
+        return style().shouldPlaceVerticalScrollbarOnLeft();
     case UserInterfaceDirectionPolicy::System:
         return settings().systemLayoutDirection() == TextDirection::RTL;
     }
     ASSERT_NOT_REACHED();
-    return style().shouldPlaceBlockDirectionScrollbarOnLeft();
+    return style().shouldPlaceVerticalScrollbarOnLeft();
 #endif
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerModelObject.h (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayerModelObject.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayerModelObject.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -56,7 +56,7 @@
 
     virtual bool isScrollableOrRubberbandableBox() const { return false; }
 
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
+    bool shouldPlaceVerticalScrollbarOnLeft() const;
 
     Optional<LayerRepaintRects> layerRepaintRects() const;
 

Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -119,9 +119,9 @@
     element->setSavedLayerScrollPosition(IntPoint());
 }
 
-bool RenderLayerScrollableArea::shouldPlaceBlockDirectionScrollbarOnLeft() const
+bool RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const
 {
-    return m_layer.renderer().shouldPlaceBlockDirectionScrollbarOnLeft();
+    return m_layer.renderer().shouldPlaceVerticalScrollbarOnLeft();
 }
 
 #if ENABLE(IOS_TOUCH_EVENTS)
@@ -654,7 +654,7 @@
 
     bool haveNonOverlayHorizontalScrollbar = isNonOverlayScrollbar(m_hBar.get());
     bool haveNonOverlayVerticalScrollbar = isNonOverlayScrollbar(m_vBar.get());
-    bool placeVerticalScrollbarOnTheLeft = shouldPlaceBlockDirectionScrollbarOnLeft();
+    bool placeVerticalScrollbarOnTheLeft = shouldPlaceVerticalScrollbarOnLeft();
     bool haveResizer = renderer.style().resize() != Resize::None;
     bool scrollbarsAvoidCorner = (haveNonOverlayHorizontalScrollbar && haveNonOverlayVerticalScrollbar) || (haveResizer && (haveNonOverlayHorizontalScrollbar || haveNonOverlayVerticalScrollbar));
 
@@ -1021,7 +1021,7 @@
     ASSERT(box);
 
     int scrollableLeftOverflow = roundToInt(overflowLeft() - box->borderLeft());
-    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+    if (shouldPlaceVerticalScrollbarOnLeft() /*|| box->style().writingMode() == WritingMode::RightToLeft*/)
         scrollableLeftOverflow -= verticalScrollbarWidth();
     int scrollableTopOverflow = roundToInt(overflowTop() - box->borderTop());
     setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow));
@@ -1104,7 +1104,7 @@
         if (box->hasVerticalScrollbarWithAutoBehavior())
             setHasVerticalScrollbar(hasVerticalOverflow);
 
-        if (autoVerticalScrollBarChanged && shouldPlaceBlockDirectionScrollbarOnLeft())
+        if (autoVerticalScrollBarChanged && shouldPlaceVerticalScrollbarOnLeft())
             computeScrollOrigin();
 
         m_layer.updateSelfPaintingLayer();
@@ -1348,7 +1348,7 @@
         cornerResizerSize = resizeCornerImage->size();
     }
 
-    if (shouldPlaceBlockDirectionScrollbarOnLeft()) {
+    if (shouldPlaceVerticalScrollbarOnLeft()) {
         context.save();
         context.translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
         context.scale(FloatSize(-1.0, 1.0));
@@ -1509,7 +1509,7 @@
     auto rects = overflowControlsRects();
 
     auto cornerRectInFragment = [&](const IntRect& fragmentBounds, const IntRect& resizerRect) {
-        if (shouldPlaceBlockDirectionScrollbarOnLeft()) {
+        if (shouldPlaceVerticalScrollbarOnLeft()) {
             IntSize offsetFromBottomLeft = borderBoxRect.minXMaxYCorner() - resizerRect.minXMaxYCorner();
             return IntRect { fragmentBounds.minXMaxYCorner() - offsetFromBottomLeft - IntSize { 0, resizerRect.height() }, resizerRect.size() };
         }
@@ -1570,7 +1570,7 @@
     setHasHorizontalScrollbar(needsHorizontalScrollbar);
     setHasVerticalScrollbar(needsVerticalScrollbar);
 
-    if (hadVerticalScrollbar != needsVerticalScrollbar || (needsVerticalScrollbar && oldStyle && box->style().shouldPlaceBlockDirectionScrollbarOnLeft() != oldStyle->shouldPlaceBlockDirectionScrollbarOnLeft()))
+    if (hadVerticalScrollbar != needsVerticalScrollbar || (needsVerticalScrollbar && oldStyle && box->style().shouldPlaceVerticalScrollbarOnLeft() != oldStyle->shouldPlaceVerticalScrollbarOnLeft()))
         computeScrollOrigin();
 
     // With non-overlay overflow:scroll, scrollbars are always visible but may be disabled.

Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -167,7 +167,7 @@
     bool usesCompositedScrolling() const final;
     bool usesAsyncScrolling() const final;
 
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const final;
+    bool shouldPlaceVerticalScrollbarOnLeft() const final;
 
     bool isRenderLayer() const final { return true; }
     void invalidateScrollbarRect(Scrollbar&, const IntRect&) final;

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -281,7 +281,7 @@
 LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
 {
     LayoutUnit x = additionalOffset.x() + borderLeft() + paddingLeft();
-    if (shouldPlaceBlockDirectionScrollbarOnLeft() && m_vBar)
+    if (shouldPlaceVerticalScrollbarOnLeft() && m_vBar)
         x += m_vBar->occupiedWidth();
     LayoutUnit y = additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset);
     return LayoutRect(x, y, contentWidth(), itemHeight());
@@ -363,7 +363,7 @@
     if (!m_vBar)
         return;
 
-    LayoutUnit left = paintOffset.x() + (shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - m_vBar->width());
+    LayoutUnit left = paintOffset.x() + (shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - m_vBar->width());
     LayoutUnit top = paintOffset.y() + borderTop();
     LayoutUnit width = m_vBar->width();
     LayoutUnit height = this->height() - (borderTop() + borderBottom());
@@ -469,7 +469,7 @@
     if (!m_vBar || !m_vBar->shouldParticipateInHitTesting())
         return false;
 
-    LayoutUnit x = accumulatedOffset.x() + (shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - m_vBar->width());
+    LayoutUnit x = accumulatedOffset.x() + (shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - m_vBar->width());
     LayoutUnit y = accumulatedOffset.y() + borderTop();
     LayoutUnit width = m_vBar->width();
     LayoutUnit height = this->height() - borderTop() - borderBottom();
@@ -491,9 +491,9 @@
         return -1;
 
     int scrollbarWidth = m_vBar ? m_vBar->width() : 0;
-    if (shouldPlaceBlockDirectionScrollbarOnLeft() && (offset.width() < borderLeft() + paddingLeft() + scrollbarWidth || offset.width() > width() - borderRight() - paddingRight()))
+    if (shouldPlaceVerticalScrollbarOnLeft() && (offset.width() < borderLeft() + paddingLeft() + scrollbarWidth || offset.width() > width() - borderRight() - paddingRight()))
         return -1;
-    if (!shouldPlaceBlockDirectionScrollbarOnLeft() && (offset.width() < borderLeft() + paddingLeft() || offset.width() > width() - borderRight() - paddingRight() - scrollbarWidth))
+    if (!shouldPlaceVerticalScrollbarOnLeft() && (offset.width() < borderLeft() + paddingLeft() || offset.width() > width() - borderRight() - paddingRight() - scrollbarWidth))
         return -1;
 
     int newOffset = (offset.height() - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
@@ -800,7 +800,7 @@
 void RenderListBox::invalidateScrollbarRect(Scrollbar& scrollbar, const IntRect& rect)
 {
     IntRect scrollRect = rect;
-    scrollRect.move(shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width(), borderTop());
+    scrollRect.move(shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width(), borderTop());
     repaintRectangle(scrollRect);
 }
 
@@ -807,7 +807,7 @@
 IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar& scrollbar, const IntRect& scrollbarRect) const
 {
     IntRect rect = scrollbarRect;
-    int scrollbarLeft = shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
+    int scrollbarLeft = shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
     int scrollbarTop = borderTop();
     rect.move(scrollbarLeft, scrollbarTop);
     return view().frameView().convertFromRendererToContainingView(this, rect);
@@ -816,7 +816,7 @@
 IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar& scrollbar, const IntRect& parentRect) const
 {
     IntRect rect = view().frameView().convertFromContainingViewToRenderer(this, parentRect);
-    int scrollbarLeft = shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
+    int scrollbarLeft = shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
     int scrollbarTop = borderTop();
     rect.move(-scrollbarLeft, -scrollbarTop);
     return rect;
@@ -825,7 +825,7 @@
 IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar& scrollbar, const IntPoint& scrollbarPoint) const
 {
     IntPoint point = scrollbarPoint;
-    int scrollbarLeft = shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
+    int scrollbarLeft = shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
     int scrollbarTop = borderTop();
     point.move(scrollbarLeft, scrollbarTop);
     return view().frameView().convertFromRendererToContainingView(this, point);
@@ -834,7 +834,7 @@
 IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar& scrollbar, const IntPoint& parentPoint) const
 {
     IntPoint point = view().frameView().convertFromContainingViewToRenderer(this, parentPoint);
-    int scrollbarLeft = shouldPlaceBlockDirectionScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
+    int scrollbarLeft = shouldPlaceVerticalScrollbarOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
     int scrollbarTop = borderTop();
     point.move(-scrollbarLeft, -scrollbarTop);
     return point;

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -172,7 +172,7 @@
     void paintItemBackground(PaintInfo&, const LayoutPoint&, int listIndex);
     void scrollToRevealSelection();
 
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const final { return RenderBlockFlow::shouldPlaceBlockDirectionScrollbarOnLeft(); }
+    bool shouldPlaceVerticalScrollbarOnLeft() const final { return RenderBlockFlow::shouldPlaceVerticalScrollbarOnLeft(); }
 
     bool m_optionsChanged;
     bool m_scrollToRevealSelectionAfterLayout;

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -473,7 +473,7 @@
         // and the Renderer that contains the iframe. This transformation must account for a
         // left scrollbar (if one exists).
         FrameView& frameView = this->frameView();
-        if (frameView.shouldPlaceBlockDirectionScrollbarOnLeft() && frameView.verticalScrollbar())
+        if (frameView.shouldPlaceVerticalScrollbarOnLeft() && frameView.verticalScrollbar())
             adjustedRect.move(LayoutSize(frameView.verticalScrollbar()->occupiedWidth(), 0));
 
         ownerBox->repaintRectangle(adjustedRect);

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (276181 => 276182)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-04-16 23:55:14 UTC (rev 276182)
@@ -2581,9 +2581,9 @@
     return m_backgroundData->outline.offset();
 }
 
-bool RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft() const
+bool RenderStyle::shouldPlaceVerticalScrollbarOnLeft() const
 {
-    return !isLeftToRightDirection() && isHorizontalWritingMode();
+    return (!isLeftToRightDirection() && isHorizontalWritingMode()) || writingMode() == WritingMode::RightToLeft;
 }
 
 Vector<PaintType, 3> RenderStyle::paintTypesForPaintOrder(PaintOrder order)

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (276181 => 276182)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -829,7 +829,7 @@
     bool hasIsolation() const { return false; }
 #endif
 
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
+    bool shouldPlaceVerticalScrollbarOnLeft() const;
 
 #if ENABLE(CSS_TRAILING_WORD)
     TrailingWord trailingWord() const { return TrailingWord::Auto; }

Modified: trunk/Source/WebKit/ChangeLog (276181 => 276182)


--- trunk/Source/WebKit/ChangeLog	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebKit/ChangeLog	2021-04-16 23:55:14 UTC (rev 276182)
@@ -1,3 +1,13 @@
+2021-04-16  Cameron McCormack  <[email protected]>
+
+        Place vertical scrollbars at (inline/block)-end edge in all writing modes.
+        https://bugs.webkit.org/show_bug.cgi?id=224224
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/win/WebPopupMenuProxyWin.h:
+        * WebProcess/Plugins/PDF/PDFPlugin.h:
+
 2021-04-16  Wenson Hsieh  <[email protected]>
 
         [macOS] Refactor some webpage translation code

Modified: trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h (276181 => 276182)


--- trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -80,7 +80,7 @@
     WebCore::IntSize visibleSize() const override;
     WebCore::IntSize contentsSize() const override;
     WebCore::IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const override { return false; }
+    bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; }
     bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override { return false; }
     bool isScrollableOrRubberbandable() override { return true; }
     bool hasScrollableOrRubberbandableAncestor() override { return true; }

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (276181 => 276182)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2021-04-16 23:53:19 UTC (rev 276181)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2021-04-16 23:55:14 UTC (rev 276182)
@@ -256,7 +256,7 @@
     WebCore::IntPoint convertFromScrollbarToContainingView(const WebCore::Scrollbar&, const WebCore::IntPoint& scrollbarPoint) const final;
     WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar&, const WebCore::IntPoint& parentPoint) const final;
     bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
-    bool shouldPlaceBlockDirectionScrollbarOnLeft() const final { return false; }
+    bool shouldPlaceVerticalScrollbarOnLeft() const final { return false; }
     String debugDescription() const final;
 
     // PDFPlugin functions.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to