<!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>[180419] branches/safari-600.5-branch</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/180419">180419</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2015-02-20 10:03:39 -0800 (Fri, 20 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/180150">r180150</a>. <rdar://19894685></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6005branchLayoutTestsChangeLog">branches/safari-600.5-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6005branchSourceWebCoreChangeLog">branches/safari-600.5-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingInlineFlowBoxcpp">branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingInlineFlowBoxh">branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.h</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingInlineTextBoxcpp">branches/safari-600.5-branch/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRenderElementcpp">branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRenderElementh">branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRenderObjectcpp">branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRenderObjecth">branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRootInlineBoxcpp">branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorerenderingRootInlineBoxh">branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.h</a></li>
<li><a href="#branchessafari6005branchSourceWebCorestyleInlineTextBoxStylecpp">branches/safari-600.5-branch/Source/WebCore/style/InlineTextBoxStyle.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinefirstlinedecorationexpectedhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinefirstlinedecorationhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinepositionmixedfontsexpectedhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinepositionmixedfontshtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinepositionsubscriptexpectedhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlinepositionsubscripthtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlineverticalfirstlinedecorationexpectedhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html</a></li>
<li><a href="#branchessafari6005branchLayoutTestsfasttexttextunderlineverticalfirstlinedecorationhtml">branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6005branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/LayoutTests/ChangeLog (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/ChangeLog        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/LayoutTests/ChangeLog        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-02-20 Dana Burkart <dburkart@apple.com>
+
+ Merged r180150. <rdar://problem/19894685>
+
+ 2015-02-12 David Hyatt <hyatt@apple.com>
+
+ text-underline-position:under has multiple correctness issues
+ https://bugs.webkit.org/show_bug.cgi?id=141528
+
+ Reviewed by Dean Jackson.
+
+ * fast/text/text-underline-first-line-decoration-expected.html: Added.
+ * fast/text/text-underline-first-line-decoration.html: Added.
+ * fast/text/text-underline-position-mixed-fonts-expected.html: Added.
+ * fast/text/text-underline-position-mixed-fonts.html: Added.
+ * fast/text/text-underline-position-subscript-expected.html: Added.
+ * fast/text/text-underline-position-subscript.html: Added.
+ * fast/text/text-underline-vertical-first-line-decoration-expected.html: Added.
+ * fast/text/text-underline-vertical-first-line-decoration.html: Added.
+
</ins><span class="cx"> 2015-02-19 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merged r180128. <rdar://problem/19850739>
</span></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinefirstlinedecorationexpectedhtmlfromrev180150trunkLayoutTestsfasttexttextunderlinefirstlinedecorationexpectedhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinefirstlinedecorationhtmlfromrev180150trunkLayoutTestsfasttexttextunderlinefirstlinedecorationhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-first-line-decoration.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.decorate::first-line { text-decoration:underline }
+</style>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinepositionmixedfontsexpectedhtmlfromrev180150trunkLayoutTestsfasttexttextunderlinepositionmixedfontsexpectedhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<body style="overflow:hidden">
+<p>Test to make sure gigantic fonts that aren't inside the text decoration don't affect the position of
+the line. The giant font is invisible (color:transparent) in this test.
+</p>
+
+<span style="text-decoration:underline;-webkit-text-underline-position:under">This text should be underlined just under the descenders.</span>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinepositionmixedfontshtmlfromrev180150trunkLayoutTestsfasttexttextunderlinepositionmixedfontshtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-mixed-fonts.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<body style="overflow:hidden">
+<p>Test to make sure gigantic fonts that aren't inside the text decoration don't affect the position of
+the line. The giant font is invisible (color:transparent) in this test.
+</p>
+
+<span style="text-decoration:underline;-webkit-text-underline-position:under">This text should be underlined just under the descenders.</span> <span style="font-size:64px; vertical-align:-256px; color:transparent">Should not be underlined.</span>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinepositionsubscriptexpectedhtmlfromrev180150trunkLayoutTestsfasttexttextunderlinepositionsubscriptexpectedhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-subscript-expected.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.yellow::first-line { color:grey }
+</style>
+</head>
+<body>
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="yellow" style="font-size:40px; padding-top:5px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange"><span style="position:relative;">Here is the subscript for this line.</span>
+</p>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlinepositionsubscripthtmlfromrev180150trunkLayoutTestsfasttexttextunderlinepositionsubscripthtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-subscript.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-position-subscript.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.yellow::first-line { color:grey }
+</style>
+</head>
+<body>
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="yellow" style="font-size:40px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange"><span style="vertical-align:-5px;">Here is the subscript for this line.</span>
+</p>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlineverticalfirstlinedecorationexpectedhtmlfromrev180150trunkLayoutTestsfasttexttextunderlineverticalfirstlinedecorationexpectedhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>
</ins></span></pre></div>
<a id="branchessafari6005branchLayoutTestsfasttexttextunderlineverticalfirstlinedecorationhtmlfromrev180150trunkLayoutTestsfasttexttextunderlineverticalfirstlinedecorationhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html) (0 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html         (rev 0)
+++ branches/safari-600.5-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.decorate::first-line { text-decoration:underline }
+</style>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/ChangeLog        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -1,5 +1,54 @@
</span><span class="cx"> 2015-02-20 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merged r180150. <rdar://problem/19894685>
+
+ 2015-02-12 David Hyatt <hyatt@apple.com>
+
+ text-underline-position:under has multiple correctness issues
+ https://bugs.webkit.org/show_bug.cgi?id=141528
+
+ Reviewed by Dean Jackson.
+
+ Added a bunch of new tests in fast/text
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine):
+ (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine):
+ (WebCore::InlineFlowBox::computeMaxLogicalBottom): Deleted.
+ * rendering/InlineFlowBox.h:
+ These functions have been re-written to take an enclosing renderer that specified the
+ decoration. This way they can properly limit the bottom/top computation to only line boxes
+ that are contained inside the renderer.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintDecoration):
+ Tweak the call to get the decoration colors now that quirks mode has been removed.
+
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::enclosingRendererWithTextDecoration):
+ * rendering/RenderElement.h:
+ New function that finds the enclosing renderer that specified a text decoration. For now
+ this is only used in the "under" position computation, but soon we'll be using it
+ everywhere.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::getTextDecorationColors):
+ * rendering/RenderObject.h:
+ Remove the quirks mode argument, since we were always passing true anyway (making the argument dead).
+
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::maxLogicalBottom): Deleted.
+ * rendering/RootInlineBox.h:
+ Get rid of these functions and just have InlineTextBoxStyle's computeUnderLineOffset function call
+ the InlineFlowBox functions directly.
+
+ * style/InlineTextBoxStyle.cpp:
+ (WebCore::computeUnderlineOffset):
+ Re-written to fetch the enclosingRendererWithTextDecoration so that it can be passed to the logical top/bottom
+ computation to limit which line boxes get included.
+
+2015-02-20 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merged r180147. <rdar://problem/19850657>
</span><span class="cx">
</span><span class="cx"> 2015-02-16 Brent Fulgham <bfulgham@apple.com>
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -750,18 +750,45 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InlineFlowBox::computeMaxLogicalBottom(float& maxLogicalBottom) const
</del><ins>+void InlineFlowBox::maxLogicalBottomForTextDecorationLine(float& maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
</ins><span class="cx"> {
</span><del>- for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
- if (curr->renderer().isOutOfFlowPositioned())
</del><ins>+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+ if (child->renderer().isOutOfFlowPositioned())
</ins><span class="cx"> continue; // Positioned placeholders don't affect calculations.
</span><ins>+
+ if (!(child->lineStyle().textDecorationsInEffect() & textDecoration))
+ continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+
+ if (decorationRenderer && decorationRenderer->isRenderInline() && !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &child->renderer()))
+ continue;
+
+ if (child->isInlineFlowBox())
+ toInlineFlowBox(child)->maxLogicalBottomForTextDecorationLine(maxLogicalBottom, decorationRenderer, textDecoration);
+ else {
+ if (child->isInlineTextBox() || child->lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+ maxLogicalBottom = std::max<float>(maxLogicalBottom, child->logicalBottom());
+ }
+ }
+}
</ins><span class="cx">
</span><del>- if (descendantsHaveSameLineHeightAndBaseline())
</del><ins>+void InlineFlowBox::minLogicalTopForTextDecorationLine(float& minLogicalTop, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
+{
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+ if (child->renderer().isOutOfFlowPositioned())
+ continue; // Positioned placeholders don't affect calculations.
+
+ if (!(child->lineStyle().textDecorationsInEffect() & textDecoration))
+ continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+
+ if (decorationRenderer && decorationRenderer->isRenderInline() && !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &child->renderer()))
</ins><span class="cx"> continue;
</span><del>-
- maxLogicalBottom = std::max<float>(maxLogicalBottom, curr->logicalBottom());
- if (curr->isInlineFlowBox())
- toInlineFlowBox(curr)->computeMaxLogicalBottom(maxLogicalBottom);
</del><ins>+
+ if (child->isInlineFlowBox())
+ toInlineFlowBox(child)->minLogicalTopForTextDecorationLine(minLogicalTop, decorationRenderer, textDecoration);
+ else {
+ if (child->isInlineTextBox() || child->lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+ minLogicalTop = std::min<float>(minLogicalTop, child->logicalTop());
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingInlineFlowBoxh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.h (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.h        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/InlineFlowBox.h        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -293,6 +293,10 @@
</span><span class="cx">
</span><span class="cx"> void computeReplacedAndTextLineTopAndBottom(LayoutUnit& lineTop, LayoutUnit& lineBottom) const;
</span><span class="cx">
</span><ins>+ // Used to calculate the underline offset for TextUnderlinePositionUnder.
+ void maxLogicalBottomForTextDecorationLine(float& maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration) const;
+ void minLogicalTopForTextDecorationLine(float& minLogicalTop, const RenderElement* decorationRenderer, TextDecoration) const;
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual bool isInlineFlowBox() const override final { return true; }
</span><span class="cx"> void boxModelObject() const = delete;
</span><span class="lines">@@ -312,9 +316,6 @@
</span><span class="cx"> InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
</span><span class="cx"> InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
</span><span class="cx">
</span><del>- // Maximum logicalBottom among all children of an InlineFlowBox. Used to
- // calculate the offset for TextUnderlinePositionUnder.
- void computeMaxLogicalBottom(float& maxLogicalBottom) const;
</del><span class="cx"> private:
</span><span class="cx"> unsigned m_includeLogicalLeftEdge : 1;
</span><span class="cx"> unsigned m_includeLogicalRightEdge : 1;
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/InlineTextBox.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/InlineTextBox.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/InlineTextBox.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -946,9 +946,9 @@
</span><span class="cx">
</span><span class="cx"> // Get the text decoration colors.
</span><span class="cx"> Color underline, overline, linethrough;
</span><del>- renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true);
</del><ins>+ renderer().getTextDecorationColors(decoration, underline, overline, linethrough);
</ins><span class="cx"> if (isFirstLine())
</span><del>- renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true, true);
</del><ins>+ renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true);
</ins><span class="cx">
</span><span class="cx"> // Use a special function for underlines to get the positioning exactly right.
</span><span class="cx"> bool isPrinting = renderer().document().printing();
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -1374,4 +1374,22 @@
</span><span class="cx"> controlStatesRendererMap().add(o, states);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+const RenderElement* RenderElement::enclosingRendererWithTextDecoration(TextDecoration textDecoration, bool firstLine) const
+{
+ const RenderElement* current = this;
+ do {
+ if (current->isRenderBlock())
+ return current;
+ if (!current->isRenderInline() || current->isRubyText())
+ return nullptr;
+
+ const RenderStyle& styleToUse = firstLine ? current->firstLineStyle() : current->style();
+ if (styleToUse.textDecoration() & textDecoration)
+ return current;
+ current = current->parent();
+ } while (current && (!current->element() || (!isHTMLAnchorElement(*current->element()) && !current->element()->hasTagName(HTMLNames::fontTag))));
+
+ return current;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.h (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.h        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderElement.h        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -161,6 +161,8 @@
</span><span class="cx">
</span><span class="cx"> bool isCSSAnimating() const { return m_isCSSAnimating; }
</span><span class="cx"> void setIsCSSAnimating(bool b) { m_isCSSAnimating = b; }
</span><ins>+
+ const RenderElement* enclosingRendererWithTextDecoration(TextDecoration, bool firstLine) const;
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> enum BaseTypeFlags {
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -2169,8 +2169,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline,
- Color& linethrough, bool quirksMode, bool firstlineStyle)
</del><ins>+void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool firstlineStyle)
</ins><span class="cx"> {
</span><span class="cx"> RenderObject* curr = this;
</span><span class="cx"> RenderStyle* styleToUse = 0;
</span><span class="lines">@@ -2200,7 +2199,7 @@
</span><span class="cx"> curr = curr->parent();
</span><span class="cx"> if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuation())
</span><span class="cx"> curr = toRenderBlock(curr)->continuation();
</span><del>- } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnchorElement(curr->node()) && !curr->node()->hasTagName(fontTag))));
</del><ins>+ } while (curr && decorations && (!curr->node() || (!isHTMLAnchorElement(curr->node()) && !curr->node()->hasTagName(fontTag))));
</ins><span class="cx">
</span><span class="cx"> // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
</span><span class="cx"> if (decorations && curr) {
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.h (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.h        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderObject.h        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -725,7 +725,7 @@
</span><span class="cx">
</span><span class="cx"> virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
</span><span class="cx">
</span><del>- void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false);
</del><ins>+ void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool firstlineStyle = false);
</ins><span class="cx">
</span><span class="cx"> // Return the RenderLayerModelObject in the container chain which is responsible for painting this object, or 0
</span><span class="cx"> // if painting is root-relative. This is the container that should be passed to the 'forRepaint'
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -316,13 +316,6 @@
</span><span class="cx"> return heightOfBlock + maxHeight;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float RootInlineBox::maxLogicalBottom() const
-{
- float maxLogicalBottom = logicalBottom();
- computeMaxLogicalBottom(maxLogicalBottom);
- return maxLogicalBottom;
-}
-
</del><span class="cx"> LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const
</span><span class="cx"> {
</span><span class="cx"> LayoutUnit result = 0;
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorerenderingRootInlineBoxh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.h (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.h        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RootInlineBox.h        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -187,9 +187,6 @@
</span><span class="cx"> return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Used to calculate the underline offset for TextUnderlinePositionUnder.
- float maxLogicalBottom() const;
-
</del><span class="cx"> Node* getLogicalStartBoxWithNode(InlineBox*&) const;
</span><span class="cx"> Node* getLogicalEndBoxWithNode(InlineBox*&) const;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorestyleInlineTextBoxStylecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/style/InlineTextBoxStyle.cpp (180418 => 180419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/style/InlineTextBoxStyle.cpp        2015-02-20 17:38:22 UTC (rev 180418)
+++ branches/safari-600.5-branch/Source/WebCore/style/InlineTextBoxStyle.cpp        2015-02-20 18:03:39 UTC (rev 180419)
</span><span class="lines">@@ -46,7 +46,19 @@
</span><span class="cx"> case TextUnderlinePositionUnder: {
</span><span class="cx"> ASSERT(inlineTextBox);
</span><span class="cx"> // Position underline relative to the bottom edge of the lowest element's content box.
</span><del>- float offset = inlineTextBox->root().maxLogicalBottom() - inlineTextBox->logicalBottom();
</del><ins>+ const RootInlineBox& rootBox = inlineTextBox->root();
+ const RenderElement* decorationRenderer = inlineTextBox->parent()->renderer().enclosingRendererWithTextDecoration(TextDecorationUnderline, inlineTextBox->isFirstLine());
+
+ float offset;
+ if (inlineTextBox->renderer().style().isFlippedLinesWritingMode()) {
+ offset = inlineTextBox->logicalTop();
+ rootBox.minLogicalTopForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+ offset = inlineTextBox->logicalTop() - offset;
+ } else {
+ offset = inlineTextBox->logicalBottom();
+ rootBox.maxLogicalBottomForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+ offset -= inlineTextBox->logicalBottom();
+ }
</ins><span class="cx"> return inlineTextBox->logicalHeight() + gap + std::max<float>(offset, 0);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>