<!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>[147513] 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/147513">147513</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-04-02 18:32:24 -0700 (Tue, 02 Apr 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore: [css3-text] Rendering -webkit-each-line value for text-indent from css3-text
https://bugs.webkit.org/show_bug.cgi?id=113259
Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-04-02
Reviewed by Levi Weintraub.
CSS3 TEXT introduces new value, "each-line" for text-indent.
Indentation affects the first line of the block container as well as each line
after a forced line break, but does not affect lines after a soft wrap break.
This patch is the rendering part to support each-line value for text-indent.
It's prefixed and guarded by CSS3_TEXT flag.
Test: fast/css3-text/css3-text-indent/text-indent-each-line.html
* rendering/RenderBlock.h:
(WebCore::RenderBlock::availableLogicalWidthForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::startOffsetForLine):
(WebCore::RenderBlock::endOffsetForLine):
(WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
(WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
Rename a parameter from firstLine to shouldIndentText.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::LineWidth):
(WebCore::LineWidth::shouldIndentText): Return boolean according to m_shouldIndentText.
(WebCore::LineWidth::updateAvailableWidth):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
(WebCore::LineWidth::fitBelowFloats):
Add enum IndentTextOrNot and m_shouldIndentText.
Use m_shouldIndentText instead of m_isFirstLine.
(WebCore::requiresIndent): Decide whether text indentation is required.
(WebCore::updateLogicalInlinePositions):
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
(WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
LayoutTests: [css3-text] Rendering -webkit-each-line value for text-indent from css3-text
https://bugs.webkit.org/show_bug.cgi?id=113259
CSS3 TEXT introduces new value, "each-line" for text-indent.
Indentation affects the first line of the block container as well as each line
after a forced line break, but does not affect lines after a soft wrap break.
Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-04-02
Reviewed by Levi Weintraub.
* fast/css3-text/css3-text-indent/text-indent-each-line-expected.html: Added.
* fast/css3-text/css3-text-indent/text-indent-each-line.html: Added.
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoTestExpectations">trunk/LayoutTests/platform/wincairo/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcss3textcss3textindenttextindenteachlineexpectedhtml">trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textindenttextindenteachlinehtml">trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/LayoutTests/ChangeLog 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2013-04-02 Jaehun Lim <ljaehun.lim@samsung.com>
+
+ [css3-text] Rendering -webkit-each-line value for text-indent from css3-text
+ https://bugs.webkit.org/show_bug.cgi?id=113259
+
+ CSS3 TEXT introduces new value, "each-line" for text-indent.
+ Indentation affects the first line of the block container as well as each line
+ after a forced line break, but does not affect lines after a soft wrap break.
+
+ Reviewed by Levi Weintraub.
+
+ * fast/css3-text/css3-text-indent/text-indent-each-line-expected.html: Added.
+ * fast/css3-text/css3-text-indent/text-indent-each-line.html: Added.
+ * platform/win/TestExpectations:
+ * platform/wincairo/TestExpectations:
+
</ins><span class="cx"> 2013-04-02 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Compositing tests failing after http://trac.webkit.org/changeset/147502
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textindenttextindenteachlineexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-expected.html (0 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-expected.html 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<html>
+<head>
+ <title>[css3-text] text-indent</title>
+ <style>
+ div { width:80px; font: 10px Ahem; background-color:lightgray; }
+ .normal { text-indent: 4em; }
+ .indent { color: blue; }
+ .eachline { padding-left:4em; }
+ </style>
+</head
+<body>
+<div class="normal">
+<span class="indent">xxxx</span><br>xxxx<br>xxxx
+</div>
+<br>
+<div class="normal">
+<span class="indent">xxxx</span> xxxx xxxx
+</div>
+<br>
+<div class="normal">
+<span class="indent">xxxx</span><br><span class="indent eachline">xxxx</span><br><span class="indent eachline">xxxx</span>
+</div>
+<br>
+<div class="normal">
+<span class="indent">xxxx</span> xxxx<br><span class="indent eachline">xxxx</span>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textindenttextindenteachlinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line.html (0 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line.html 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+<html>
+<head>
+ <title>[css3-text] text-indent</title>
+ <style>
+ div { width:80px; font: 10px Ahem; background-color:lightgray; }
+ .normal { text-indent: 4em; }
+ .eachline { width:80px; text-indent: 4em -webkit-each-line; }
+ .indent { color: blue; }
+ </style>
+</head
+<body>
+<!--
+all black boxes should be left-aligned.
+all blue boxes should be right-aligned.
+-->
+
+<!-- normal text-indent -->
+<div class="normal">
+<span class="indent">xxxx</span><br>xxxx<br>xxxx
+</div>
+<br>
+<!-- -webkit-each-line with a soft wrap break -->
+<div class="eachline">
+<span class="indent">xxxx</span> xxxx xxxx
+</div>
+<br>
+<!-- -webkit-each-line with a forced line break -->
+<div class="eachline">
+<span class="indent">xxxx</span><br><span class="indent">xxxx</span><br><span class="indent">xxxx</span>
+</div>
+<br>
+<!-- -webkit-each-line with a soft wrap break and a forced line break -->
+<div class="eachline">
+<span class="indent">xxxx</span> xxxx<br><span class="indent">xxxx</span>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/LayoutTests/platform/win/TestExpectations 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -2507,8 +2507,7 @@
</span><span class="cx"> fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
</span><span class="cx"> fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color.html
</span><span class="cx"> fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html
</span><del>-fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited.html
-fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent.html
</del><ins>+fast/css3-text/css3-text-indent [ Failure ]
</ins><span class="cx">
</span><span class="cx"> # Needs rebaseline.
</span><span class="cx"> webkit.org/b/94198 fast/dom/HTMLImageElement/image-alt-text.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/TestExpectations 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -2983,8 +2983,7 @@
</span><span class="cx"> fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html
</span><span class="cx"> fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
</span><span class="cx"> fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
</span><del>-fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited.html
-fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent.html
</del><ins>+fast/css3-text/css3-text-indent [ Failure ]
</ins><span class="cx">
</span><span class="cx"> # Spellchecker behavior tests.
</span><span class="cx"> webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/Source/WebCore/ChangeLog 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2013-04-02 Jaehun Lim <ljaehun.lim@samsung.com>
+
+ [css3-text] Rendering -webkit-each-line value for text-indent from css3-text
+ https://bugs.webkit.org/show_bug.cgi?id=113259
+
+ Reviewed by Levi Weintraub.
+
+ CSS3 TEXT introduces new value, "each-line" for text-indent.
+ Indentation affects the first line of the block container as well as each line
+ after a forced line break, but does not affect lines after a soft wrap break.
+
+ This patch is the rendering part to support each-line value for text-indent.
+ It's prefixed and guarded by CSS3_TEXT flag.
+
+ Test: fast/css3-text/css3-text-indent/text-indent-each-line.html
+
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::availableLogicalWidthForLine):
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::startOffsetForLine):
+ (WebCore::RenderBlock::endOffsetForLine):
+ (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
+ (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
+ Rename a parameter from firstLine to shouldIndentText.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::LineWidth::LineWidth):
+ (WebCore::LineWidth::shouldIndentText): Return boolean according to m_shouldIndentText.
+ (WebCore::LineWidth::updateAvailableWidth):
+ (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
+ (WebCore::LineWidth::fitBelowFloats):
+ Add enum IndentTextOrNot and m_shouldIndentText.
+ Use m_shouldIndentText instead of m_isFirstLine.
+
+ (WebCore::requiresIndent): Decide whether text indentation is required.
+ (WebCore::updateLogicalInlinePositions):
+ (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+ (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
+
</ins><span class="cx"> 2013-04-02 Glenn Adams <glenn@skynav.com>
</span><span class="cx">
</span><span class="cx"> Generalize prior line break context state and names.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -165,66 +165,66 @@
</span><span class="cx">
</span><span class="cx"> // Versions that can compute line offsets with the region and page offset passed in. Used for speed to avoid having to
</span><span class="cx"> // compute the region all over again when you already know it.
</span><del>- LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return max<LayoutUnit>(0, logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
- - logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight));
</del><ins>+ return max<LayoutUnit>(0, logicalRightOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+ - logicalLeftOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight));
</ins><span class="cx"> }
</span><del>- LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine, 0, logicalHeight);
</del><ins>+ return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage), shouldIndentText, 0, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine, 0, logicalHeight);
</del><ins>+ return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage), shouldIndentText, 0, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
- : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
</del><ins>+ return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+ : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
- : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
</del><ins>+ return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+ : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return availableLogicalWidthForLine(position, firstLine, regionAtBlockOffset(position), offsetFromLogicalTopOfFirstPage(), logicalHeight);
</del><ins>+ return availableLogicalWidthForLine(position, shouldIndentText, regionAtBlockOffset(position), offsetFromLogicalTopOfFirstPage(), logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0, logicalHeight);
</del><ins>+ return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), shouldIndentText, 0, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0, logicalHeight);
</del><ins>+ return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), shouldIndentText, 0, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return roundToInt(logicalLeftOffsetForLine(position, firstLine, logicalHeight));
</del><ins>+ return roundToInt(logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight));
</ins><span class="cx"> }
</span><del>- LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: Multicolumn layouts break carrying over subpixel values to the logical right offset because the lines may be shifted
</span><span class="cx"> // by a subpixel value for all but the first column. This can lead to the actual pixel snapped width of the column being off
</span><span class="cx"> // by one pixel when rendered versus layed out, which can result in the line being clipped. For now, we have to floor.
</span><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=105461
</span><del>- return floorToInt(logicalRightOffsetForLine(position, firstLine, logicalHeight));
</del><ins>+ return floorToInt(logicalRightOffsetForLine(position, shouldIndentText, logicalHeight));
</ins><span class="cx"> }
</span><del>- LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, logicalHeight)
- : logicalWidth() - logicalRightOffsetForLine(position, firstLine, logicalHeight);
</del><ins>+ return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
+ : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
</ins><span class="cx"> }
</span><del>- LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
</del><ins>+ LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
</ins><span class="cx"> {
</span><del>- return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, logicalHeight)
- : logicalWidth() - logicalRightOffsetForLine(position, firstLine, logicalHeight);
</del><ins>+ return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
+ : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool firstLine);
</del><ins>+ LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentText);
</ins><span class="cx"> LayoutUnit textIndentOffset() const;
</span><span class="cx">
</span><span class="cx"> virtual VisiblePosition positionForPoint(const LayoutPoint&);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (147512 => 147513)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-04-03 00:35:37 UTC (rev 147512)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-04-03 01:32:24 UTC (rev 147513)
</span><span class="lines">@@ -89,9 +89,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+enum IndentTextOrNot { DoNotIndentText, IndentText };
+
</ins><span class="cx"> class LineWidth {
</span><span class="cx"> public:
</span><del>- LineWidth(RenderBlock* block, bool isFirstLine)
</del><ins>+ LineWidth(RenderBlock* block, bool isFirstLine, IndentTextOrNot shouldIndentText)
</ins><span class="cx"> : m_block(block)
</span><span class="cx"> , m_uncommittedWidth(0)
</span><span class="cx"> , m_committedWidth(0)
</span><span class="lines">@@ -103,6 +105,7 @@
</span><span class="cx"> , m_segment(0)
</span><span class="cx"> #endif
</span><span class="cx"> , m_isFirstLine(isFirstLine)
</span><ins>+ , m_shouldIndentText(shouldIndentText)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(block);
</span><span class="cx"> #if ENABLE(CSS_EXCLUSIONS)
</span><span class="lines">@@ -132,6 +135,8 @@
</span><span class="cx"> void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer);
</span><span class="cx"> void fitBelowFloats();
</span><span class="cx">
</span><ins>+ bool shouldIndentText() { return m_shouldIndentText == IndentText; }
+
</ins><span class="cx"> private:
</span><span class="cx"> void computeAvailableWidthFromLeftAndRight()
</span><span class="cx"> {
</span><span class="lines">@@ -150,14 +155,15 @@
</span><span class="cx"> const LineSegment* m_segment;
</span><span class="cx"> #endif
</span><span class="cx"> bool m_isFirstLine;
</span><ins>+ IndentTextOrNot m_shouldIndentText;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
</span><span class="cx"> {
</span><span class="cx"> LayoutUnit height = m_block->logicalHeight();
</span><span class="cx"> LayoutUnit logicalHeight = logicalHeightForLine(m_block, m_isFirstLine, replacedHeight);
</span><del>- m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine, logicalHeight);
- m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine, logicalHeight);
</del><ins>+ m_left = m_block->logicalLeftOffsetForLine(height, shouldIndentText(), logicalHeight);
+ m_right = m_block->logicalRightOffsetForLine(height, shouldIndentText(), logicalHeight);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_EXCLUSIONS)
</span><span class="cx"> if (m_segment) {
</span><span class="lines">@@ -188,7 +194,7 @@
</span><span class="cx"> newLeft += shapeOutsideInfo->rightSegmentShapeBoundingBoxDelta();
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- if (m_isFirstLine && m_block->style()->isLeftToRightDirection())
</del><ins>+ if (shouldIndentText() && m_block->style()->isLeftToRightDirection())
</ins><span class="cx"> newLeft += floorToInt(m_block->textIndentOffset());
</span><span class="cx"> m_left = max<float>(m_left, newLeft);
</span><span class="cx"> } else {
</span><span class="lines">@@ -198,7 +204,7 @@
</span><span class="cx"> newRight += shapeOutsideInfo->leftSegmentShapeBoundingBoxDelta();
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- if (m_isFirstLine && !m_block->style()->isLeftToRightDirection())
</del><ins>+ if (shouldIndentText() && !m_block->style()->isLeftToRightDirection())
</ins><span class="cx"> newRight -= floorToInt(m_block->textIndentOffset());
</span><span class="cx"> m_right = min<float>(m_right, newRight);
</span><span class="cx"> }
</span><span class="lines">@@ -235,8 +241,8 @@
</span><span class="cx"> if (floatLogicalBottom <= lastFloatLogicalBottom)
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- newLineLeft = m_block->logicalLeftOffsetForLine(floatLogicalBottom, m_isFirstLine);
- newLineRight = m_block->logicalRightOffsetForLine(floatLogicalBottom, m_isFirstLine);
</del><ins>+ newLineLeft = m_block->logicalLeftOffsetForLine(floatLogicalBottom, shouldIndentText());
+ newLineRight = m_block->logicalRightOffsetForLine(floatLogicalBottom, shouldIndentText());
</ins><span class="cx"> newLineWidth = max(0.0f, newLineRight - newLineLeft);
</span><span class="cx"> lastFloatLogicalBottom = floatLogicalBottom;
</span><span class="cx"> if (newLineWidth >= m_uncommittedWidth)
</span><span class="lines">@@ -951,11 +957,25 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void updateLogicalInlinePositions(RenderBlock* block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine, LayoutUnit boxLogicalHeight)
</del><ins>+static IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBreak, RenderStyle* style)
</ins><span class="cx"> {
</span><ins>+ if (isFirstLine)
+ return IndentText;
+#if ENABLE(CSS3_TEXT)
+ if (isAfterHardLineBreak && style->textIndentLine() == TextIndentEachLine)
+ return IndentText;
+#else
+ UNUSED_PARAM(isAfterHardLineBreak);
+ UNUSED_PARAM(style);
+#endif
+ return DoNotIndentText;
+}
+
+static void updateLogicalInlinePositions(RenderBlock* block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine, IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight)
+{
</ins><span class="cx"> LayoutUnit lineLogicalHeight = logicalHeightForLine(block, firstLine, boxLogicalHeight);
</span><del>- lineLogicalLeft = block->pixelSnappedLogicalLeftOffsetForLine(block->logicalHeight(), firstLine, lineLogicalHeight);
- lineLogicalRight = block->pixelSnappedLogicalRightOffsetForLine(block->logicalHeight(), firstLine, lineLogicalHeight);
</del><ins>+ lineLogicalLeft = block->pixelSnappedLogicalLeftOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
+ lineLogicalRight = block->pixelSnappedLogicalRightOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
</ins><span class="cx"> availableLogicalWidth = lineLogicalRight - lineLogicalLeft;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -966,11 +986,15 @@
</span><span class="cx">
</span><span class="cx"> // CSS 2.1: "'Text-indent' only affects a line if it is the first formatted line of an element. For example, the first line of an anonymous block
</span><span class="cx"> // box is only affected if it is the first child of its parent element."
</span><del>- bool firstLine = lineInfo.isFirstLine() && !(isAnonymousBlock() && parent()->firstChild() != this);
</del><ins>+ // CSS3 "text-indent", "-webkit-each-line" affects the first line of the block container as well as each line after a forced line break,
+ // but does not affect lines after a soft wrap break.
+ bool isFirstLine = lineInfo.isFirstLine() && !(isAnonymousBlock() && parent()->firstChild() != this);
+ bool isAfterHardLineBreak = lineBox->prevRootBox() && lineBox->prevRootBox()->endsWithBreak();
+ IndentTextOrNot shouldIndentText = requiresIndent(isFirstLine, isAfterHardLineBreak, style());
</ins><span class="cx"> float lineLogicalLeft;
</span><span class="cx"> float lineLogicalRight;
</span><span class="cx"> float availableLogicalWidth;
</span><del>- updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, firstLine, 0);
</del><ins>+ updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, 0);
</ins><span class="cx"> bool needsWordSpacing;
</span><span class="cx"> #if ENABLE(CSS_EXCLUSIONS)
</span><span class="cx"> ExclusionShapeInsideInfo* exclusionShapeInsideInfo = layoutExclusionShapeInsideInfo();
</span><span class="lines">@@ -1006,7 +1030,7 @@
</span><span class="cx">
</span><span class="cx"> if (firstRun && firstRun->m_object->isReplaced()) {
</span><span class="cx"> RenderBox* renderBox = toRenderBox(firstRun->m_object);
</span><del>- updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, firstLine, renderBox->logicalHeight());
</del><ins>+ updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, renderBox->logicalHeight());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> computeInlineDirectionPositionsForSegment(lineBox, lineInfo, textAlign, lineLogicalLeft, availableLogicalWidth, firstRun, trailingSpaceRun, textBoxDataMap, verticalPositionCache, wordMeasurements);
</span><span class="lines">@@ -2635,7 +2659,7 @@
</span><span class="cx"> bool includeEndWidth = true;
</span><span class="cx"> LineMidpointState& lineMidpointState = resolver.midpointState();
</span><span class="cx">
</span><del>- LineWidth width(m_block, lineInfo.isFirstLine());
</del><ins>+ LineWidth width(m_block, lineInfo.isFirstLine(), requiresIndent(lineInfo.isFirstLine(), lineInfo.previousLineBrokeCleanly(), m_block->style()));
</ins><span class="cx">
</span><span class="cx"> skipLeadingWhitespace(resolver, lineInfo, lastFloatFromPreviousLine, width);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>