Title: [192854] trunk
Revision
192854
Author
[email protected]
Date
2015-11-30 18:53:25 -0800 (Mon, 30 Nov 2015)

Log Message

Amazon.com Additional Information links aren't clickable
https://bugs.webkit.org/show_bug.cgi?id=151401
<rdar://problem/23454261>

Reviewed by Darin Adler.

Source/WebCore:

The cause of this issue is that the painting order is different from the hittest order so we can end up
with visible but unreachable content. To fix this, the executation flow of hittest has been reordered.
According to the paint system, which renders the webpage from the bottom RenderLayer to the top, contents
are rendered before floats. Hence, for the hittest, which determines the hitted location from top RenderLayer
to the bottom, should do it reversedly. Now, hittest will first test floats then contents.

Test: fast/block/float/hit-test-on-overlapping-floats.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):

LayoutTests:

* fast/block/float/hit-test-on-overlapping-floats-expected.txt: Added.
* fast/block/float/hit-test-on-overlapping-floats.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (192853 => 192854)


--- trunk/LayoutTests/ChangeLog	2015-12-01 02:46:09 UTC (rev 192853)
+++ trunk/LayoutTests/ChangeLog	2015-12-01 02:53:25 UTC (rev 192854)
@@ -1,3 +1,14 @@
+2015-11-30  Jiewen Tan  <[email protected]>
+
+        Amazon.com Additional Information links aren't clickable
+        https://bugs.webkit.org/show_bug.cgi?id=151401
+        <rdar://problem/23454261>
+
+        Reviewed by Darin Adler.
+
+        * fast/block/float/hit-test-on-overlapping-floats-expected.txt: Added.
+        * fast/block/float/hit-test-on-overlapping-floats.html: Added.
+
 2015-11-30  Brady Eidson  <[email protected]>
 
         Modern IDB: Iterating index cursors to a specific key is busted.

Added: trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats-expected.txt (0 => 192854)


--- trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats-expected.txt	2015-12-01 02:53:25 UTC (rev 192854)
@@ -0,0 +1,6 @@
+PASS document.elementFromPoint(450, 10) is document.getElementById('rightc')
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foobar
+

Added: trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats.html (0 => 192854)


--- trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/hit-test-on-overlapping-floats.html	2015-12-01 02:53:25 UTC (rev 192854)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+        #leftc {
+            float: left;
+            width: 500px;
+            background-color: silver;
+            margin-right: -100px;
+        }
+
+        #rightc {
+            float: right;
+            width: 400px;
+            background-color: rgba(0, 128, 0, 0.75);
+            padding-bottom: 1px;
+        }
+        </style>
+    </head>
+    <body>
+        <div style="width:800px">
+            <div id="leftc">foo</div>
+            <div id="rightc">bar</div>
+            <div style="height:0px; width:0px; clear:left;"></div>
+        </div>
+        <script src=""
+        <script>
+        shouldBe("document.elementFromPoint(450, 10)", "document.getElementById('rightc')");
+        </script>
+        <script src=""
+	</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (192853 => 192854)


--- trunk/Source/WebCore/ChangeLog	2015-12-01 02:46:09 UTC (rev 192853)
+++ trunk/Source/WebCore/ChangeLog	2015-12-01 02:53:25 UTC (rev 192854)
@@ -1,3 +1,22 @@
+2015-11-30  Jiewen Tan  <[email protected]>
+
+        Amazon.com Additional Information links aren't clickable
+        https://bugs.webkit.org/show_bug.cgi?id=151401
+        <rdar://problem/23454261>
+
+        Reviewed by Darin Adler.
+
+        The cause of this issue is that the painting order is different from the hittest order so we can end up
+        with visible but unreachable content. To fix this, the executation flow of hittest has been reordered.
+        According to the paint system, which renders the webpage from the bottom RenderLayer to the top, contents
+        are rendered before floats. Hence, for the hittest, which determines the hitted location from top RenderLayer
+        to the bottom, should do it reversedly. Now, hittest will first test floats then contents.
+
+        Test: fast/block/float/hit-test-on-overlapping-floats.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+
 2015-11-30  Simon Fraser  <[email protected]>
 
         Fix possible crash with animated layers in reflections

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (192853 => 192854)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2015-12-01 02:46:09 UTC (rev 192853)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2015-12-01 02:53:25 UTC (rev 192854)
@@ -2474,12 +2474,12 @@
         // Hit test descendants first.
         LayoutSize scrolledOffset(localOffset - scrolledContentOffset());
 
+        if (hitTestAction == HitTestFloat && hitTestFloats(request, result, locationInContainer, toLayoutPoint(scrolledOffset)))
+            return true;
         if (hitTestContents(request, result, locationInContainer, toLayoutPoint(scrolledOffset), hitTestAction)) {
             updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - localOffset));
             return true;
         }
-        if (hitTestAction == HitTestFloat && hitTestFloats(request, result, locationInContainer, toLayoutPoint(scrolledOffset)))
-            return true;
     }
 
     // Check if the point is outside radii.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to