<!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>[167817] 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/167817">167817</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2014-04-25 13:20:48 -0700 (Fri, 25 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[New Multicolumn] fast/multicol/hit-test-* layout tests all fail
https://bugs.webkit.org/show_bug.cgi?id=132081
Reviewed by Dean Jackson.
Source/WebCore:
Added a bunch of tests in fast/multicol/newmulticol/compare-with-old-impl/hit-test-*.html
* rendering/RenderBlock.h:
Make offsetForContents public, since I need to call it from RenderMultiColumnSet.
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
Stop an ASSERT in the new columns code on the hit tests by making sure layout state is
disabled when moving children around.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::positionForPoint):
Refactor this function to call a helper function instead, translateRegionPointToFlowThread.
(WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread):
This function is logical (unlike the mistaken physical function I first implemented in
positionForPoint).
(WebCore::RenderMultiColumnSet::updateHitTestResult):
* rendering/RenderMultiColumnSet.h:
Overridden to fill in the correct local coordinate when the HTML document is inside a paginated
RenderView. Note that column spans don't actually work, but once we move over to a
non-column based pagination API, that will become irrelevant.
LayoutTests:
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.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="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnFlowThreadcpp">trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnSetcpp">trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnSeth">trunk/Source/WebCore/rendering/RenderMultiColumnSet.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestaboveorbelowexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestaboveorbelowhtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestblockaxisflippedexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestblockaxisflippedhtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnwithlineheightexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnwithlineheighthtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnhtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestfloatexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestfloathtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesflippedexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesflippedhtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpageshtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapblockaxisexpectedtxt">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapblockaxishtml">trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/LayoutTests/ChangeLog        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-04-25 David Hyatt <hyatt@apple.com>
+
+ [New Multicolumn] fast/multicol/hit-test-* layout tests all fail
+ https://bugs.webkit.org/show_bug.cgi?id=132081
+
+ Reviewed by Dean Jackson.
+
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html: Added.
+
</ins><span class="cx"> 2014-04-25 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r167799): ASSERTION in parseGridTemplateShorthand in fast/css-grid-layout/grid-template-shorthand-get-set.html
</span></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestaboveorbelowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+123
+abc
+def
+ghi
+jkl
+mno
+Character at 150, 25 is 1 as expected.
+Character at 350, 25 is d as expected.
+Character at 550, 25 is j as expected.
+Character at 750, 25 is m as expected.
+Character at 150, 275 is d as expected.
+Character at 350, 275 is j as expected.
+Character at 550, 275 is m as expected.
+Character at 750, 275 is null as expected.
+Character at 150, 475 is d as expected.
+Character at 350, 475 is j as expected.
+Character at 550, 475 is m as expected.
+Character at 750, 475 is null as expected.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestaboveorbelowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<body style="margin: 0">
+<div style="margin: 50px; background-color: lightblue; width: 800px; height: 200px; -webkit-column-width:185px; -webkit-column-gap:15px; -webkit-column-fill:auto; column-width:185px; column-gap:15px; column-fill:auto; font-family: Ahem; font-size: 50px; line-height: 1;">
+ 123<div style="background-color: blue; height: 70px;"></div>abc<br>def<div style="background-color: blue; height: 60px;"></div>ghi<br>jkl<div style="background-color: blue; height: 110px;"></div>mno</div>
+<pre id="console" style="display: none;"></pre>
+<script>
+ function characterAtPoint(x, y)
+ {
+ var range = document.caretRangeFromPoint(x, y);
+ if (range.startContainer.nodeType !== Node.TEXT_NODE)
+ return null;
+ if (range.startOffset >= range.startContainer.length)
+ return null;
+ return range.startContainer.data[range.startOffset];
+ }
+
+ function log(message)
+ {
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
+ }
+
+ function test(x, y, character)
+ {
+ var actualCharacter = characterAtPoint(x, y);
+ if (character === actualCharacter)
+ log ("Character at " + x + ", " + y + " is " + character + " as expected.");
+ else
+ log ("FAIL: Character at " + x + ", " + y + " is " + actualCharacter + ". Expected " + character + ".");
+ }
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ test(150, 25, "1");
+ test(350, 25, "d");
+ test(550, 25, "j");
+ test(750, 25, "m");
+
+ test(150, 275, "d");
+ test(350, 275, "j");
+ test(550, 275, "m");
+ test(750, 275, null);
+
+ test(150, 475, "d");
+ test(350, 475, "j");
+ test(550, 475, "m");
+ test(750, 475, null);
+
+ document.getElementById("console").style.display = "block";
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestblockaxisflippedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestblockaxisflippedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<div style="-webkit-writing-mode: horizontal-bt;">
+ <div style="
+ margin-top: 300px;
+ outline: dashed lightblue;
+ height: 100px;
+ width: 100px;
+ border-bottom: 25px solid;
+ -webkit-column-axis: vertical;
+ -webkit-column-gap: 50px;
+ ">
+ <div style="height: 100px; background-color: silver;"></div>
+ <div id="target" style="height: 100px; background-color: silver;"></div>
+ <div style="height: 100px; background-color: silver;"></div>
+ </div>
+</div>
+<p id="result">FAIL: Test did not run.</p>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var hitContainer = document.caretRangeFromPoint(208, 208).startContainer;
+ var target = document.getElementById("target");
+ document.getElementById("result").innerText = hitContainer === target ? "PASS" : "FAIL";
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+Lorem ipsum dolor sit amet consectetur elit.
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnwithlineheightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Lorem ipsum dolor sit amet
+PASS
+PASS
+PASS
+PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnwithlineheighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<style>
+#foo:hover { color:red }
+</style>
+<div id="target" style="
+ outline: dashed lightblue;
+ -webkit-columns: 2;
+ -webkit-column-gap: 0;
+ -webkit-column-fill: auto;
+ columns: 2;
+ column-gap: 0;
+ column-fill: auto;
+ width: 400px;
+ height: 80px;
+ font: 20px ahem;
+ line-height: 2;
+">Lorem ipsum dolor sit <span id="foo">amet</span></div>
+<pre id="console"></pre>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function log(message)
+ {
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
+ }
+
+ // Clicking below the last line in the first column should not select anything from the first
+ // line on the second column.
+ var target = document.getElementById("target");
+ var hitOffset = document.caretRangeFromPoint(target.offsetLeft + 190, target.offsetTop + 77).startOffset;
+ log(hitOffset === 11 ? "PASS" : "FAIL: hit offset " + hitOffset + ".");
+
+ // Clicking above the first line in the second column should not snap to the beginning of the line.
+ hitOffset = document.caretRangeFromPoint(target.offsetLeft + 250, target.offsetTop + 2).startOffset;
+ log(hitOffset === 14 ? "PASS" : "FAIL: hit offset " + hitOffset + ".");
+
+ // Now test with a flipped lines writing mode.
+ target.style.webkitWritingMode = "horizontal-bt";
+
+ // Clicking above the last line in the first column should not select anything from the first
+ // line on the second column.
+ hitOffset = document.caretRangeFromPoint(target.offsetLeft + 190, target.offsetTop + 3).startOffset;
+ log(hitOffset === 11 ? "PASS" : "FAIL: hit offset " + hitOffset + ".");
+
+ // Clicking below the first line in the second column should not snap to the beginning of the line.
+ hitOffset = document.caretRangeFromPoint(target.offsetLeft + 250, target.offsetTop + 78).startOffset;
+ log(hitOffset === 14 ? "PASS" : "FAIL: hit offset " + hitOffset + ".");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestendofcolumnhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<div id="target" style="
+ outline: dashed lightblue;
+ width: 400px;
+ -webkit-columns: 2;
+ -webkit-column-gap: 0;
+ -webkit-column-fill: auto;
+ columns: 2;
+ column-gap: 0;
+ column-fill: auto;
+ height: 90px;
+ font: 20px ahem;
+">Lorem ipsum dolor sit amet consectetur elit.</div>
+<p id="result">
+ FAIL: Test did not run.
+</p>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ // Clicking below the last line in the first column should not select anything from the first
+ // line on the second column.
+ var target = document.getElementById("target");
+ var hitOffset = document.caretRangeFromPoint(target.offsetLeft + 45, target.offsetTop + 87).startOffset;
+ document.getElementById("result").innerText = hitOffset === 26 || hitOffset === 24 ? "PASS" : "FAIL: hit offset " + hitOffset + ".";
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestfloatexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Test for https://bugs.webkit.org/show_bug.cgi?id=44730 Floats inside of multicol fail to hit test.
+
+The red square should turn green when hovered.
+
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestfloathtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script><style>
+ #target { width: 50px; height: 50px; background-color: red; margin: 10px; }
+ #target:hover { background-color: green; }
+</style>
+<p>
+ Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=44730">https://bugs.webkit.org/show_bug.cgi?id=44730</a>
+ Floats inside of multicol fail to hit test</i>.
+</p>
+<p>
+ The red square should turn green when hovered.
+</p>
+<div style="-webkit-columns:2; -webkit-column-fill:auto; columns:2; column-fill:auto; margin: 100; width: 300; height: 200; outline: solid black;">
+ <div>
+ <div style="height: 250px; background-color: purple;"></div>
+ <div style="float: right; background-color: lightyellow; margin: 5px;">
+ <div id="target"></div>
+ </div>
+ </div>
+</div>
+<div id="result">FAIL: Test did not run.</div>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var result = document.getElementById("result");
+ var hitElement = document.elementFromPoint(370, 250);
+ if (hitElement === document.getElementById("target"))
+ result.innerText = "PASS";
+ else
+ result.innerText = "FAIL: Hit " + hitElement;
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesflippedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpagesflippedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<html>
+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+ <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.testRunner) {
+ testRunner.dumpAsText();
+ internals.setPagination("LeftToRightPaginated", 20, 100);
+ document.getElementById("result").innerText = document.caretRangeFromPoint(115, 550).startContainer === document.getElementById("target")
+ ? "PASS" : "FAIL";
+ }
+ </script>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapbetweenpageshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<html>
+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+ <body style="margin: 0;">
+ <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.testRunner) {
+ testRunner.dumpAsText();
+ internals.setPagination("LeftToRightPaginated", 20, 100);
+ document.getElementById("result").innerText = document.caretRangeFromPoint(115, 50).startContainer === document.getElementById("target")
+ ? "PASS" : "FAIL";
+ }
+ </script>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapblockaxisexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS
+
+Lorem ipsum dolor sit amet consectetur elit.
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolnewmulticolcomparewitholdimplhittestgapblockaxishtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html (0 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html         (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+
+<p id="result">
+ FAIL: Test did not run.
+</p>
+<div id="target" style="
+ outline: dashed lightblue;
+ width: 200px;
+ -webkit-column-axis: vertical;
+ -webkit-column-gap: 100px;
+ height: 90px;
+ font: 20px ahem;
+ color: rgba(0, 0, 0, 0.5);
+">Lorem ipsum dolor sit amet consectetur elit.</div>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ // Clicking in the gap after the first column should not select anything from the second column.
+ var target = document.getElementById("target");
+ var hitOffset = document.caretRangeFromPoint(target.offsetLeft + 45, target.offsetTop + 115).startOffset;
+ document.getElementById("result").innerText = hitOffset === 26 || hitOffset === 24 ? "PASS" : "FAIL: hit offset " + hitOffset + ".";
+</script>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/Source/WebCore/ChangeLog        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-04-25 David Hyatt <hyatt@apple.com>
+
+ [New Multicolumn] fast/multicol/hit-test-* layout tests all fail
+ https://bugs.webkit.org/show_bug.cgi?id=132081
+
+ Reviewed by Dean Jackson.
+
+ Added a bunch of tests in fast/multicol/newmulticol/compare-with-old-impl/hit-test-*.html
+
+ * rendering/RenderBlock.h:
+ Make offsetForContents public, since I need to call it from RenderMultiColumnSet.
+
+ * rendering/RenderMultiColumnFlowThread.cpp:
+ (WebCore::RenderMultiColumnFlowThread::populate):
+ Stop an ASSERT in the new columns code on the hit tests by making sure layout state is
+ disabled when moving children around.
+
+ * rendering/RenderMultiColumnSet.cpp:
+ (WebCore::RenderMultiColumnSet::positionForPoint):
+ Refactor this function to call a helper function instead, translateRegionPointToFlowThread.
+
+ (WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread):
+ This function is logical (unlike the mistaken physical function I first implemented in
+ positionForPoint).
+
+ (WebCore::RenderMultiColumnSet::updateHitTestResult):
+ * rendering/RenderMultiColumnSet.h:
+ Overridden to fill in the correct local coordinate when the HTML document is inside a paginated
+ RenderView. Note that column spans don't actually work, but once we move over to a
+ non-column based pagination API, that will become irrelevant.
+
</ins><span class="cx"> 2014-04-25 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> Mark some things with WTF_MAKE_FAST_ALLOCATED.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -418,6 +418,9 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: Can devirtualize once old column code is gone.
</span><span class="cx"> virtual void computeLineGridPaginationOrigin(LayoutState&) const;
</span><ins>+
+ // Adjust from painting offsets to the local coords of this renderer
+ void offsetForContents(LayoutPoint&) const;
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> virtual void addOverflowFromChildren();
</span><span class="lines">@@ -568,9 +571,6 @@
</span><span class="cx"> virtual ColumnInfo::PaginationUnit paginationUnit() const;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- // Adjust from painting offsets to the local coords of this renderer
- void offsetForContents(LayoutPoint&) const;
-
</del><span class="cx"> virtual bool requiresColumns(int computedColumnCount) const;
</span><span class="cx">
</span><span class="cx"> bool updateLogicalWidthAndColumnWidth();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -155,6 +155,7 @@
</span><span class="cx"> // Reparent children preceding the flow thread into the flow thread. It's multicol content
</span><span class="cx"> // now. At this point there's obviously nothing after the flow thread, but renderers (column
</span><span class="cx"> // sets and spanners) will be inserted there as we insert elements into the flow thread.
</span><ins>+ LayoutStateDisabler layoutStateDisabler(&view());
</ins><span class="cx"> multicolContainer->moveChildrenTo(this, multicolContainer->firstChild(), this, true);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "RenderMultiColumnSet.h"
</span><span class="cx">
</span><span class="cx"> #include "FrameView.h"
</span><ins>+#include "HitTestResult.h"
</ins><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderMultiColumnFlowThread.h"
</span><span class="lines">@@ -869,101 +870,105 @@
</span><span class="cx"> addVisualOverflow(lastRect);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-VisiblePosition RenderMultiColumnSet::positionForPoint(const LayoutPoint& physicalPoint, const RenderRegion*)
</del><ins>+VisiblePosition RenderMultiColumnSet::positionForPoint(const LayoutPoint& logicalPoint, const RenderRegion*)
</ins><span class="cx"> {
</span><ins>+ return multiColumnFlowThread()->positionForPoint(translateRegionPointToFlowThread(logicalPoint, ClampHitTestTranslationToColumns), this);
+}
+
+LayoutPoint RenderMultiColumnSet::translateRegionPointToFlowThread(const LayoutPoint & logicalPoint, ColumnHitTestTranslationMode clampMode) const
+{
</ins><span class="cx"> // Determine which columns we intersect.
</span><span class="cx"> LayoutUnit colGap = columnGap();
</span><span class="cx"> LayoutUnit halfColGap = colGap / 2;
</span><del>- LayoutPoint columnPoint(columnRectAt(0).location());
- LayoutUnit logicalOffset = 0;
-
</del><ins>+
</ins><span class="cx"> bool progressionIsInline = multiColumnFlowThread()->progressionIsInline();
</span><span class="cx">
</span><del>- LayoutPoint point = physicalPoint;
</del><ins>+ LayoutPoint point = logicalPoint;
</ins><span class="cx">
</span><span class="cx"> for (unsigned i = 0; i < columnCount(); i++) {
</span><span class="cx"> // Add in half the column gap to the left and right of the rect.
</span><span class="cx"> LayoutRect colRect = columnRectAt(i);
</span><del>- flipForWritingMode(colRect);
</del><span class="cx"> if (isHorizontalWritingMode() == progressionIsInline) {
</span><span class="cx"> LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height());
</span><span class="cx"> if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) {
</span><del>- if (progressionIsInline) {
- // FIXME: The clamping that follows is not completely right for right-to-left
- // content.
- // Clamp everything above the column to its top left.
- if (point.y() < gapAndColumnRect.y())
- point = gapAndColumnRect.location();
- // Clamp everything below the column to the next column's top left. If there is
- // no next column, this still maps to just after this column.
- else if (point.y() >= gapAndColumnRect.maxY()) {
- point = gapAndColumnRect.location();
- point.move(0, gapAndColumnRect.height());
</del><ins>+ if (clampMode == ClampHitTestTranslationToColumns) {
+ if (progressionIsInline) {
+ // FIXME: The clamping that follows is not completely right for right-to-left
+ // content.
+ // Clamp everything above the column to its top left.
+ if (point.y() < gapAndColumnRect.y())
+ point = gapAndColumnRect.location();
+ // Clamp everything below the column to the next column's top left. If there is
+ // no next column, this still maps to just after this column.
+ else if (point.y() >= gapAndColumnRect.maxY()) {
+ point = gapAndColumnRect.location();
+ point.move(0, gapAndColumnRect.height());
+ }
+ } else {
+ if (point.x() < colRect.x())
+ point.setX(colRect.x());
+ else if (point.x() >= colRect.maxX())
+ point.setX(colRect.maxX() - 1);
</ins><span class="cx"> }
</span><del>- } else {
- if (point.x() < colRect.x())
- point.setX(colRect.x());
- else if (point.x() >= colRect.maxX())
- point.setX(colRect.maxX() - 1);
</del><span class="cx"> }
</span><del>-
- // We're inside the column. Translate the x and y into our column coordinate space.
- if (progressionIsInline)
- point.move(columnPoint.x() - colRect.x(), (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset));
- else
- point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0);
</del><span class="cx">
</span><del>- LayoutRect portion = flowThreadPortionRect();
- flipForWritingMode(portion);
- point.move(isHorizontalWritingMode() ? LayoutUnit() : portion.x(), isHorizontalWritingMode() ? portion.y() : LayoutUnit());
- return multiColumnFlowThread()->positionForPoint(point, this);
</del><ins>+ LayoutSize offsetInColumn = point - colRect.location();
+ LayoutRect flowThreadPortion = flowThreadPortionRectAt(i);
+
+ return flowThreadPortion.location() + offsetInColumn;
</ins><span class="cx"> }
</span><del>-
- // Move to the next position.
- logicalOffset += progressionIsInline ? colRect.height() : colRect.width();
</del><span class="cx"> } else {
</span><span class="cx"> LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap);
</span><span class="cx"> if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.maxY()) {
</span><del>- if (progressionIsInline) {
- // FIXME: The clamping that follows is not completely right for right-to-left
- // content.
- // Clamp everything above the column to its top left.
- if (point.x() < gapAndColumnRect.x())
- point = gapAndColumnRect.location();
- // Clamp everything below the column to the next column's top left. If there is
- // no next column, this still maps to just after this column.
- else if (point.x() >= gapAndColumnRect.maxX()) {
- point = gapAndColumnRect.location();
- point.move(gapAndColumnRect.width(), 0);
</del><ins>+ if (clampMode == ClampHitTestTranslationToColumns) {
+ if (progressionIsInline) {
+ // FIXME: The clamping that follows is not completely right for right-to-left
+ // content.
+ // Clamp everything above the column to its top left.
+ if (point.x() < gapAndColumnRect.x())
+ point = gapAndColumnRect.location();
+ // Clamp everything below the column to the next column's top left. If there is
+ // no next column, this still maps to just after this column.
+ else if (point.x() >= gapAndColumnRect.maxX()) {
+ point = gapAndColumnRect.location();
+ point.move(gapAndColumnRect.width(), 0);
+ }
+ } else {
+ if (point.y() < colRect.y())
+ point.setY(colRect.y());
+ else if (point.y() >= colRect.maxY())
+ point.setY(colRect.maxY() - 1);
</ins><span class="cx"> }
</span><del>- } else {
- if (point.y() < colRect.y())
- point.setY(colRect.y());
- else if (point.y() >= colRect.maxY())
- point.setY(colRect.maxY() - 1);
</del><span class="cx"> }
</span><del>-
- // We're inside the column. Translate the x and y into our column coordinate space.
- if (progressionIsInline)
- point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset), columnPoint.y() - colRect.y());
- else
- point.move(0, (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop());
</del><span class="cx">
</span><del>- LayoutRect portion = flowThreadPortionRect();
- flipForWritingMode(portion);
- point.move(isHorizontalWritingMode() ? LayoutUnit() : portion.x(), isHorizontalWritingMode() ? portion.y() : LayoutUnit());
-
- return multiColumnFlowThread()->positionForPoint(point, this);
</del><ins>+ LayoutSize offsetInColumn = point - colRect.location();
+ LayoutRect flowThreadPortion = flowThreadPortionRectAt(i);
+ return flowThreadPortion.location() + offsetInColumn;
</ins><span class="cx"> }
</span><del>-
- // Move to the next position.
- logicalOffset += progressionIsInline ? colRect.width() : colRect.height();
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return VisiblePosition();
</del><ins>+ return logicalPoint;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void RenderMultiColumnSet::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
+{
+ if (result.innerNode() || !parent()->isRenderView())
+ return;
+
+ // Note this does not work with column spans, but once we implement RenderPageSet, we can move this code
+ // over there instead (and spans of course won't be allowed on pages).
+ Node* node = document().documentElement();
+ if (node) {
+ result.setInnerNode(node);
+ if (!result.innerNonSharedNode())
+ result.setInnerNonSharedNode(node);
+ LayoutPoint adjustedPoint = translateRegionPointToFlowThread(point);
+ view().offsetForContents(adjustedPoint);
+ result.setLocalPoint(adjustedPoint);
+ }
+}
+
</ins><span class="cx"> const char* RenderMultiColumnSet::renderName() const
</span><span class="cx"> {
</span><span class="cx"> return "RenderMultiColumnSet";
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnSet.h (167816 => 167817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnSet.h        2014-04-25 19:45:06 UTC (rev 167816)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnSet.h        2014-04-25 20:20:48 UTC (rev 167817)
</span><span class="lines">@@ -119,6 +119,14 @@
</span><span class="cx">
</span><span class="cx"> void paintColumnRules(PaintInfo&, const LayoutPoint& paintOffset);
</span><span class="cx">
</span><ins>+ enum ColumnHitTestTranslationMode {
+ ClampHitTestTranslationToColumns,
+ DoNotClampHitTestTranslationToColumns
+ };
+ LayoutPoint translateRegionPointToFlowThread(const LayoutPoint & logicalPoint, ColumnHitTestTranslationMode = DoNotClampHitTestTranslationToColumns) const;
+
+ virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) override;
+
</ins><span class="cx"> protected:
</span><span class="cx"> void addOverflowFromChildren() override;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>