Title: [200261] trunk
Revision
200261
Author
[email protected]
Date
2016-04-29 13:33:48 -0700 (Fri, 29 Apr 2016)

Log Message

[RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
https://bugs.webkit.org/show_bug.cgi?id=157164
<rdar://problem/25993610>

Reviewed by Darin Adler.

Source/WebCore:

There was some code left over from the old implementation of RTL_SCROLLBARS
which had some faulty assumptions about the interaction between direction
and scrollbar placement. In particular, once we began obeying the "dir"
attribute in r200116, these assumptions were no longer valid.

Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
      scrollbars/rtl/div-absolute.html
      scrollbars/rtl/div-horizontal.html

* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::layoutOverflowRect):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeScrollDimensions):

LayoutTests:

* TestExpectations:
* fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars-expected.html: Added.
* fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200260 => 200261)


--- trunk/LayoutTests/ChangeLog	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/LayoutTests/ChangeLog	2016-04-29 20:33:48 UTC (rev 200261)
@@ -1,3 +1,15 @@
+2016-04-29  Myles C. Maxfield  <[email protected]>
+
+        [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=157164
+        <rdar://problem/25993610>
+
+        Reviewed by Darin Adler.
+
+        * TestExpectations:
+        * fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html: Added.
+
 2016-04-29  Joanmarie Diggs  <[email protected]>
 
         [GTK] r65681 broke a couple GTK+ a11y tests

Modified: trunk/LayoutTests/TestExpectations (200260 => 200261)


--- trunk/LayoutTests/TestExpectations	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/LayoutTests/TestExpectations	2016-04-29 20:33:48 UTC (rev 200261)
@@ -989,6 +989,7 @@
 fast/scrolling/rtl-scrollbars-listbox-select-right.html [ ImageOnlyFailure ]
 fast/scrolling/rtl-scrollbars-listbox-simple.html [ ImageOnlyFailure ]
 fast/scrolling/rtl-scrollbars-listbox.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html [ ImageOnlyFailure ]
 
 # <a download> does not support Blobs
 webkit.org/b/156099 http/tests/security/anchor-download-allow-blob.html [ Failure ]

Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars-expected.html (0 => 200261)


--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars-expected.html	2016-04-29 20:33:48 UTC (rev 200261)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+</style>
+</head>
+<body>
+This test makes sure that positioned elements do not intersect with RTL scrollbars. The test passes if you see the word "Test" below (and its not clipped at all).
+<div style="position: relative; overflow: hidden; width: 85px; height: 85px;">
+<div style="position: absolute; bottom: 0px; left: 0px; font-family: Ahem">Test</div>
+</div>
+<script>
+var scrollme = document.getElementById("scrollme");
+scrollme.scrollTop = 400;
+scrollme.scrollLeft = -400;
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html (0 => 200261)


--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html	2016-04-29 20:33:48 UTC (rev 200261)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+</style>
+</head>
+<body>
+This test makes sure that positioned elements do not intersect with RTL scrollbars. The test passes if you see the word "Test" below (and its not clipped at all).
+<div style="overflow: hidden; width: 85px; height: 85px;">
+<div id="scrollme" dir="rtl" style="position: relative; overflow: auto; width: 100px; height: 100px; left: -15px;">
+<div style="position: absolute; top: 200px; right: 250px; font-family: Ahem">Test</div>
+</div>
+</div>
+<script>
+var scrollme = document.getElementById("scrollme");
+scrollme.scrollTop = 400;
+scrollme.scrollLeft = -400;
+</script>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (200260 => 200261)


--- trunk/Source/WebCore/ChangeLog	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/Source/WebCore/ChangeLog	2016-04-29 20:33:48 UTC (rev 200261)
@@ -1,3 +1,29 @@
+2016-04-29  Myles C. Maxfield  <[email protected]>
+
+        [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=157164
+        <rdar://problem/25993610>
+
+        Reviewed by Darin Adler.
+
+        There was some code left over from the old implementation of RTL_SCROLLBARS
+        which had some faulty assumptions about the interaction between direction
+        and scrollbar placement. In particular, once we began obeying the "dir"
+        attribute in r200116, these assumptions were no longer valid.
+
+        Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
+              scrollbars/rtl/div-absolute.html
+              scrollbars/rtl/div-horizontal.html
+
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::layoutOverflowRect):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computeOverflow): Deleted.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::layoutOverflowRectForPropagation):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::computeScrollDimensions):
+
 2016-04-29  Nan Wang  <[email protected]>
 
         AX: CharacterOffset not working correctly with composed characters and collapsed white spaces

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (200260 => 200261)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2016-04-29 20:33:48 UTC (rev 200261)
@@ -223,7 +223,7 @@
     // For horizontal-tb and vertical-lr they will match physical directions, but for horizontal-bt and vertical-rl, the top/bottom and left/right
     // respectively are flipped when compared to their physical counterparts.  For example minX is on the left in vertical-lr, but it is on the right in vertical-rl.
     LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) const
-    { 
+    {
         return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom));
     }
     LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (200260 => 200261)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-04-29 20:33:48 UTC (rev 200261)
@@ -1000,13 +1000,13 @@
     }
 }
 
+// Overflow is always relative to the border-box of the element in question.
+// Therefore, if the element has a vertical scrollbar placed on the left, an overflow rect at x=2px would conceptually intersect the scrollbar.
 void RenderBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool)
 {
     clearOverflow();
-    // Add overflow from children.
     addOverflowFromChildren();
 
-    // Add in the overflow from positioned objects.
     addOverflowFromPositionedObjects();
 
     if (hasOverflowClip()) {

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (200260 => 200261)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2016-04-29 20:33:48 UTC (rev 200261)
@@ -4903,7 +4903,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() && style().isLeftToRightDirection())
+    if (shouldPlaceBlockDirectionScrollbarOnLeft())
         rect.move(verticalScrollbarWidth(), 0);
     rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight());
     return rect;

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (200260 => 200261)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-04-29 20:29:18 UTC (rev 200260)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-04-29 20:33:48 UTC (rev 200261)
@@ -3380,8 +3380,8 @@
     m_scrollSize.setHeight(overflowBottom() - overflowTop());
 
     int scrollableLeftOverflow = overflowLeft() - box->borderLeft();
-    if (box->style().isLeftToRightDirection() && box->shouldPlaceBlockDirectionScrollbarOnLeft() && m_vBar)
-        scrollableLeftOverflow -= m_vBar->occupiedWidth();
+    if (shouldPlaceBlockDirectionScrollbarOnLeft())
+        scrollableLeftOverflow -= verticalScrollbarWidth();
     int scrollableTopOverflow = overflowTop() - box->borderTop();
     setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to