<!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>[191195] 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/191195">191195</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2015-10-16 12:53:04 -0700 (Fri, 16 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>First line box in paragraph using initial-letter overflows.
https://bugs.webkit.org/show_bug.cgi?id=147977
<rdar://problem/22901553>
Reviewed by David Hyatt.
When initial-letter float is present, we should shrink the first
line even if it's not intersected with the block's current height.
This is because of the sunken behaviour of initial-letter.
Source/WebCore:
Test: fast/css-generated-content/initial-letter-first-line-wrapping.html
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::positionNewFloatOnLine):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleFloat):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h:
(WebCore::LineBreaker::positionNewFloatOnLine):
* rendering/line/LineWidth.cpp:
(WebCore::newFloatShrinksLine):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/line/LineWidth.h:
LayoutTests:
* fast/css-generated-content/initial-letter-first-line-wrapping-expected.html: Added.
* fast/css-generated-content/initial-letter-first-line-wrapping.html: Added.
* platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt: progression.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastcssgeneratedcontentinitialletterbasicexpectedtxt">trunk/LayoutTests/platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContexth">trunk/Source/WebCore/rendering/line/BreakingContext.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakercpp">trunk/Source/WebCore/rendering/line/LineBreaker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakerh">trunk/Source/WebCore/rendering/line/LineBreaker.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineWidthcpp">trunk/Source/WebCore/rendering/line/LineWidth.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineWidthh">trunk/Source/WebCore/rendering/line/LineWidth.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterfirstlinewrappingexpectedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterfirstlinewrappinghtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/LayoutTests/ChangeLog        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-10-16 Zalan Bujtas <zalan@apple.com>
+
+ First line box in paragraph using initial-letter overflows.
+ https://bugs.webkit.org/show_bug.cgi?id=147977
+ <rdar://problem/22901553>
+
+ Reviewed by David Hyatt.
+
+ When initial-letter float is present, we should shrink the first
+ line even if it's not intersected with the block's current height.
+ This is because of the sunken behaviour of initial-letter.
+
+ * fast/css-generated-content/initial-letter-first-line-wrapping-expected.html: Added.
+ * fast/css-generated-content/initial-letter-first-line-wrapping.html: Added.
+ * platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt: progression.
+
</ins><span class="cx"> 2015-10-16 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><span class="cx"> Update testharness.js to web-platform-tests version
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterfirstlinewrappingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping-expected.html (0 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping-expected.html        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ body {
+ font-family: Ahem;
+ }
+
+ .container {
+         width: 200px;
+         border-right: 1px solid red;
+ }
+
+ .float {
+         width: 80px;
+         height: 80px;
+         float: left;
+ }
+</style>
+</head>
+<body>
+<div class=container><div class=float></div>ext should wrap at the red border.</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterfirstlinewrappinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping.html (0 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping.html         (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-first-line-wrapping.html        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ body {
+ font-family: Ahem;
+ }
+
+ div {
+         width: 200px;
+         border-right: 1px solid red;
+ }
+
+ div::first-letter {
+ -webkit-initial-letter: 5;
+ color: white;
+ }
+</style>
+</head>
+<body>
+<div>Text should wrap at the red border.</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastcssgeneratedcontentinitialletterbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/LayoutTests/platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -7,21 +7,21 @@
</span><span class="cx"> RenderBlock (floating) at (2,3) size 51x48
</span><span class="cx"> RenderText {#text} at (0,-17) size 51x82
</span><span class="cx"> text run at (0,-17) width 51: "A"
</span><del>- RenderText {#text} at (54,0) size 454x90
- text run at (54,0) width 400: "n example of first-letter. This letter should span 3 lines of text,"
- text run at (54,18) width 312: "and so it should align itself cleanly with the cap-"
- text run at (54,36) width 326: "height of the A lining up with the cap-height of the"
- text run at (0,54) width 394: "first line, and the baseline of the A lining up with the baseline"
- text run at (0,72) width 104: "of the third line."
</del><ins>+ RenderText {#text} at (54,0) size 394x90
+ text run at (54,0) width 316: "n example of first-letter. This letter should span 3"
+ text run at (54,18) width 340: "lines of text, and so it should align itself cleanly with"
+ text run at (54,36) width 337: "the cap-height of the A lining up with the cap-height"
+ text run at (0,54) width 378: "of the first line, and the baseline of the A lining up with the"
+ text run at (0,72) width 160: "baseline of the third line."
</ins><span class="cx"> RenderBlock {SPAN} at (0,106) size 784x90
</span><span class="cx"> RenderBlock {DIV} at (368,0) size 400x90
</span><span class="cx"> RenderBlock (floating) at (347,3) size 51x48
</span><span class="cx"> RenderText {#text} at (0,-17) size 51x82
</span><span class="cx"> text run at (0,-17) width 51: "A"
</span><del>- RenderText {#text} at (-53,0) size 454x90
- text run at (-53,0) width 399: "n RTL example of first-letter. This letter should span 3 lines of"
- text run at (2,18) width 344: "text, and so it should align itself cleanly with the cap-"
- text run at (20,36) width 326: "height of the A lining up with the cap-height of the"
- text run at (6,54) width 394: "first line, and the baseline of the A lining up with the baseline"
- text run at (296,72) width 5 RTL: "."
- text run at (300,72) width 100: "of the third line"
</del><ins>+ RenderText {#text} at (9,0) size 399x90
+ text run at (9,0) width 337: "n RTL example of first-letter. This letter should span"
+ text run at (26,18) width 320: "3 lines of text, and so it should align itself cleanly"
+ text run at (17,36) width 329: "with the cap-height of the A lining up with the cap-"
+ text run at (1,54) width 399: "height of the first line, and the baseline of the A lining up with"
+ text run at (216,72) width 5 RTL: "."
+ text run at (220,72) width 180: "the baseline of the third line"
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/ChangeLog        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-10-16 Zalan Bujtas <zalan@apple.com>
+
+ First line box in paragraph using initial-letter overflows.
+ https://bugs.webkit.org/show_bug.cgi?id=147977
+ <rdar://problem/22901553>
+
+ Reviewed by David Hyatt.
+
+ When initial-letter float is present, we should shrink the first
+ line even if it's not intersected with the block's current height.
+ This is because of the sunken behaviour of initial-letter.
+
+ Test: fast/css-generated-content/initial-letter-first-line-wrapping.html
+
+ * rendering/RenderBlockFlow.h:
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlockFlow::positionNewFloatOnLine):
+ * rendering/line/BreakingContext.h:
+ (WebCore::BreakingContext::handleFloat):
+ * rendering/line/LineBreaker.cpp:
+ (WebCore::LineBreaker::skipLeadingWhitespace):
+ * rendering/line/LineBreaker.h:
+ (WebCore::LineBreaker::positionNewFloatOnLine):
+ * rendering/line/LineWidth.cpp:
+ (WebCore::newFloatShrinksLine):
+ (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
+ * rendering/line/LineWidth.h:
+
</ins><span class="cx"> 2015-10-16 Keith Rollin <krollin@apple.com>
</span><span class="cx">
</span><span class="cx"> The value sanitization algorithm for input[type=url] should strip whitespaces
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -582,7 +582,7 @@
</span><span class="cx"> void checkLinesForTextOverflow();
</span><span class="cx"> // Positions new floats and also adjust all floats encountered on the line if any of them
</span><span class="cx"> // have to move to the next page/column.
</span><del>- bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo&, LineWidth&);
</del><ins>+ bool positionNewFloatOnLine(const FloatingObject& newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo&, LineWidth&);
</ins><span class="cx"> // This function is called to test a line box that has moved in the block direction to see if it has ended up in a new
</span><span class="cx"> // region/page/column that has a different available line width than the old one. Used to know when you have to dirty a
</span><span class="cx"> // line, i.e., that it can't be re-used.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -2059,7 +2059,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderBlockFlow::positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
</del><ins>+bool RenderBlockFlow::positionNewFloatOnLine(const FloatingObject& newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
</ins><span class="cx"> {
</span><span class="cx"> if (!positionNewFloats())
</span><span class="cx"> return false;
</span><span class="lines">@@ -2069,14 +2069,14 @@
</span><span class="cx"> // We only connect floats to lines for pagination purposes if the floats occur at the start of
</span><span class="cx"> // the line and the previous line had a hard break (so this line is either the first in the block
</span><span class="cx"> // or follows a <br>).
</span><del>- if (!newFloat->paginationStrut() || !lineInfo.previousLineBrokeCleanly() || !lineInfo.isEmpty())
</del><ins>+ if (!newFloat.paginationStrut() || !lineInfo.previousLineBrokeCleanly() || !lineInfo.isEmpty())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
</span><del>- ASSERT(floatingObjectSet.last().get() == newFloat);
</del><ins>+ ASSERT(floatingObjectSet.last().get() == &newFloat);
</ins><span class="cx">
</span><del>- LayoutUnit floatLogicalTop = logicalTopForFloat(newFloat);
- LayoutUnit paginationStrut = newFloat->paginationStrut();
</del><ins>+ LayoutUnit floatLogicalTop = logicalTopForFloat(&newFloat);
+ LayoutUnit paginationStrut = newFloat.paginationStrut();
</ins><span class="cx">
</span><span class="cx"> if (floatLogicalTop - paginationStrut != logicalHeight() + lineInfo.floatPaginationStrut())
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/BreakingContext.h (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContext.h        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/line/BreakingContext.h        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -449,7 +449,7 @@
</span><span class="cx"> // If it does, position it now, otherwise, position
</span><span class="cx"> // it after moving to next line (in clearFloats() func)
</span><span class="cx"> if (m_floatsFitOnLine && m_width.fitsOnLineExcludingTrailingWhitespace(m_block.logicalWidthForFloat(floatingObject))) {
</span><del>- m_lineBreaker.positionNewFloatOnLine(floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
</del><ins>+ m_lineBreaker.positionNewFloatOnLine(*floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
</ins><span class="cx"> if (m_lineBreakHistory.renderer() == m_current.renderer()) {
</span><span class="cx"> ASSERT(!m_lineBreakHistory.offset());
</span><span class="cx"> m_lineBreakHistory.increment();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> lineInfo.incrementRunsFromLeadingWhitespace();
</span><span class="cx"> }
</span><span class="cx"> } else if (object.isFloating())
</span><del>- m_block.positionNewFloatOnLine(m_block.insertFloatingObject(downcast<RenderBox>(object)), lastFloatFromPreviousLine, lineInfo, width);
</del><ins>+ m_block.positionNewFloatOnLine(*m_block.insertFloatingObject(downcast<RenderBox>(object)), lastFloatFromPreviousLine, lineInfo, width);
</ins><span class="cx"> else if (object.style().hasTextCombine() && is<RenderCombineText>(object)) {
</span><span class="cx"> downcast<RenderCombineText>(object).combineText();
</span><span class="cx"> if (downcast<RenderCombineText>(object).isCombined())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineBreaker.h (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.h        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.h        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> void skipLeadingWhitespace(InlineBidiResolver&, LineInfo&, FloatingObject* lastFloatFromPreviousLine, LineWidth&);
</span><span class="cx">
</span><span class="cx"> FloatingObject* insertFloatingObject(RenderBox& floatBox) { return m_block.insertFloatingObject(floatBox); }
</span><del>- bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
</del><ins>+ bool positionNewFloatOnLine(const FloatingObject& newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
</ins><span class="cx"> {
</span><span class="cx"> return m_block.positionNewFloatOnLine(newFloat, lastFloatFromPreviousLine, lineInfo, width);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineWidthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineWidth.cpp (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineWidth.cpp        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/line/LineWidth.cpp        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -76,22 +76,33 @@
</span><span class="cx"> computeAvailableWidthFromLeftAndRight();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject* newFloat)
</del><ins>+static bool newFloatShrinksLine(const FloatingObject& newFloat, const RenderBlockFlow& block, bool isFirstLine)
</ins><span class="cx"> {
</span><del>- LayoutUnit height = m_block.logicalHeight();
- if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logicalBottomForFloat(newFloat))
</del><ins>+ LayoutUnit blockOffset = block.logicalHeight();
+ if (blockOffset >= block.logicalTopForFloat(&newFloat) && blockOffset < block.logicalBottomForFloat(&newFloat))
+ return true;
+
+ // initial-letter float always shrinks the first line.
+ const auto& style = newFloat.renderer().style();
+ if (isFirstLine && style.styleType() == FIRST_LETTER && !style.initialLetter().isEmpty())
+ return true;
+ return false;
+}
+
+void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject& newFloat)
+{
+ if (!newFloatShrinksLine(newFloat, m_block, m_isFirstLine))
</ins><span class="cx"> return;
</span><del>-
</del><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><span class="cx"> ShapeOutsideDeltas shapeDeltas;
</span><del>- if (ShapeOutsideInfo* shapeOutsideInfo = newFloat->renderer().shapeOutsideInfo()) {
</del><ins>+ if (ShapeOutsideInfo* shapeOutsideInfo = newFloat.renderer().shapeOutsideInfo()) {
</ins><span class="cx"> LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
</span><del>- shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_block, *newFloat, m_block.logicalHeight(), lineHeight);
</del><ins>+ shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_block, newFloat, m_block.logicalHeight(), lineHeight);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- if (newFloat->type() == FloatingObject::FloatLeft) {
- float newLeft = m_block.logicalRightForFloat(newFloat);
</del><ins>+ if (newFloat.type() == FloatingObject::FloatLeft) {
+ float newLeft = m_block.logicalRightForFloat(&newFloat);
</ins><span class="cx"> if (shouldIndentText() && m_block.style().isLeftToRightDirection())
</span><span class="cx"> newLeft += floorToInt(m_block.textIndentOffset());
</span><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><span class="lines">@@ -104,7 +115,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> m_left = std::max<float>(m_left, newLeft);
</span><span class="cx"> } else {
</span><del>- float newRight = m_block.logicalLeftForFloat(newFloat);
</del><ins>+ float newRight = m_block.logicalLeftForFloat(&newFloat);
</ins><span class="cx"> if (shouldIndentText() && !m_block.style().isLeftToRightDirection())
</span><span class="cx"> newRight -= floorToInt(m_block.textIndentOffset());
</span><span class="cx"> #if ENABLE(CSS_SHAPES)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineWidthh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineWidth.h (191194 => 191195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineWidth.h        2015-10-16 19:52:42 UTC (rev 191194)
+++ trunk/Source/WebCore/rendering/line/LineWidth.h        2015-10-16 19:53:04 UTC (rev 191195)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> bool hasCommitted() const { return m_committedWidth > 0 || m_hasCommittedReplaced; }
</span><span class="cx">
</span><span class="cx"> void updateAvailableWidth(LayoutUnit minimumHeight = 0);
</span><del>- void shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject*);
</del><ins>+ void shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject&);
</ins><span class="cx"> void addUncommittedWidth(float delta)
</span><span class="cx"> {
</span><span class="cx"> m_uncommittedWidth += delta;
</span></span></pre>
</div>
</div>
</body>
</html>