<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[162064] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/162064">162064</a></dd>
<dt>Author</dt> <dd>abucur@adobe.com</dd>
<dt>Date</dt> <dd>2014-01-15 02:30:17 -0800 (Wed, 15 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Regions] Hit-testing goes through clipped layer in fast/regions/overflow-first-and-last-regions-in-container-hidden.html
https://bugs.webkit.org/show_bug.cgi?id=126886

Reviewed by Mihnea Ovidenie.

Source/WebCore:

Currently, when hit testing a location inside a flow thread we ignore the clipping rectangle of
the region. This leads to false positives when the location is over the clipped out content of a
flow thread. The patch verifies that the location is inside the clipping rectangle of the region before
forwarding the hit test verification to the flow thread layer.

Test: fast/regions/hover-and-js-in-visual-overflow-hidden.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTestFlowThreadIfRegion):

LayoutTests:

Add a test that verifies you can't hover an element flowed inside a region but found inside
the hidden overflow of the region.

* fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html: Added.
* fast/regions/hover-and-js-in-visual-overflow-hidden.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastregionshoverandjsinvisualoverflowhiddenexpectedhtml">trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionshoverandjsinvisualoverflowhiddenhtml">trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (162063 => 162064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-15 10:28:52 UTC (rev 162063)
+++ trunk/LayoutTests/ChangeLog        2014-01-15 10:30:17 UTC (rev 162064)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-01-15  Andrei Bucur  &lt;abucur@adobe.com&gt;
+
+        [CSS Regions] Hit-testing goes through clipped layer in fast/regions/overflow-first-and-last-regions-in-container-hidden.html
+        https://bugs.webkit.org/show_bug.cgi?id=126886
+
+        Reviewed by Mihnea Ovidenie.
+
+        Add a test that verifies you can't hover an element flowed inside a region but found inside
+        the hidden overflow of the region.
+
+        * fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html: Added.
+        * fast/regions/hover-and-js-in-visual-overflow-hidden.html: Added.
+
</ins><span class="cx"> 2014-01-15  László Langó  &lt;llango.u-szeged@partner.samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DocumentFragment should be constructable.
</span></span></pre></div>
<a id="trunkLayoutTestsfastregionshoverandjsinvisualoverflowhiddenexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html (0 => 162064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden-expected.html        2014-01-15 10:30:17 UTC (rev 162064)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;style&gt;
+    body, p, ol {
+        margin: 0;
+        padding: 0;
+    }
+    input {
+        width: 100px;
+    }
+    #content {
+        font-family: monospace;
+        font-size: 20px;
+        line-height: 1em;
+    }
+    .spacer {
+        width: 100%;
+        height: 80px;
+        display: block;
+    }
+    .highlite {
+        background-color: green;
+        color: white;
+    }
+    #region {
+        border: 2px solid black;
+        background-color: lightgray;
+        width: 100px;
+        height: 100px;
+    }
+    #parent {
+        float: left;
+        overflow: hidden;
+    }
+    #region p {
+        background-color: red;
+        width: 100%;
+        height: 50%;
+    }
+    #result {
+        color: green;
+        font-weight: bold;
+    }
+    ol {
+        list-style:none;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div id=&quot;parent&quot;&gt;
+        &lt;div id=&quot;region&quot;&gt;
+            &lt;div id=&quot;content&quot;&gt;&lt;span class=&quot;spacer&quot;&gt;&lt;/span&gt;This text has &lt;span class=&quot;highlite&quot;&gt;overflow&lt;/span&gt;&lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;ol&gt;
+        &lt;li&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=126886&quot;&gt;126886&lt;/a&gt;.&lt;/li&gt;
+        &lt;li&gt;You should not see any red before or during this test.&lt;/li&gt;
+        &lt;li&gt;Move the mouse below the gray rectangle.&lt;/li&gt;
+        &lt;li&gt;You should see the word &quot;PASS&quot; displayed below, in green, wherever you position the mouse cursor.&lt;/li&gt;
+    &lt;/ol&gt;
+    
+    &lt;div id=&quot;result&quot;&gt;PASS&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionshoverandjsinvisualoverflowhiddenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden.html (0 => 162064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-and-js-in-visual-overflow-hidden.html        2014-01-15 10:30:17 UTC (rev 162064)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;style&gt;
+    body, p, ol {
+        margin: 0;
+        padding: 0;
+    }
+    input {
+        width: 100px;
+    }
+    #content {
+        font-family: monospace;
+        font-size: 20px;
+        line-height: 1em;
+        -webkit-flow-into: f;
+    }
+    .spacer {
+        width: 100%;
+        height: 80px;
+        display: block;
+    }
+    .highlite {
+        color: deepskyblue;
+    }
+    .highlite:hover {
+        background-color: green;
+        color: white;
+    }
+    #region {
+        border: 2px solid black;
+        background-color: lightgray;
+        width: 100px;
+        height: 100px;
+        -webkit-flow-from: f;
+    }
+    #parent {
+        float: left;
+        overflow: hidden;
+    }
+    #region p {
+        background-color: red;
+        width: 100%;
+        height: 50%;
+    }
+    #result {
+        color: green;
+        font-weight: bold;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function beginTest() {
+        if (window.eventSender) {
+            var obj  = document.querySelector(&quot;.highlite&quot;);
+
+            // move mouse on the hover test object
+            eventSender.mouseMoveTo(obj.offsetLeft + 5, obj.offsetTop + 5);
+            eventSender.mouseDown(0);
+
+            testRunner.notifyDone();
+        }
+    }
+&lt;/script&gt;
+
+&lt;body onload=&quot;beginTest()&quot;&gt;
+    &lt;div id=&quot;parent&quot;&gt;
+        &lt;div id=&quot;region&quot;&gt;
+            &lt;p&gt;&lt;/p&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;ol&gt;
+        &lt;li&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=126886&quot;&gt;126886&lt;/a&gt;.&lt;/li&gt;
+        &lt;li&gt;You should not see any red before or during this test.&lt;/li&gt;
+        &lt;li&gt;Move the mouse below the gray rectangle.&lt;/li&gt;
+        &lt;li&gt;You should see the word &quot;PASS&quot; displayed below, in green, wherever you position the mouse cursor.&lt;/li&gt;
+    &lt;/ol&gt;
+    &lt;div id=&quot;content&quot;&gt;&lt;span class=&quot;spacer&quot;&gt;&lt;/span&gt;This text has &lt;span class=&quot;highlite&quot;&gt;overflow&lt;/span&gt;&lt;/div&gt;
+    &lt;div id=&quot;result&quot;&gt;PASS&lt;/div&gt;
+    &lt;script&gt;
+        var word = document.querySelector(&quot;.highlite&quot;);
+        word.addEventListener(&quot;mouseover&quot;, function(evt) 
+        {
+            document.getElementById(&quot;result&quot;).style.color = &quot;red&quot;;
+            document.getElementById(&quot;result&quot;).innerHTML = &quot;FAIL&quot;;
+        });
+    &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162063 => 162064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-15 10:28:52 UTC (rev 162063)
+++ trunk/Source/WebCore/ChangeLog        2014-01-15 10:30:17 UTC (rev 162064)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-01-15  Andrei Bucur  &lt;abucur@adobe.com&gt;
+
+        [CSS Regions] Hit-testing goes through clipped layer in fast/regions/overflow-first-and-last-regions-in-container-hidden.html
+        https://bugs.webkit.org/show_bug.cgi?id=126886
+
+        Reviewed by Mihnea Ovidenie.
+
+        Currently, when hit testing a location inside a flow thread we ignore the clipping rectangle of
+        the region. This leads to false positives when the location is over the clipped out content of a
+        flow thread. The patch verifies that the location is inside the clipping rectangle of the region before
+        forwarding the hit test verification to the flow thread layer.
+
+        Test: fast/regions/hover-and-js-in-visual-overflow-hidden.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::hitTestFlowThreadIfRegion):
+
</ins><span class="cx"> 2014-01-15  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Suspend resource requests during computedStyle
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (162063 => 162064)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-15 10:28:52 UTC (rev 162063)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-15 10:30:17 UTC (rev 162064)
</span><span class="lines">@@ -7007,6 +7007,14 @@
</span><span class="cx"> 
</span><span class="cx">     RenderFlowThread* flowThread = region-&gt;flowThread();
</span><span class="cx"> 
</span><ins>+    // If the hit location is inside a clipped out area, don't forward the hit test to the flow thread.
+    if (rootLayer != this &amp;&amp; parent()) {
+        ClipRectsContext clipRectsContext(rootLayer, hitTestLocation.region(), TemporaryClipRects);
+        ClipRect clipRect = backgroundClipRect(clipRectsContext);
+        if (!clipRect.intersects(hitTestLocation))
+            return 0;
+    }
+
</ins><span class="cx">     LayoutPoint regionOffsetFromRoot;
</span><span class="cx">     convertToLayerCoords(rootLayer, regionOffsetFromRoot);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>