<!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>[146104] 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/146104">146104</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-03-18 12:43:22 -0700 (Mon, 18 Mar 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>[css3-text] Add rendering support for -webkit-text-underline-position
https://bugs.webkit.org/show_bug.cgi?id=102795
Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-03-18
Reviewed by Levi Weintraub.
Source/WebCore:
This patch implements rendering support for values [ auto | alphabetic | under ]
of CSS3 property text-underline-position. We don't fully match the specification
as we don't support [ left | right ] and this is left for another implementation
as the rendering will need to be added.
Tests: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html
fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html
fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html
fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html
fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeMaxLogicalTop): Added method to compute maximal logical top among all chidren of
this InlineTextBox.
* rendering/InlineFlowBox.h:
(InlineFlowBox):
* rendering/InlineTextBox.cpp:
(WebCore::computeUnderlineOffset): Added method to compute offset for text-underline-position property.
(WebCore::InlineTextBox::paintDecoration): Paint decoration at position calculated using computeUnderlineOffset().
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):
(WebCore::RootInlineBox::alignBoxesInBlockDirection): Call method to compute maximal logical top among all
children of this RootInlineBox.
* rendering/RootInlineBox.h:
(RootInlineBox):
(WebCore::RootInlineBox::maxLogicalTop): Added getter for m_maxLogicalTop class member.
* rendering/style/RenderStyle.h: Added the usual getter / setter / initial methods for text-underline-position
property
LayoutTests:
Added text-underline-position tests for 'text-underline-position' CSS3
property, with 'webkit' prefix.
* fast/css3-text/css3-text-decoration/text-underline-position/style.css: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxh">trunk/Source/WebCore/rendering/InlineFlowBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxcpp">trunk/Source/WebCore/rendering/InlineTextBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxcpp">trunk/Source/WebCore/rendering/RootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxh">trunk/Source/WebCore/rendering/RootInlineBox.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/</li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositionstylecss">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/style.css</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallhtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabeticexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabetichtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautoexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautohtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowhtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderhtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html</a></li>
<li>trunk/LayoutTests/platform/chromium-linux/fast/css3-text/</li>
<li>trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/</li>
<li>trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/</li>
<li><a href="#trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallexpectedpng">trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabeticexpectedpng">trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautoexpectedpng">trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderexpectedpng">trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowexpectedpng">trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/LayoutTests/ChangeLog 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2013-03-18 Lamarque V. Souza <Lamarque.Souza@basyskom.com>
+
+ [css3-text] Add rendering support for -webkit-text-underline-position
+ https://bugs.webkit.org/show_bug.cgi?id=102795
+
+ Reviewed by Levi Weintraub.
+
+ Added text-underline-position tests for 'text-underline-position' CSS3
+ property, with 'webkit' prefix.
+
+ * fast/css3-text/css3-text-decoration/text-underline-position/style.css: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html: Added.
+ * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html: Added.
+ * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png: Added.
+ * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png: Added.
+ * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png: Added.
+ * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png: Added.
+ * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png: Added.
+
</ins><span class="cx"> 2013-03-18 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> Potentially unsafe register allocations in DFG code generation
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositionstylecss"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/style.css (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/style.css (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/style.css 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+body {
+ -webkit-font-smoothing: none;
+}
+
+div {
+ border: 5px double;
+ padding: 5px;
+ diplay: inline;
+}
+
+div.auto {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: auto;
+}
+
+div.alphabetic {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: alphabetic;
+}
+
+div.under {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: under;
+}
+
+span.auto {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: auto;
+}
+
+span.alphabetic {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: alphabetic;
+}
+
+span.under {
+ -webkit-text-decoration-style: solid;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-underline-position: under;
+}
+
+.box {
+ width: 300px;
+ height: 100px;
+}
+
+.position_absolute {
+ position: absolute;
+ top: 200px;
+ left: 100px;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Test if each value (auto, alphabetic and under) works. Auto defaults to alphabetic, so they should look the same, that is, the horizontal line should cross the 'p' letter in the word 'ipsum'. Under should not cross the 'p' letter. Bugzilla link: http://webkit.org/b/102795.
+
+auto lorem ipsum
+alphabetic lorem ipsum
+under lorem ipsum
+auto lorem ipsum under lorem ipsum alphabetic lorem ipsum
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+ <p>Test if each value (auto, alphabetic and under) works. Auto defaults to
+ alphabetic, so they should look the same, that is, the horizontal line
+ should cross the 'p' letter in the word 'ipsum'. Under should not cross the
+ 'p' letter. Bugzilla link: http://webkit.org/b/102795.</p>
+
+ <div class="auto">auto lorem ipsum</div>
+ <div class="alphabetic">alphabetic lorem ipsum</div>
+ <div class="under">under lorem ipsum</div>
+ <div class="auto">auto lorem ipsum <span class="under">under lorem ipsum</span> <span class="alphabetic">alphabetic lorem ipsum</span></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabeticexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+Test 'text-underline-position: alphabetic' with vertical-align. The horizontal lines should cross the 'p' letter in word 'ipsum'. None of the numbered texts are vertically aligned and the horizontal lines should follow the respective baseline of each text, that is, there should be six horizontal lines, one for each text, and none of them should be aligned. Bugzilla link: http://webkit.org/b/102795.
+
+ 1 lorem ipsum 2 lorem ipsum 3 lorem ipsum
+ 4 lorem ipsum 5 lorem ipsum 6 lorem ipsum
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabetichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+ <p>Test 'text-underline-position: alphabetic' with vertical-align. The
+ horizontal lines should cross the 'p' letter in word 'ipsum'. None of the
+ numbered texts are vertically aligned and the horizontal lines should
+ follow the respective baseline of each text, that is, there should be six
+ horizontal lines, one for each text, and none of them should be aligned.
+ Bugzilla link: http://webkit.org/b/102795.</p>
+
+ <div class="alphabetic">
+ <p>&nbsp;1 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: 3em;">&nbsp;2 lorem ipsum&nbsp;&nbsp;</span><span style="vertical-align: -2em;">&nbsp;3 lorem ipsum&nbsp;&nbsp;</span><br>
+ &nbsp;4 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: middle">&nbsp;5 lorem ipsum&nbsp;&nbsp;<span style="vertical-align: middle">&nbsp;6 lorem ipsum&nbsp;&nbsp;</span></span>
+ </p>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+Test 'text-underline-position: auto' with vertical-align. The horizontal lines should cross the 'p' letter in word 'ipsum'. None of the numbered texts are vertically aligned and the horizontal lines should follow the respective baseline of each text, that is, there should be six horizontal lines, one for each text, and none of them should be aligned. Bugzilla link: http://webkit.org/b/102795.
+
+ 1 lorem ipsum 2 lorem ipsum 3 lorem ipsum
+ 4 lorem ipsum 5 lorem ipsum 6 lorem ipsum
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+ <p>Test 'text-underline-position: auto' with vertical-align. The horizontal
+ lines should cross the 'p' letter in word 'ipsum'. None of the numbered
+ texts are vertically aligned and the horizontal lines should follow the
+ respective baseline of each text, that is, there should be six horizontal
+ lines, one for each text, and none of them should be aligned. Bugzilla
+ link: http://webkit.org/b/102795.</p>
+
+ <div class="auto">
+ <p>&nbsp;1 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: 3em;">&nbsp;2 lorem ipsum&nbsp;&nbsp;</span><span style="vertical-align: -2em;">&nbsp;3 lorem ipsum&nbsp;&nbsp;</span><br>
+ &nbsp;4 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: middle">&nbsp;5 lorem ipsum&nbsp;&nbsp;<span style="vertical-align: middle">&nbsp;6 lorem ipsum&nbsp;&nbsp;</span></span>
+ </p>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+Test 'text-underline-position: under' with vertical-align. The horizontal lines should not cross the 'p' letter in word 'ipsum'. None of the numbered texts are vertically aligned, yet the three horizontal lines for each of the two rows should align perfectly, that is, it should appear as if there are two long horizontal lines. Bugzilla link: http://webkit.org/b/102795.
+
+ 1 lorem ipsum 2 lorem ipsum 3 lorem ipsum
+ 4 lorem ipsum 5 lorem ipsum 6 lorem ipsum
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+Test if out of flow boxes are ignored when calculating the offset for 'text-underline-position: under'. The horizontal line below should not go outside the box. Bugzilla link: http://webkit.org/b/102795.
+
+ 1 lorem ipsum OutOfFlowPositioned 2 lorem ipsum
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+ <p>Test if out of flow boxes are ignored when calculating the offset for
+ 'text-underline-position: under'. The horizontal line below should not go
+ outside the box. Bugzilla link: http://webkit.org/b/102795.</p>
+
+ <div class="under">
+ &nbsp;1 lorem ipsum&nbsp;&nbsp;
+ <span class="position_absolute">OutOfFlowPositioned</span>
+ &nbsp;2 lorem ipsum&nbsp;&nbsp;
+ </span>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html (0 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+ <link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+ <p>Test 'text-underline-position: under' with vertical-align. The
+ horizontal lines should not cross the 'p' letter in word 'ipsum'. None of
+ the numbered texts are vertically aligned, yet the three horizontal lines
+ for each of the two rows should align perfectly, that is, it should appear
+ as if there are two long horizontal lines. Bugzilla link:
+ http://webkit.org/b/102795.</p>
+
+ <div class="under">
+ <p>&nbsp;1 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: 3em;">&nbsp;2 lorem ipsum&nbsp;&nbsp;</span><span style="vertical-align: -2em;">&nbsp;3 lorem ipsum&nbsp;&nbsp;</span><br>
+ &nbsp;4 lorem ipsum&nbsp;&nbsp;
+ <span style="vertical-align: middle">&nbsp;5 lorem ipsum&nbsp;&nbsp;<span style="vertical-align: middle">&nbsp;6 lorem ipsum&nbsp;&nbsp;</span></span>
+ </p>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionallexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionalphabeticexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionautoexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformchromiumlinuxfastcss3textcss3textdecorationtextunderlinepositiontextunderlinepositionunderoutofflowexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/ChangeLog 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2013-03-18 Lamarque V. Souza <Lamarque.Souza@basyskom.com>
+
+ [css3-text] Add rendering support for -webkit-text-underline-position
+ https://bugs.webkit.org/show_bug.cgi?id=102795
+
+ Reviewed by Levi Weintraub.
+
+ This patch implements rendering support for values [ auto | alphabetic | under ]
+ of CSS3 property text-underline-position. We don't fully match the specification
+ as we don't support [ left | right ] and this is left for another implementation
+ as the rendering will need to be added.
+
+ Tests: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html
+ fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html
+ fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html
+ fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html
+ fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::computeMaxLogicalTop): Added method to compute maximal logical top among all chidren of
+ this InlineTextBox.
+ * rendering/InlineFlowBox.h:
+ (InlineFlowBox):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::computeUnderlineOffset): Added method to compute offset for text-underline-position property.
+ (WebCore::InlineTextBox::paintDecoration): Paint decoration at position calculated using computeUnderlineOffset().
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::RootInlineBox):
+ (WebCore::RootInlineBox::alignBoxesInBlockDirection): Call method to compute maximal logical top among all
+ children of this RootInlineBox.
+ * rendering/RootInlineBox.h:
+ (RootInlineBox):
+ (WebCore::RootInlineBox::maxLogicalTop): Added getter for m_maxLogicalTop class member.
+ * rendering/style/RenderStyle.h: Added the usual getter / setter / initial methods for text-underline-position
+ property
+
</ins><span class="cx"> 2013-03-18 Christian Biesinger <cbiesinger@chromium.org>
</span><span class="cx">
</span><span class="cx"> Convert old flexbox uses in html.css to new flexbox (non-<select>)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -739,6 +739,25 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS3_TEXT)
+void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop)
+{
+ for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
+ if (curr->renderer()->isOutOfFlowPositioned())
+ continue; // Positioned placeholders don't affect calculations.
+
+ if (descendantsHaveSameLineHeightAndBaseline())
+ continue;
+
+ maxLogicalTop = max<float>(maxLogicalTop, curr->y());
+ float localMaxLogicalTop = 0;
+ if (curr->isInlineFlowBox())
+ toInlineFlowBox(curr)->computeMaxLogicalTop(localMaxLogicalTop);
+ maxLogicalTop = max<float>(maxLogicalTop, localMaxLogicalTop);
+ }
+}
+#endif // CSS3_TEXT
+
</ins><span class="cx"> void InlineFlowBox::flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lineBottom)
</span><span class="cx"> {
</span><span class="cx"> // Flip the box on the line such that the top is now relative to the lineBottom instead of the lineTop.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.h 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -319,6 +319,11 @@
</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><ins>+#if ENABLE(CSS3_TEXT)
+ // Maximum logicalTop among all children of an InlineFlowBox. Used to
+ // calculate the offset for TextUnderlinePositionUnder.
+ void computeMaxLogicalTop(float& maxLogicalTop);
+#endif // CSS3_TEXT
</ins><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="trunkSourceWebCorerenderingInlineTextBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -958,6 +958,33 @@
</span><span class="cx"> return strokeStyle;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS3_TEXT)
+static int computeUnderlineOffset(const TextUnderlinePosition underlinePosition, const FontMetrics& fontMetrics, const InlineTextBox* inlineTextBox, const int textDecorationThickness)
+{
+ // Compute the gap between the font and the underline. Use at least one
+ // pixel gap, if underline is thick then use a bigger gap.
+ const int gap = max<int>(1, ceilf(textDecorationThickness / 2.0));
+
+ // According to the specification TextUnderlinePositionAuto should default to 'alphabetic' for horizontal text
+ // and to 'under Left' for vertical text (e.g. japanese). We support only horizontal text for now.
+ switch (underlinePosition) {
+ case TextUnderlinePositionAlphabetic:
+ case TextUnderlinePositionAuto:
+ return fontMetrics.ascent() + gap; // Position underline near the alphabetic baseline.
+ case TextUnderlinePositionUnder: {
+ // Position underline relative to the under edge of the lowest element's content box.
+ const float offset = inlineTextBox->root()->maxLogicalTop() - inlineTextBox->logicalTop();
+ if (offset > 0)
+ return inlineTextBox->logicalHeight() + gap + offset;
+ return inlineTextBox->logicalHeight() + gap;
+ }
+ }
+
+ ASSERT_NOT_REACHED();
+ return fontMetrics.ascent() + gap;
+}
+#endif // CSS3_TEXT
+
</ins><span class="cx"> void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint& boxOrigin, ETextDecoration deco, TextDecorationStyle decorationStyle, const ShadowData* shadow)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: We should improve this rule and not always just assume 1.
</span><span class="lines">@@ -1034,11 +1061,16 @@
</span><span class="cx"> context->setStrokeStyle(textDecorationStyleToStrokeStyle(decorationStyle));
</span><span class="cx"> if (deco & UNDERLINE) {
</span><span class="cx"> context->setStrokeColor(underline, colorSpace);
</span><ins>+#if ENABLE(CSS3_TEXT)
+ TextUnderlinePosition underlinePosition = styleToUse->textUnderlinePosition();
+ const int underlineOffset = computeUnderlineOffset(underlinePosition, styleToUse->fontMetrics(), this, textDecorationThickness);
+ context->drawLineForText(FloatPoint(localOrigin.x(), localOrigin.y() + underlineOffset), width, isPrinting);
+
+ if (decorationStyle == TextDecorationStyleDouble)
+ context->drawLineForText(FloatPoint(localOrigin.x(), localOrigin.y() + underlineOffset + doubleOffset), width, isPrinting);
+#else
</ins><span class="cx"> // Leave one pixel of white between the baseline and the underline.
</span><span class="cx"> context->drawLineForText(FloatPoint(localOrigin.x(), localOrigin.y() + baseline + 1), width, isPrinting);
</span><del>-#if ENABLE(CSS3_TEXT)
- if (decorationStyle == TextDecorationStyleDouble)
- context->drawLineForText(FloatPoint(localOrigin.x(), localOrigin.y() + baseline + 1 + doubleOffset), width, isPrinting);
</del><span class="cx"> #endif // CSS3_TEXT
</span><span class="cx"> }
</span><span class="cx"> if (deco & OVERLINE) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.cpp 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -53,6 +53,9 @@
</span><span class="cx"> , m_lineBottom(0)
</span><span class="cx"> , m_lineTopWithLeading(0)
</span><span class="cx"> , m_lineBottomWithLeading(0)
</span><ins>+#if ENABLE(CSS3_TEXT)
+ , m_maxLogicalTop(0)
+#endif // CSS3_TEXT
</ins><span class="cx"> {
</span><span class="cx"> setIsHorizontal(block->isHorizontalWritingMode());
</span><span class="cx"> }
</span><span class="lines">@@ -279,6 +282,8 @@
</span><span class="cx"> // SVG will handle vertical alignment on its own.
</span><span class="cx"> if (isSVGRootInlineBox())
</span><span class="cx"> return 0;
</span><ins>+
+ // FIXME: figure out how to call computeMaxLogicalTop() when SVG is enabled.
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> LayoutUnit maxPositionTop = 0;
</span><span class="lines">@@ -331,6 +336,11 @@
</span><span class="cx"> heightOfBlock += gridSnapAdjustment;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS3_TEXT)
+ m_maxLogicalTop = 0;
+ computeMaxLogicalTop(m_maxLogicalTop);
+#endif // CSS3_TEXT
+
</ins><span class="cx"> return heightOfBlock + maxHeight;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (146103 => 146104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.h 2013-03-18 19:32:40 UTC (rev 146103)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h 2013-03-18 19:43:22 UTC (rev 146104)
</span><span class="lines">@@ -186,6 +186,11 @@
</span><span class="cx"> return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS3_TEXT)
+ // Used to calculate the underline offset for TextUnderlinePositionUnder.
+ float maxLogicalTop() const { return m_maxLogicalTop; }
+#endif // CSS3_TEXT
+
</ins><span class="cx"> Node* getLogicalStartBoxWithNode(InlineBox*&) const;
</span><span class="cx"> Node* getLogicalEndBoxWithNode(InlineBox*&) const;
</span><span class="cx">
</span><span class="lines">@@ -220,6 +225,12 @@
</span><span class="cx"> LayoutUnit m_lineTopWithLeading;
</span><span class="cx"> LayoutUnit m_lineBottomWithLeading;
</span><span class="cx">
</span><ins>+#if ENABLE(CSS3_TEXT)
+ // Maximum logicalTop among all children of an InlineFlowBox. Used to
+ // calculate the offset for TextUnderlinePositionUnder.
+ float m_maxLogicalTop;
+#endif // CSS3_TEXT
+
</ins><span class="cx"> struct LineFragmentationData {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(LineFragmentationData); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span></span></pre>
</div>
</div>
</body>
</html>