Title: [123990] trunk
Revision
123990
Author
[email protected]
Date
2012-07-29 17:44:08 -0700 (Sun, 29 Jul 2012)

Log Message

Hit testing in the gap between pages returns incorrect results in flipped blocks writing modes
https://bugs.webkit.org/show_bug.cgi?id=92600

Reviewed by Simon Fraser.

Source/WebCore: 

Test: fast/multicol/hit-test-gap-between-pages-flipped.html

* rendering/RenderBlock.h:
(WebCore::RenderBlock): Promoted offsetForContents() from private to protected, and demoted
adjustPointToColumnContents() back to private.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest): Changed to flip the point passed to updateHitTestResults().
* rendering/RenderView.cpp:
(WebCore::RenderView::updateHitTestResult): Changed to call offsetForContents(), which, as
of r123977, correctly accounts for flippedness.

LayoutTests: 

* fast/multicol/hit-test-gap-between-pages-flipped-expected.txt: Added.
* fast/multicol/hit-test-gap-between-pages-flipped.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (123989 => 123990)


--- trunk/LayoutTests/ChangeLog	2012-07-29 23:15:30 UTC (rev 123989)
+++ trunk/LayoutTests/ChangeLog	2012-07-30 00:44:08 UTC (rev 123990)
@@ -1,5 +1,15 @@
 2012-07-29  Dan Bernstein  <[email protected]>
 
+        Hit testing in the gap between pages returns incorrect results in flipped blocks writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=92600
+
+        Reviewed by Simon Fraser.
+
+        * fast/multicol/hit-test-gap-between-pages-flipped-expected.txt: Added.
+        * fast/multicol/hit-test-gap-between-pages-flipped.html: Added.
+
+2012-07-29  Dan Bernstein  <[email protected]>
+
         In flipped blocks, a point on the top edge of a text box is considered outside the box (and vice versa)
         https://bugs.webkit.org/show_bug.cgi?id=92597
 

Added: trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped-expected.txt (0 => 123990)


--- trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped-expected.txt	2012-07-30 00:44:08 UTC (rev 123990)
@@ -0,0 +1 @@
+PASS

Added: trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html (0 => 123990)


--- trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html	                        (rev 0)
+++ trunk/LayoutTests/fast/multicol/hit-test-gap-between-pages-flipped.html	2012-07-30 00:44:08 UTC (rev 123990)
@@ -0,0 +1,17 @@
+<html>
+    <body style="margin: 0; -webkit-writing-mode: horizontal-bt;">
+        <div style="height: 50%;"></div>
+        <div style="height: 50%;"></div>
+        <div id="target" style="height: 50%;"></div>
+        <div style="height: 50%;"></div>
+        <div id="result">FAIL: Test did not run (DumpRenderTree or WebKitTestRunner needed)</div>
+        <script>
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                internals.setPagination(document, "LeftToRightPaginated", 20, 100);
+                document.getElementById("result").innerText = document.caretRangeFromPoint(115, 550).startContainer === document.getElementById("target")
+                    ? "PASS" : "FAIL";
+            }
+        </script>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (123989 => 123990)


--- trunk/Source/WebCore/ChangeLog	2012-07-29 23:15:30 UTC (rev 123989)
+++ trunk/Source/WebCore/ChangeLog	2012-07-30 00:44:08 UTC (rev 123990)
@@ -1,5 +1,23 @@
 2012-07-29  Dan Bernstein  <[email protected]>
 
+        Hit testing in the gap between pages returns incorrect results in flipped blocks writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=92600
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/multicol/hit-test-gap-between-pages-flipped.html
+
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock): Promoted offsetForContents() from private to protected, and demoted
+        adjustPointToColumnContents() back to private.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::hitTest): Changed to flip the point passed to updateHitTestResults().
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::updateHitTestResult): Changed to call offsetForContents(), which, as
+        of r123977, correctly accounts for flippedness.
+
+2012-07-29  Dan Bernstein  <[email protected]>
+
         In flipped blocks, a point on the top edge of a text box is considered outside the box (and vice versa)
         https://bugs.webkit.org/show_bug.cgi?id=92597
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (123989 => 123990)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2012-07-29 23:15:30 UTC (rev 123989)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2012-07-30 00:44:08 UTC (rev 123990)
@@ -473,9 +473,9 @@
 
     void computeInitialRegionRangeForBlock();
     void computeRegionRangeForBlock();
-    
+
     virtual void checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight);
-    
+
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const { return children(); }
@@ -807,6 +807,7 @@
 
     virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
 
+    void adjustPointToColumnContents(LayoutPoint&) const;
     void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const; // Helper function for borderFitAdjust
 
     void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBottom, RootInlineBox* highest = 0);
@@ -816,9 +817,6 @@
     Position positionForBox(InlineBox*, bool start = true) const;
     VisiblePosition positionForPointWithInlineChildren(const LayoutPoint&);
 
-    // Adjust from painting offsets to the local coords of this renderer
-    void offsetForContents(LayoutPoint&) const;
-
     virtual void calcColumnWidth();
     void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild);
 
@@ -964,7 +962,8 @@
     void adjustLinePositionForPagination(RootInlineBox*, LayoutUnit& deltaOffset); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page.
     LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, LayoutUnit estimateWithoutPagination, RenderBox* child, bool atBeforeSideOfBlock);
 
-    void adjustPointToColumnContents(LayoutPoint&) const;
+    // Adjust from painting offsets to the local coords of this renderer
+    void offsetForContents(LayoutPoint&) const;
 
     // This function is called to test a line box that has moved in the block direction to see if it has ended up in a new
     // region/page/column that has a different available line width than the old one. Used to know when you have to dirty a

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (123989 => 123990)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-07-29 23:15:30 UTC (rev 123989)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-07-30 00:44:08 UTC (rev 123990)
@@ -3406,7 +3406,7 @@
         // return ourselves. We do this so mouse events continue getting delivered after a drag has 
         // exited the WebView, and so hit testing over a scrollbar hits the content document.
         if ((request.active() || request.release()) && isRootLayer()) {
-            renderer()->updateHitTestResult(result, result.point());
+            renderer()->updateHitTestResult(result, toRenderView(renderer())->flipForWritingMode(result.point()));
             insideLayer = this;
         }
     }

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (123989 => 123990)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2012-07-29 23:15:30 UTC (rev 123989)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2012-07-30 00:44:08 UTC (rev 123990)
@@ -854,7 +854,7 @@
             result.setInnerNonSharedNode(node);
 
         LayoutPoint adjustedPoint = point;
-        adjustPointToColumnContents(adjustedPoint);
+        offsetForContents(adjustedPoint);
 
         result.setLocalPoint(adjustedPoint);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to