<!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>[167870] 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/167870">167870</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-04-27 21:19:10 -0700 (Sun, 27 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/159345">r159345</a>): The hover state for links in the top navigation of Yahoo.com doesn't work
https://bugs.webkit.org/show_bug.cgi?id=132241
rdar://problem/16501924
Reviewed by Andreas Kling.
Source/WebCore:
Test: fast/text/simple-lines-hover-underline.html
Checked that this does not hurt performance by running the
run-perf-tests PerformanceTests/Layout/line-layout.html command before and after.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::hitTestInlineChildren): Use simpleLineLayout function rather than
getting at the data member directly.
(WebCore::RenderBlockFlow::firstLineBaseline): Ditto.
(WebCore::RenderBlockFlow::inlineBlockBaseline): Ditto.
(WebCore::RenderBlockFlow::lineCount): Ditto.
(WebCore::RenderBlockFlow::paintInlineChildren): Ditto.
(WebCore::RenderBlockFlow::hasLines): Ditto.
(WebCore::RenderBlockFlow::simpleLineLayout): Added logic to determine which path to use if
m_lineLayoutPath is undetermined, and call createLineBoxes if it's not simple.
(WebCore::RenderBlockFlow::ensureLineBoxes): Factored out most of the code into a new
createLineBoxes function.
(WebCore::RenderBlockFlow::createLineBoxes): Ditto.
* rendering/RenderBlockFlow.h: Made simpleLineLayout function no longer an inline.
Added a private createLineBoxes function.
LayoutTests:
* fast/text/simple-lines-hover-underline-expected.html: Added.
* fast/text/simple-lines-hover-underline.html: Added.
* fast/text/simple-lines-hover.html: Removed an unneeded style element with a style rule that
does nothing.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelineshoverhtml">trunk/LayoutTests/fast/text/simple-lines-hover.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextsimplelineshoverunderlineexpectedhtml">trunk/LayoutTests/fast/text/simple-lines-hover-underline-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelineshoverunderlinehtml">trunk/LayoutTests/fast/text/simple-lines-hover-underline.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167869 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-28 04:07:29 UTC (rev 167869)
+++ trunk/LayoutTests/ChangeLog        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-04-27 Darin Adler <darin@apple.com>
+
+ REGRESSION (r159345): The hover state for links in the top navigation of Yahoo.com doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=132241
+ rdar://problem/16501924
+
+ Reviewed by Andreas Kling.
+
+ * fast/text/simple-lines-hover-underline-expected.html: Added.
+ * fast/text/simple-lines-hover-underline.html: Added.
+
+ * fast/text/simple-lines-hover.html: Removed an unneeded style element with a style rule that
+ does nothing.
+
</ins><span class="cx"> 2014-04-27 Praveen R Jadhav <praveen.j@samsung.com>
</span><span class="cx">
</span><span class="cx"> [MediaStream] .ended shouldn't be part of MediaStream IDL
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelineshoverunderlineexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-lines-hover-underline-expected.html (0 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-lines-hover-underline-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/text/simple-lines-hover-underline-expected.html        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+<style>
+a { display:inline-block; text-decoration:underline }
+</style>
+<p><a id="target" href="about:blank">This text should be underlined when we hover over it.</a></p>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/text/simple-lines-hover-underline-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfasttextsimplelineshoverunderlinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-lines-hover-underline.html (0 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-lines-hover-underline.html         (rev 0)
+++ trunk/LayoutTests/fast/text/simple-lines-hover-underline.html        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<style>
+a { display:inline-block; text-decoration:none }
+a:hover { text-decoration:underline }
+</style>
+<script>
+function test()
+{
+ var target = document.getElementById("target");
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+ if (window.eventSender)
+ eventSender.mouseMoveTo(target.offsetLeft + 10, target.offsetTop + 10);
+}
+function done()
+{
+ document.getElementById("repaintTrigger").style.display = "none";
+ document.offsetLeft;
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
+<body onload="test()">
+<p id="target"><a href="about:blank" onmouseenter="done()">This text should be underlined when we hover over it.</a><a id="repaintTrigger"> And this text will be removed automatically.</a></p>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/text/simple-lines-hover-underline.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfasttextsimplelineshoverhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/simple-lines-hover.html (167869 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-lines-hover.html        2014-04-28 04:07:29 UTC (rev 167869)
+++ trunk/LayoutTests/fast/text/simple-lines-hover.html        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -1,6 +1,3 @@
</span><del>-<style>
-#target { }
-</style>
</del><span class="cx"> <script>
</span><span class="cx"> function test() {
</span><span class="cx"> if (window.internals)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167869 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-28 04:07:29 UTC (rev 167869)
+++ trunk/Source/WebCore/ChangeLog        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2014-04-27 Darin Adler <darin@apple.com>
+
+ REGRESSION (r159345): The hover state for links in the top navigation of Yahoo.com doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=132241
+ rdar://problem/16501924
+
+ Reviewed by Andreas Kling.
+
+ Test: fast/text/simple-lines-hover-underline.html
+
+ Checked that this does not hurt performance by running the
+ run-perf-tests PerformanceTests/Layout/line-layout.html command before and after.
+
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::hitTestInlineChildren): Use simpleLineLayout function rather than
+ getting at the data member directly.
+ (WebCore::RenderBlockFlow::firstLineBaseline): Ditto.
+ (WebCore::RenderBlockFlow::inlineBlockBaseline): Ditto.
+ (WebCore::RenderBlockFlow::lineCount): Ditto.
+ (WebCore::RenderBlockFlow::paintInlineChildren): Ditto.
+ (WebCore::RenderBlockFlow::hasLines): Ditto.
+ (WebCore::RenderBlockFlow::simpleLineLayout): Added logic to determine which path to use if
+ m_lineLayoutPath is undetermined, and call createLineBoxes if it's not simple.
+ (WebCore::RenderBlockFlow::ensureLineBoxes): Factored out most of the code into a new
+ createLineBoxes function.
+ (WebCore::RenderBlockFlow::createLineBoxes): Ditto.
+
+ * rendering/RenderBlockFlow.h: Made simpleLineLayout function no longer an inline.
+ Added a private createLineBoxes function.
+
</ins><span class="cx"> 2014-04-27 Praveen R Jadhav <praveen.j@samsung.com>
</span><span class="cx">
</span><span class="cx"> [MediaStream] .ended shouldn't be part of MediaStream IDL
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (167869 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-04-28 04:07:29 UTC (rev 167869)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -2695,8 +2695,8 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(childrenInline());
</span><span class="cx">
</span><del>- if (m_simpleLineLayout)
- return SimpleLineLayout::hitTestFlow(*this, *m_simpleLineLayout, request, result, locationInContainer, accumulatedOffset, hitTestAction);
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout())
+ return SimpleLineLayout::hitTestFlow(*this, *simpleLineLayout, request, result, locationInContainer, accumulatedOffset, hitTestAction);
</ins><span class="cx">
</span><span class="cx"> return m_lineBoxes.hitTest(this, request, result, locationInContainer, accumulatedOffset, hitTestAction);
</span><span class="cx"> }
</span><span class="lines">@@ -2802,8 +2802,8 @@
</span><span class="cx"> if (!hasLines())
</span><span class="cx"> return -1;
</span><span class="cx">
</span><del>- if (m_simpleLineLayout)
- return SimpleLineLayout::computeFlowFirstLineBaseline(*this, *m_simpleLineLayout);
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout())
+ return SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout);
</ins><span class="cx">
</span><span class="cx"> ASSERT(firstRootBox());
</span><span class="cx"> return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().ascent(firstRootBox()->baselineType());
</span><span class="lines">@@ -2826,8 +2826,8 @@
</span><span class="cx"> + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (m_simpleLineLayout)
- return SimpleLineLayout::computeFlowLastLineBaseline(*this, *m_simpleLineLayout);
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout())
+ return SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout);
</ins><span class="cx">
</span><span class="cx"> bool isFirstLine = lastRootBox() == firstRootBox();
</span><span class="cx"> const RenderStyle& style = isFirstLine ? firstLineStyle() : this->style();
</span><span class="lines">@@ -2983,9 +2983,9 @@
</span><span class="cx"> int count = 0;
</span><span class="cx">
</span><span class="cx"> if (childrenInline()) {
</span><del>- if (m_simpleLineLayout) {
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout()) {
</ins><span class="cx"> ASSERT(!stopRootInlineBox);
</span><del>- return m_simpleLineLayout->lineCount();
</del><ins>+ return simpleLineLayout->lineCount();
</ins><span class="cx"> }
</span><span class="cx"> for (auto box = firstRootBox(); box; box = box->nextRootBox()) {
</span><span class="cx"> count++;
</span><span class="lines">@@ -3212,8 +3212,8 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(childrenInline());
</span><span class="cx">
</span><del>- if (m_simpleLineLayout) {
- SimpleLineLayout::paintFlow(*this, *m_simpleLineLayout, paintInfo, paintOffset);
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout()) {
+ SimpleLineLayout::paintFlow(*this, *simpleLineLayout, paintInfo, paintOffset);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> m_lineBoxes.paint(this, paintInfo, paintOffset);
</span><span class="lines">@@ -3319,8 +3319,8 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(childrenInline());
</span><span class="cx">
</span><del>- if (m_simpleLineLayout)
- return m_simpleLineLayout->lineCount();
</del><ins>+ if (auto simpleLineLayout = this->simpleLineLayout())
+ return simpleLineLayout->lineCount();
</ins><span class="cx">
</span><span class="cx"> return lineBoxes().firstLineBox();
</span><span class="cx"> }
</span><span class="lines">@@ -3347,10 +3347,28 @@
</span><span class="cx"> toRenderText(firstChild())->deleteLineBoxesBeforeSimpleLineLayout();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+const SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout() const
+{
+ if (m_lineLayoutPath == UndeterminedPath)
+ const_cast<RenderBlockFlow&>(*this).m_lineLayoutPath = SimpleLineLayout::canUseFor(*this) ? SimpleLinesPath : LineBoxesPath;
+
+ if (m_lineLayoutPath == SimpleLinesPath)
+ return m_simpleLineLayout.get();
+
+ const_cast<RenderBlockFlow&>(*this).createLineBoxes();
+ return nullptr;
+}
+
</ins><span class="cx"> void RenderBlockFlow::ensureLineBoxes()
</span><span class="cx"> {
</span><span class="cx"> m_lineLayoutPath = ForceLineBoxesPath;
</span><ins>+ createLineBoxes();
+}
</ins><span class="cx">
</span><ins>+void RenderBlockFlow::createLineBoxes()
+{
+ ASSERT(m_lineLayoutPath == LineBoxesPath || m_lineLayoutPath == ForceLineBoxesPath);
+
</ins><span class="cx"> if (!m_simpleLineLayout)
</span><span class="cx"> return;
</span><span class="cx"> m_simpleLineLayout = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (167869 => 167870)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-04-28 04:07:29 UTC (rev 167869)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-04-28 04:19:10 UTC (rev 167870)
</span><span class="lines">@@ -357,7 +357,7 @@
</span><span class="cx">
</span><span class="cx"> bool containsNonZeroBidiLevel() const;
</span><span class="cx">
</span><del>- const SimpleLineLayout::Layout* simpleLineLayout() const { return m_simpleLineLayout.get(); }
</del><ins>+ const SimpleLineLayout::Layout* simpleLineLayout() const;
</ins><span class="cx"> void deleteLineBoxesBeforeSimpleLineLayout();
</span><span class="cx"> void ensureLineBoxes();
</span><span class="cx">
</span><span class="lines">@@ -513,6 +513,8 @@
</span><span class="cx"> virtual VisiblePosition positionForPointWithInlineChildren(const LayoutPoint& pointInLogicalContents, const RenderRegion*) override;
</span><span class="cx"> virtual void addFocusRingRectsForInlineChildren(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject*) override;
</span><span class="cx">
</span><ins>+ void createLineBoxes();
+
</ins><span class="cx"> // FIXME-BLOCKFLOW: These methods have implementations in
</span><span class="cx"> // RenderBlockLineLayout. They should be moved to the proper header once the
</span><span class="cx"> // line layout code is separated from RenderBlock and RenderBlockFlow.
</span></span></pre>
</div>
</div>
</body>
</html>