<!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>. &lt;rdar://19894685&gt;</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  &lt;dburkart@apple.com&gt;
+
+        Merged r180150. &lt;rdar://problem/19894685&gt;
+
+    2015-02-12  David Hyatt  &lt;hyatt@apple.com&gt;
+
+            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  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merged r180128. &lt;rdar://problem/19850739&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+&lt;span style=&quot;text-decoration:underline&quot;&gt;The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;/span&gt;&lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt;&lt;span style=&quot;text-decoration:underline&quot;&gt; under the image.&lt;/span&gt;&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+.decorate::first-line { text-decoration:underline }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt; under the image.&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;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.
+&lt;/p&gt;
+
+&lt;span style=&quot;text-decoration:underline;-webkit-text-underline-position:under&quot;&gt;This text should be underlined just under the descenders.&lt;/span&gt; 
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;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.
+&lt;/p&gt;
+
+&lt;span style=&quot;text-decoration:underline;-webkit-text-underline-position:under&quot;&gt;This text should be underlined just under the descenders.&lt;/span&gt; &lt;span style=&quot;font-size:64px; vertical-align:-256px; color:transparent&quot;&gt;Should not be underlined.&lt;/span&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+.yellow::first-line { color:grey }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;yellow&quot; style=&quot;font-size:40px; padding-top:5px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;&lt;span style=&quot;position:relative;&quot;&gt;Here is the subscript for this line.&lt;/span&gt;
+&lt;/p&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+.yellow::first-line { color:grey }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;yellow&quot; style=&quot;font-size:40px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;&lt;span style=&quot;vertical-align:-5px;&quot;&gt;Here is the subscript for this line.&lt;/span&gt;
+&lt;/p&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+&lt;span style=&quot;text-decoration:underline&quot;&gt;The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;/span&gt;&lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt;&lt;span style=&quot;text-decoration:underline&quot;&gt; under the image.&lt;/span&gt;&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+&lt;span style=&quot;text-decoration:underline&quot;&gt;The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;/span&gt;&lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt;&lt;span style=&quot;text-decoration:underline&quot;&gt; under the image.&lt;/span&gt;&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
</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>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ibooks=&quot;http://apple.com/ibooks/html-extensions&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;&gt;
+&lt;head&gt;
+&lt;style&gt;
+.decorate::first-line { text-decoration:underline }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body style=&quot;overflow:hidden&quot;&gt;
+&lt;p&gt;Test to make sure that the decoration line paints properly underneath the subscript.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt; under the image.&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
+
+&lt;p class=&quot;decorate&quot; style=&quot;-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange&quot;&gt;
+The first line &lt;span style=&quot;vertical-align:-20px&quot;&gt;has a decoration,&lt;/span&gt; but not &lt;img style=&quot;vertical-align:-100px; height:20px;width:20px;background-color:lime&quot;&gt; under the image.&lt;br&gt;
+The second line should not.
+&lt;/p&gt;
</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  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merged r180150. &lt;rdar://problem/19894685&gt;
+
+    2015-02-12  David Hyatt  &lt;hyatt@apple.com&gt;
+
+            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 &quot;under&quot; 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  &lt;dburkart@apple.com&gt;
+
</ins><span class="cx">         Merged r180147. &lt;rdar://problem/19850657&gt;
</span><span class="cx"> 
</span><span class="cx">     2015-02-16  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</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&amp; maxLogicalBottom) const
</del><ins>+void InlineFlowBox::maxLogicalBottomForTextDecorationLine(float&amp; maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
</ins><span class="cx"> {
</span><del>-    for (InlineBox* curr = firstChild(); curr; curr = curr-&gt;nextOnLine()) {
-        if (curr-&gt;renderer().isOutOfFlowPositioned())
</del><ins>+    for (InlineBox* child = firstChild(); child; child = child-&gt;nextOnLine()) {
+        if (child-&gt;renderer().isOutOfFlowPositioned())
</ins><span class="cx">             continue; // Positioned placeholders don't affect calculations.
</span><ins>+        
+        if (!(child-&gt;lineStyle().textDecorationsInEffect() &amp; textDecoration))
+            continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+        
+        if (decorationRenderer &amp;&amp; decorationRenderer-&gt;isRenderInline() &amp;&amp; !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &amp;child-&gt;renderer()))
+            continue;
+        
+        if (child-&gt;isInlineFlowBox())
+            toInlineFlowBox(child)-&gt;maxLogicalBottomForTextDecorationLine(maxLogicalBottom, decorationRenderer, textDecoration);
+        else {
+            if (child-&gt;isInlineTextBox() || child-&gt;lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+                maxLogicalBottom = std::max&lt;float&gt;(maxLogicalBottom, child-&gt;logicalBottom());
+        }
+    }
+}
</ins><span class="cx"> 
</span><del>-        if (descendantsHaveSameLineHeightAndBaseline())
</del><ins>+void InlineFlowBox::minLogicalTopForTextDecorationLine(float&amp; minLogicalTop, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
+{
+    for (InlineBox* child = firstChild(); child; child = child-&gt;nextOnLine()) {
+        if (child-&gt;renderer().isOutOfFlowPositioned())
+            continue; // Positioned placeholders don't affect calculations.
+        
+        if (!(child-&gt;lineStyle().textDecorationsInEffect() &amp; textDecoration))
+            continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+        
+        if (decorationRenderer &amp;&amp; decorationRenderer-&gt;isRenderInline() &amp;&amp; !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &amp;child-&gt;renderer()))
</ins><span class="cx">             continue;
</span><del>-
-        maxLogicalBottom = std::max&lt;float&gt;(maxLogicalBottom, curr-&gt;logicalBottom());
-        if (curr-&gt;isInlineFlowBox())
-            toInlineFlowBox(curr)-&gt;computeMaxLogicalBottom(maxLogicalBottom);
</del><ins>+        
+        if (child-&gt;isInlineFlowBox())
+            toInlineFlowBox(child)-&gt;minLogicalTopForTextDecorationLine(minLogicalTop, decorationRenderer, textDecoration);
+        else {
+            if (child-&gt;isInlineTextBox() || child-&gt;lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+                minLogicalTop = std::min&lt;float&gt;(minLogicalTop, child-&gt;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&amp; lineTop, LayoutUnit&amp; lineBottom) const;
</span><span class="cx">     
</span><ins>+    // Used to calculate the underline offset for TextUnderlinePositionUnder.
+    void maxLogicalBottomForTextDecorationLine(float&amp; maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration) const;
+    void minLogicalTopForTextDecorationLine(float&amp; 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&amp; 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-&gt;isRenderBlock())
+            return current;
+        if (!current-&gt;isRenderInline() || current-&gt;isRubyText())
+            return nullptr;
+        
+        const RenderStyle&amp; styleToUse = firstLine ? current-&gt;firstLineStyle() : current-&gt;style();
+        if (styleToUse.textDecoration() &amp; textDecoration)
+            return current;
+        current = current-&gt;parent();
+    } while (current &amp;&amp; (!current-&gt;element() || (!isHTMLAnchorElement(*current-&gt;element()) &amp;&amp; !current-&gt;element()-&gt;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&amp; underline, Color&amp; overline,
-                                           Color&amp; linethrough, bool quirksMode, bool firstlineStyle)
</del><ins>+void RenderObject::getTextDecorationColors(int decorations, Color&amp; underline, Color&amp; overline, Color&amp; 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-&gt;parent();
</span><span class="cx">         if (curr &amp;&amp; curr-&gt;isAnonymousBlock() &amp;&amp; toRenderBlock(curr)-&gt;continuation())
</span><span class="cx">             curr = toRenderBlock(curr)-&gt;continuation();
</span><del>-    } while (curr &amp;&amp; decorations &amp;&amp; (!quirksMode || !curr-&gt;node() || (!isHTMLAnchorElement(curr-&gt;node()) &amp;&amp; !curr-&gt;node()-&gt;hasTagName(fontTag))));
</del><ins>+    } while (curr &amp;&amp; decorations &amp;&amp; (!curr-&gt;node() || (!isHTMLAnchorElement(curr-&gt;node()) &amp;&amp; !curr-&gt;node()-&gt;hasTagName(fontTag))));
</ins><span class="cx"> 
</span><span class="cx">     // If we bailed out, use the element we bailed out at (typically a &lt;font&gt; or &lt;a&gt; element).
</span><span class="cx">     if (decorations &amp;&amp; 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&amp;, Cursor&amp;) const;
</span><span class="cx"> 
</span><del>-    void getTextDecorationColors(int decorations, Color&amp; underline, Color&amp; overline, Color&amp; linethrough, bool quirksMode = false, bool firstlineStyle = false);
</del><ins>+    void getTextDecorationColors(int decorations, Color&amp; underline, Color&amp; overline, Color&amp; 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*&amp;) const;
</span><span class="cx">     Node* getLogicalEndBoxWithNode(InlineBox*&amp;) 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-&gt;root().maxLogicalBottom() - inlineTextBox-&gt;logicalBottom();
</del><ins>+        const RootInlineBox&amp; rootBox = inlineTextBox-&gt;root();
+        const RenderElement* decorationRenderer = inlineTextBox-&gt;parent()-&gt;renderer().enclosingRendererWithTextDecoration(TextDecorationUnderline, inlineTextBox-&gt;isFirstLine());
+        
+        float offset;
+        if (inlineTextBox-&gt;renderer().style().isFlippedLinesWritingMode()) {
+            offset = inlineTextBox-&gt;logicalTop();
+            rootBox.minLogicalTopForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+            offset = inlineTextBox-&gt;logicalTop() - offset;
+        } else {
+            offset = inlineTextBox-&gt;logicalBottom();
+            rootBox.maxLogicalBottomForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+            offset -= inlineTextBox-&gt;logicalBottom();
+        }
</ins><span class="cx">         return inlineTextBox-&gt;logicalHeight() + gap + std::max&lt;float&gt;(offset, 0);
</span><span class="cx">     }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>