Flipped-blocks writing mode blocks do not hit test their overflow
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 21:27:54 +0000 (21:27 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 21:27:54 +0000 (21:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70546

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/writing-mode/flipped-blocks-hit-test-overflow.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint): Flip the overflow rect if necessary.

LayoutTests:

* fast/writing-mode/flipped-blocks-hit-test-overflow-expected.txt: Added.
* fast/writing-mode/flipped-blocks-hit-test-overflow.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98022 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-expected.txt [new file with mode: 0644]
LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index c90eab54919b2019dc6f3b07b0e725700b7eb75f..30b8419ae80a89be43e7a5219328d91541cc1b48 100755 (executable)
@@ -1,3 +1,13 @@
+2011-10-20  Dan Bernstein  <mitz@apple.com>
+
+        Flipped-blocks writing mode blocks do not hit test their overflow
+        https://bugs.webkit.org/show_bug.cgi?id=70546
+
+        Reviewed by Sam Weinig.
+
+        * fast/writing-mode/flipped-blocks-hit-test-overflow-expected.txt: Added.
+        * fast/writing-mode/flipped-blocks-hit-test-overflow.html: Added.
+
 2011-10-20  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=70539
diff --git a/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-expected.txt b/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow-expected.txt
new file mode 100644 (file)
index 0000000..3d63b10
--- /dev/null
@@ -0,0 +1,5 @@
+This tests hit-testing in the overflow area of flipped-blocks writing mode blocks.
+
+The red rectangle should turn green when you hover over it.
+
+PASS
diff --git a/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow.html b/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow.html
new file mode 100644 (file)
index 0000000..3ea8531
--- /dev/null
@@ -0,0 +1,25 @@
+<style>
+    #target { background-color: red; }
+    #target:hover { background-color: green; }
+</style>
+<div style="margin: 100px 0 0 92px; -webkit-writing-mode: horizontal-bt; height: 100px; width: 100px;">
+    <div style="height: 100px;"></div>
+    <div id="target" style="height: 50px;"></div>
+</div>
+<p>
+    This tests hit-testing in the overflow area of flipped-blocks writing mode
+    blocks.
+</p>
+<p>
+    The red rectangle should turn green when you hover over it.
+</p>
+<p id="result">
+</p>
+<script>
+    var target = document.getElementById("target");
+    var result = document.elementFromPoint(150, 75);
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    document.getElementById("result").innerText = result === target ? "PASS" : "FAIL";
+</script>
index 19da6c21ec4f4484b581a5bce17094beab6e6853..f66def9e97350ed5d5e3551cc7dc0837c51b5bfc 100755 (executable)
@@ -1,3 +1,15 @@
+2011-10-20  Dan Bernstein  <mitz@apple.com>
+
+        Flipped-blocks writing mode blocks do not hit test their overflow
+        https://bugs.webkit.org/show_bug.cgi?id=70546
+
+        Reviewed by Sam Weinig.
+
+        Test: fast/writing-mode/flipped-blocks-hit-test-overflow.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint): Flip the overflow rect if necessary.
+
 2011-10-20  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=70539
index 437751168daff43faf98fb9aa2e1e407b99ef35a..58e0f1f606b33533b1778095449637ab30a8fd99 100644 (file)
@@ -4113,6 +4113,7 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     if (!isRenderView()) {
         // Check if we need to do anything at all.
         LayoutRect overflowBox = visualOverflowRect();
+        flipForWritingMode(overflowBox);
         overflowBox.moveBy(adjustedLocation);
         if (!overflowBox.intersects(result.rectForPoint(pointInContainer)))
             return false;