<!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>[214110] 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/214110">214110</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2017-03-17 11:54:47 -0700 (Fri, 17 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Initial letter does not paginate properly.
https://bugs.webkit.org/show_bug.cgi?id=169795
&lt;rdar://problem/23715770&gt;

Reviewed by Zalan Bujtas.

Source/WebCore:

Tests: fast/css-generated-content/initial-letter-pagination-raised.html
       fast/css-generated-content/initial-letter-pagination-raised-rl.html
       fast/css-generated-content/initial-letter-pagination-sunken.html
       fast/css-generated-content/initial-letter-pagination-sunken-rl.html

* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::FloatingObject):
(WebCore::FloatingObject::copyToNewContainer):
(WebCore::FloatingObject::cloneForNewParent):
(WebCore::FloatingObject::translationOffsetToAncestor):
* rendering/FloatingObjects.h:
(WebCore::FloatingObject::setMarginOffset):
(WebCore::FloatingObject::locationOffsetOfBorderBox):
(WebCore::FloatingObject::marginOffset):
Add the margin offset to the FloatingObject so that we can control the
placement of the border box relative to the margin box without relying
on only the CSS-specified margins. This allows for sunken initial letter
FloatingObjects to be created and propagated out to ancestor blocks for painting
without altering the CSS margins of the sunken letter.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
Update the logical height for initial letter containers after the initial
letter shifts to the next page, since the lines that follow need to lay out
relative to the initial letter, i.e., they shift down if it shifts down.

(WebCore::RenderBlockFlow::addOverflowFromFloats):
(WebCore::RenderBlockFlow::paintFloats):
(WebCore::RenderBlockFlow::clipOutFloatingObjects):
Patched to use the new helpers on FloatingObject rather than
xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.

(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
Updated to set the placement and margins of the floating object before
returning. The initial letter adjustments have been factored out into their
own function.

(WebCore::RenderBlockFlow::adjustInitialLetterPosition):
A helper function called by computeLogicalLocationForFloat that handles
the placement and margin adjustments for initial letters. Note that sunken
letters no longer &quot;hack&quot; the top margin of the child but instead rely on
the fact that the FloatingObject has its own independent margin offset now
that can be set to a value that is distinct from the CSS supplied margin.

(WebCore::RenderBlockFlow::positionNewFloats):
Revised to no longer do the placement, but to let computeLogicalLocationForFloat
do it. The height is still set here however, since we don't know that until after
the child has received a layout.

(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
(WebCore::RenderBlockFlow::hitTestFloats):
(WebCore::RenderBlockFlow::adjustForBorderFit):
Patched to use the new FloatingObject helpers rather than
xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.

* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::setLogicalMarginsForFloat):
New helper function for setting the margin offsets on a FloatingObject.

(WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin): Deleted.
(WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin): Deleted.
Deleted in favor of new FloatingObject helpers.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::isUnsplittableForPagination):
Make initial letter unsplittable as far as pagination is concerned.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox):
(WebCore::RootInlineBox::includeFontForBox):
(WebCore::RootInlineBox::includeGlyphsForBox):
(WebCore::RootInlineBox::fitsToGlyphs):
Turn off the restriction that you can't fit to vertical glyphs. The numbers returned
are fine now. This allows vertical initial letters to work.

LayoutTests:

* fast/css-generated-content/initial-letter-pagination-raised-expected.html: Added.
* fast/css-generated-content/initial-letter-pagination-raised.html: Added.
* fast/css-generated-content/initial-letter-pagination-sunken-expected.html: Added.
* fast/css-generated-content/initial-letter-pagination-sunken.html: Added.
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmulticoltallimagebehaviorlrhtml">trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html</a></li>
<li><a href="#trunkLayoutTestsfastmulticoltallimagebehaviorrlhtml">trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastblocklineboxcontainblockwithideographsexpectedtxt">trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingFloatingObjectscpp">trunk/Source/WebCore/rendering/FloatingObjects.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingFloatingObjectsh">trunk/Source/WebCore/rendering/FloatingObjects.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxcpp">trunk/Source/WebCore/rendering/RootInlineBox.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedexpectedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedrlexpectedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedrlhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenexpectedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenrlexpectedhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenrlhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenhtml">trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/ChangeLog        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-03-17  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        Initial letter does not paginate properly.
+        https://bugs.webkit.org/show_bug.cgi?id=169795
+        &lt;rdar://problem/23715770&gt;
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/css-generated-content/initial-letter-pagination-raised-expected.html: Added.
+        * fast/css-generated-content/initial-letter-pagination-raised.html: Added.
+        * fast/css-generated-content/initial-letter-pagination-sunken-expected.html: Added.
+        * fast/css-generated-content/initial-letter-pagination-sunken.html: Added.
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2017-03-17  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         RealtimeIncomingAudioSource is not stopping properly
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            body { margin:0;  overflow:hidden  }
+            div.main { height:500px; width:800px; overflow:hidden; background-color:#eeeeee;  }
+            div.column { height:500px; width:200px; float:left }
+           .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:4 3;
+            initial-letter:5 3;
+            padding-right:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            height:90px;
+            background-color:#DEF;
+            width:200px;
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div class=&quot;main&quot;&gt;
+        &lt;div class=&quot;column&quot;&gt;
+            &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        &lt;/div&gt;
+        &lt;/div&gt;
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedrlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            html { writing-mode: vertical-rl }
+            body { margin:0;  overflow:hidden  }
+            div.main { position:absolute; right:0; top:0; width:500px; height:800px; overflow:hidden; background-color:#eeeeee;  }
+            div.column { width:500px; height:200px; float:left }
+           .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:4 3;
+            initial-letter:4 3;
+            padding-bottom:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            width:90px;
+            background-color:#DEF;
+            height:200px;
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div class=&quot;main&quot;&gt;
+        &lt;div class=&quot;column&quot;&gt;
+            &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        &lt;/div&gt;&lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        &lt;/div&gt;&lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        &lt;/div&gt;
+        &lt;/div&gt;
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedrlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            html { writing-mode: vertical-rl }
+            body { margin:0;  overflow:hidden  }
+            div { column-width:200px; width:500px; height:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+            .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:4 3;
+            initial-letter:4 3;
+            padding-bottom:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            width:90px;
+            background-color:#DEF;
+            height:200px;
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationraisedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            body { margin:0 ;  overflow:hidden }
+            div { column-width:200px; height:500px; width:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+            .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:4 3;
+            initial-letter:5 3;
+            padding-right:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            height:90px;
+            background-color:#DEF;
+            width:200px;
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            body { margin:0;  overflow:hidden  }
+            div.main { height:500px; width:800px; overflow:hidden; background-color:#eeeeee;  }
+            div.column { height:500px; width:200px; float:left }
+           .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:2 4;
+            initial-letter:2 4;
+            padding-right:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            height:90px;
+            background-color:#DEF;
+            width:200px;
+            
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div class=&quot;main&quot;&gt;
+        &lt;div class=&quot;column&quot;&gt;
+            &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        &lt;/div&gt;
+        &lt;/div&gt;
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenrlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            html { writing-mode: vertical-rl }
+            body { margin:0;  overflow:hidden  }
+            div.main {  position:absolute; right:0; top:0; width:500px; height:800px; overflow:hidden; background-color:#eeeeee;  }
+            div.column { width:500px; height:200px; float:left }
+           .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:2 4;
+            initial-letter:2 4;
+            padding-bottom:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            width:90px;
+            background-color:#DEF;
+            height:200px;
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div class=&quot;main&quot;&gt;
+        &lt;div class=&quot;column&quot;&gt;
+            &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;column&quot;&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        &lt;/div&gt;
+        &lt;/div&gt;
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenrlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            html { writing-mode: vertical-rl }
+            body { margin:0; overflow:hidden }
+            div { column-width:200px; height:800px; width:500px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+            .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:2 4;
+            initial-letter:2 4;
+            padding-bottom:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            width:90px;
+            background-color:#DEF;
+            height:200px;
+            
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgeneratedcontentinitialletterpaginationsunkenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html (0 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
+    &lt;head&gt;
+        &lt;title&gt;&lt;/title&gt;
+        &lt;meta charset=&quot;utf-8&quot; /&gt;
+        &lt;style&gt;
+            body { margin:0; overflow:hidden }
+            div { column-width:200px; height:500px; width:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+            .test-name {
+                font-size:1em;
+                font-weight:bold;
+                line-height:1.2;
+            }
+        p {
+            margin:0;
+        }
+        .drop::first-letter {
+            -webkit-initial-letter:2 4;
+            initial-letter:2 4;
+            padding-right:0.1em;
+            font-weight:normal;
+        }
+        .brk-after {
+            -webkit-column-break-after: always;
+        }
+        .most-of-the-page {
+            height:90px;
+            background-color:#DEF;
+            width:200px;
+            
+        }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div&gt;
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example A: This dropcap appears naturally at the top of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;brk-after&quot;&gt;This paragraph has page-break-after:always; set on it.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example B: This dropcap appears after a CSS-induced page break.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+        &lt;p class=&quot;most-of-the-page&quot;&gt;This block takes up most of a page, forcing the next paragraph to a new page.&lt;/p&gt;
+        
+        &lt;p class=&quot;drop&quot;&gt;&lt;b&gt;Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.&lt;/b&gt; Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. &lt;/p&gt;
+        
+              
+        
+        
+    &lt;/body&gt;
+&lt;/html&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticoltallimagebehaviorlrhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;!doctype html&gt;
</span><span class="cx"> &lt;body style=&quot;-webkit-writing-mode:vertical-lr&quot;&gt;
</span><del>-&lt;div style=&quot;-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:glyphs replaced&quot;&gt;
</del><ins>+&lt;div style=&quot;-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:font replaced&quot;&gt;
</ins><span class="cx"> &lt;p&gt;This image should not be split across columns.&lt;br&gt;
</span><span class="cx"> The reason it should not be split is that the line contains no
</span><span class="cx"> text and so we should be willing to allow it to sit at the top of a new
</span><span class="lines">@@ -9,4 +9,4 @@
</span><span class="cx"> &lt;div style=&quot;display:inline-block; width:100%; height:50px;background-color:lime&quot;&gt;&lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;display:inline-block; height:100%; width:50px;background-color:purple&quot;&gt;&lt;/div&gt;
</span><del>-&lt;/div&gt;&lt;/div&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/div&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticoltallimagebehaviorrlhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;!doctype html&gt;
</span><span class="cx"> &lt;body style=&quot;-webkit-writing-mode:vertical-rl&quot;&gt;
</span><del>-&lt;div style=&quot;-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:glyphs replaced&quot;&gt;
</del><ins>+&lt;div style=&quot;-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:font replaced&quot;&gt;
</ins><span class="cx"> &lt;p&gt;This image should not be split across columns.&lt;br&gt;
</span><span class="cx"> The reason it should not be split is that the line contains no
</span><span class="cx"> text and so we should be willing to allow it to sit at the top of a new
</span><span class="lines">@@ -9,4 +9,4 @@
</span><span class="cx"> &lt;div style=&quot;display:inline-block; width:100%; height:50px;background-color:lime&quot;&gt;&lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;display:inline-block; height:100%; width:50px;background-color:purple&quot;&gt;&lt;/div&gt;
</span><del>-&lt;/div&gt;&lt;/div&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/div&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -2913,3 +2913,8 @@
</span><span class="cx"> # Results differ from desktop
</span><span class="cx"> fast/hidpi/percent-height-image-nested.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Tests only match on desktop
+fast/css-generated-content/initial-letter-pagination-raised.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-sunken.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-raised-rl.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-sunken-rl.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastblocklineboxcontainblockwithideographsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -4,16 +4,16 @@
</span><span class="cx">   RenderBlock {html} at (0,0) size 785x637
</span><span class="cx">     RenderBody {body} at (8,8) size 769x621
</span><span class="cx">       RenderBlock {div} at (0,0) size 769x203
</span><del>-        RenderBlock {div} at (0,0) size 69x146 [border: (1px solid #FF0000)]
-          RenderText {#text} at (7,1) size 55x48
-            text run at (7,1) width 48: &quot;\x{70BA}&quot;
</del><ins>+        RenderBlock {div} at (0,0) size 57x146 [border: (1px solid #FF0000)]
+          RenderText {#text} at (1,1) size 55x48
+            text run at (1,1) width 48: &quot;\x{70BA}&quot;
</ins><span class="cx">           RenderRuby (inline) {ruby} at (0,0) size 55x48
</span><del>-            RenderRubyRun (anonymous) at (1,49) size 67x48
-              RenderRubyBase (anonymous) at (0,0) size 67x48
-                RenderText {#text} at (6,0) size 55x48
-                  text run at (6,0) width 48: &quot;\x{6AFB}&quot;
-          RenderText {#text} at (7,97) size 55x48
-            text run at (7,97) width 48: &quot;\x{7530}&quot;
</del><ins>+            RenderRubyRun (anonymous) at (1,49) size 55x48
+              RenderRubyBase (anonymous) at (0,0) size 55x48
+                RenderText {#text} at (0,0) size 55x48
+                  text run at (0,0) width 48: &quot;\x{6AFB}&quot;
+          RenderText {#text} at (1,97) size 55x48
+            text run at (1,97) width 48: &quot;\x{7530}&quot;
</ins><span class="cx">         RenderBlock {div} at (0,146) size 769x57 [border: (1px solid #008000)]
</span><span class="cx">           RenderText {#text} at (1,1) size 48x55
</span><span class="cx">             text run at (1,1) width 48: &quot;\x{70BA}&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/ChangeLog        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -1,3 +1,87 @@
</span><ins>+2017-03-17  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        Initial letter does not paginate properly.
+        https://bugs.webkit.org/show_bug.cgi?id=169795
+        &lt;rdar://problem/23715770&gt;
+
+        Reviewed by Zalan Bujtas.
+
+        Tests: fast/css-generated-content/initial-letter-pagination-raised.html
+               fast/css-generated-content/initial-letter-pagination-raised-rl.html
+               fast/css-generated-content/initial-letter-pagination-sunken.html
+               fast/css-generated-content/initial-letter-pagination-sunken-rl.html
+
+        * rendering/FloatingObjects.cpp:
+        (WebCore::FloatingObject::FloatingObject):
+        (WebCore::FloatingObject::copyToNewContainer):
+        (WebCore::FloatingObject::cloneForNewParent):
+        (WebCore::FloatingObject::translationOffsetToAncestor):
+        * rendering/FloatingObjects.h:
+        (WebCore::FloatingObject::setMarginOffset):
+        (WebCore::FloatingObject::locationOffsetOfBorderBox):
+        (WebCore::FloatingObject::marginOffset):
+        Add the margin offset to the FloatingObject so that we can control the
+        placement of the border box relative to the margin box without relying
+        on only the CSS-specified margins. This allows for sunken initial letter
+        FloatingObjects to be created and propagated out to ancestor blocks for painting
+        without altering the CSS margins of the sunken letter.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
+        Update the logical height for initial letter containers after the initial
+        letter shifts to the next page, since the lines that follow need to lay out
+        relative to the initial letter, i.e., they shift down if it shifts down.
+
+        (WebCore::RenderBlockFlow::addOverflowFromFloats):
+        (WebCore::RenderBlockFlow::paintFloats):
+        (WebCore::RenderBlockFlow::clipOutFloatingObjects):
+        Patched to use the new helpers on FloatingObject rather than
+        xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
+
+        (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
+        Updated to set the placement and margins of the floating object before
+        returning. The initial letter adjustments have been factored out into their
+        own function.
+
+        (WebCore::RenderBlockFlow::adjustInitialLetterPosition):
+        A helper function called by computeLogicalLocationForFloat that handles
+        the placement and margin adjustments for initial letters. Note that sunken
+        letters no longer &quot;hack&quot; the top margin of the child but instead rely on
+        the fact that the FloatingObject has its own independent margin offset now
+        that can be set to a value that is distinct from the CSS supplied margin.
+
+        (WebCore::RenderBlockFlow::positionNewFloats):
+        Revised to no longer do the placement, but to let computeLogicalLocationForFloat
+        do it. The height is still set here however, since we don't know that until after
+        the child has received a layout.
+
+        (WebCore::RenderBlockFlow::addOverhangingFloats):
+        (WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
+        (WebCore::RenderBlockFlow::hitTestFloats):
+        (WebCore::RenderBlockFlow::adjustForBorderFit):
+        Patched to use the new FloatingObject helpers rather than
+        xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
+
+        * rendering/RenderBlockFlow.h:
+        (WebCore::RenderBlockFlow::setLogicalMarginsForFloat):
+        New helper function for setting the margin offsets on a FloatingObject.
+
+        (WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin): Deleted.
+        (WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin): Deleted.
+        Deleted in favor of new FloatingObject helpers.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::isUnsplittableForPagination):
+        Make initial letter unsplittable as far as pagination is concerned.
+
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::ascentAndDescentForBox):
+        (WebCore::RootInlineBox::includeFontForBox):
+        (WebCore::RootInlineBox::includeGlyphsForBox):
+        (WebCore::RootInlineBox::fitsToGlyphs):
+        Turn off the restriction that you can't fit to vertical glyphs. The numbers returned
+        are fine now. This allows vertical initial letters to work.
+
</ins><span class="cx"> 2017-03-17  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         RealtimeIncomingAudioSource is not stopping properly
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingFloatingObjectscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/FloatingObjects.cpp (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/FloatingObjects.cpp        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/FloatingObjects.cpp        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     void* pointers[2];
</span><span class="cx">     LayoutRect rect;
</span><span class="cx">     int paginationStrut;
</span><ins>+    LayoutSize size;
</ins><span class="cx">     uint32_t bitfields : 8;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -43,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx"> FloatingObject::FloatingObject(RenderBox&amp; renderer)
</span><span class="cx">     : m_renderer(renderer)
</span><del>-    , m_originatingLine(nullptr)
-    , m_paginationStrut(0)
</del><span class="cx">     , m_shouldPaint(true)
</span><span class="cx">     , m_isDescendant(false)
</span><span class="cx">     , m_isPlaced(false)
</span><span class="lines">@@ -60,11 +59,10 @@
</span><span class="cx">         m_type = FloatRight;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatingObject::FloatingObject(RenderBox&amp; renderer, Type type, const LayoutRect&amp; frameRect, bool shouldPaint, bool isDescendant)
</del><ins>+FloatingObject::FloatingObject(RenderBox&amp; renderer, Type type, const LayoutRect&amp; frameRect, const LayoutSize&amp; marginOffset, bool shouldPaint, bool isDescendant)
</ins><span class="cx">     : m_renderer(renderer)
</span><del>-    , m_originatingLine(nullptr)
</del><span class="cx">     , m_frameRect(frameRect)
</span><del>-    , m_paginationStrut(0)
</del><ins>+    , m_marginOffset(marginOffset)
</ins><span class="cx">     , m_type(type)
</span><span class="cx">     , m_shouldPaint(shouldPaint)
</span><span class="cx">     , m_isDescendant(isDescendant)
</span><span class="lines">@@ -85,17 +83,22 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;FloatingObject&gt; FloatingObject::copyToNewContainer(LayoutSize offset, bool shouldPaint, bool isDescendant) const
</span><span class="cx"> {
</span><del>-    return std::make_unique&lt;FloatingObject&gt;(renderer(), type(), LayoutRect(frameRect().location() - offset, frameRect().size()), shouldPaint, isDescendant);
</del><ins>+    return std::make_unique&lt;FloatingObject&gt;(renderer(), type(), LayoutRect(frameRect().location() - offset, frameRect().size()), marginOffset(), shouldPaint, isDescendant);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;FloatingObject&gt; FloatingObject::cloneForNewParent() const
</span><span class="cx"> {
</span><del>-    auto cloneObject = std::make_unique&lt;FloatingObject&gt;(renderer(), type(), m_frameRect, m_shouldPaint, m_isDescendant);
</del><ins>+    auto cloneObject = std::make_unique&lt;FloatingObject&gt;(renderer(), type(), m_frameRect, m_marginOffset, m_shouldPaint, m_isDescendant);
</ins><span class="cx">     cloneObject-&gt;m_paginationStrut = m_paginationStrut;
</span><span class="cx">     cloneObject-&gt;m_isPlaced = m_isPlaced;
</span><span class="cx">     return cloneObject;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutSize FloatingObject::translationOffsetToAncestor() const
+{
+    return locationOffsetOfBorderBox() - renderer().locationOffset();
+}
+
</ins><span class="cx"> inline static bool rangesIntersect(LayoutUnit floatTop, LayoutUnit floatBottom, LayoutUnit objectTop, LayoutUnit objectBottom)
</span><span class="cx"> {
</span><span class="cx">     if (objectTop &gt;= floatBottom || objectBottom &lt; floatTop)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingFloatingObjectsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/FloatingObjects.h (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/FloatingObjects.h        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/FloatingObjects.h        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     std::unique_ptr&lt;FloatingObject&gt; cloneForNewParent() const;
</span><span class="cx"> 
</span><span class="cx">     explicit FloatingObject(RenderBox&amp;);
</span><del>-    FloatingObject(RenderBox&amp;, Type, const LayoutRect&amp;, bool shouldPaint, bool isDescendant);
</del><ins>+    FloatingObject(RenderBox&amp;, Type, const LayoutRect&amp;, const LayoutSize&amp;, bool shouldPaint, bool isDescendant);
</ins><span class="cx"> 
</span><span class="cx">     Type type() const { return static_cast&lt;Type&gt;(m_type); }
</span><span class="cx">     RenderBox&amp; renderer() const { return m_renderer; }
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     void setWidth(LayoutUnit width) { ASSERT(!isInPlacedTree()); m_frameRect.setWidth(width); }
</span><span class="cx">     void setHeight(LayoutUnit height) { ASSERT(!isInPlacedTree()); m_frameRect.setHeight(height); }
</span><span class="cx"> 
</span><ins>+    void setMarginOffset(LayoutSize offset) { ASSERT(!isInPlacedTree()); m_marginOffset = offset; }
+
</ins><span class="cx">     const LayoutRect&amp; frameRect() const { ASSERT(isPlaced()); return m_frameRect; }
</span><span class="cx">     void setFrameRect(const LayoutRect&amp; frameRect) { ASSERT(!isInPlacedTree()); m_frameRect = frameRect; }
</span><span class="cx"> 
</span><span class="lines">@@ -83,11 +85,20 @@
</span><span class="cx">     RootInlineBox* originatingLine() const { return m_originatingLine; }
</span><span class="cx">     void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; }
</span><span class="cx"> 
</span><ins>+    LayoutSize locationOffsetOfBorderBox() const
+    {
+        ASSERT(isPlaced());
+        return LayoutSize(m_frameRect.location().x() + m_marginOffset.width(), m_frameRect.location().y() + m_marginOffset.height());
+    }
+    LayoutSize marginOffset() const { ASSERT(isPlaced()); return m_marginOffset; }
+    LayoutSize translationOffsetToAncestor() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     RenderBox&amp; m_renderer;
</span><del>-    RootInlineBox* m_originatingLine;
</del><ins>+    RootInlineBox* m_originatingLine { nullptr };
</ins><span class="cx">     LayoutRect m_frameRect;
</span><span class="cx">     LayoutUnit m_paginationStrut;
</span><ins>+    LayoutSize m_marginOffset;
</ins><span class="cx"> 
</span><span class="cx">     unsigned m_type : 2; // Type (left or right aligned)
</span><span class="cx">     unsigned m_shouldPaint : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -1862,13 +1862,13 @@
</span><span class="cx">     return (endRegion &amp;&amp; region != endRegion);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox&amp; child, LayoutUnit logicalOffset, bool includeMargins)
</del><ins>+LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox&amp; child, LayoutUnit logicalOffset, LayoutUnit childBeforeMargin, LayoutUnit childAfterMargin)
</ins><span class="cx"> {
</span><span class="cx">     if (!childBoxIsUnsplittableForFragmentation(child))
</span><span class="cx">         return logicalOffset;
</span><span class="cx"> 
</span><span class="cx">     RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><del>-    LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : LayoutUnit());
</del><ins>+    LayoutUnit childLogicalHeight = logicalHeightForChild(child) + childBeforeMargin + childAfterMargin;
</ins><span class="cx">     LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
</span><span class="cx">     bool hasUniformPageLogicalHeight = !flowThread || flowThread-&gt;regionsHaveUniformLogicalHeight();
</span><span class="cx">     updateMinimumPageHeight(logicalOffset, childLogicalHeight);
</span><span class="lines">@@ -1879,8 +1879,15 @@
</span><span class="cx">     if (remainingLogicalHeight &lt; childLogicalHeight) {
</span><span class="cx">         if (!hasUniformPageLogicalHeight &amp;&amp; !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, childLogicalHeight))
</span><span class="cx">             return logicalOffset;
</span><del>-        return logicalOffset + remainingLogicalHeight;
</del><ins>+        auto result = logicalOffset + remainingLogicalHeight;
+        bool isInitialLetter = child.isFloating() &amp;&amp; child.style().styleType() == FIRST_LETTER &amp;&amp; child.style().initialLetterDrop() &gt; 0;
+        if (isInitialLetter) {
+            // Increase our logical height to ensure that lines all get pushed along with the letter.
+            setLogicalHeight(logicalOffset + remainingLogicalHeight);
+        }
+        return result;
</ins><span class="cx">     }
</span><ins>+
</ins><span class="cx">     return logicalOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2166,7 +2173,7 @@
</span><span class="cx">     for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><span class="cx">         const auto&amp; floatingObject = *it-&gt;get();
</span><span class="cx">         if (floatingObject.isDescendant())
</span><del>-            addOverflowFromChild(&amp;floatingObject.renderer(), IntSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
</del><ins>+            addOverflowFromChild(&amp;floatingObject.renderer(), floatingObject.locationOffsetOfBorderBox());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2233,10 +2240,7 @@
</span><span class="cx">         if (floatingObject.shouldPaint() &amp;&amp; !renderer.hasSelfPaintingLayer()) {
</span><span class="cx">             PaintInfo currentPaintInfo(paintInfo);
</span><span class="cx">             currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
</span><del>-            // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
-            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject,
-                LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject) - renderer.x(),
-                paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject) - renderer.y()));
</del><ins>+            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, paintOffset + floatingObject.translationOffsetToAncestor());
</ins><span class="cx">             renderer.paint(currentPaintInfo, childPoint);
</span><span class="cx">             if (!preservePhase) {
</span><span class="cx">                 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
</span><span class="lines">@@ -2259,9 +2263,8 @@
</span><span class="cx">         auto end = floatingObjectSet.end();
</span><span class="cx">         for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><span class="cx">             const auto&amp; floatingObject = *it-&gt;get();
</span><del>-            LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(floatingObject),
-                offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floatingObject),
-                floatingObject.renderer().width(), floatingObject.renderer().height());
</del><ins>+            LayoutRect floatBox(offsetFromRootBlock.width(), offsetFromRootBlock.height(), floatingObject.renderer().width(), floatingObject.renderer().height());
+            floatBox.move(floatingObject.locationOffsetOfBorderBox());
</ins><span class="cx">             rootBlock.flipForWritingMode(floatBox);
</span><span class="cx">             floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
</span><span class="cx">             paintInfo-&gt;context().clipOut(snappedIntRect(floatBox));
</span><span class="lines">@@ -2392,7 +2395,7 @@
</span><span class="cx">     return adjustLogicalRightOffsetForLine(offset, applyTextIndent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutPoint RenderBlockFlow::computeLogicalLocationForFloat(const FloatingObject&amp; floatingObject, LayoutUnit logicalTopOffset)
</del><ins>+void RenderBlockFlow::computeLogicalLocationForFloat(FloatingObject&amp; floatingObject, LayoutUnit&amp; logicalTopOffset)
</ins><span class="cx"> {
</span><span class="cx">     auto&amp; childBox = floatingObject.renderer();
</span><span class="cx">     LayoutUnit logicalLeftOffset = logicalLeftOffsetForContent(logicalTopOffset); // Constant part of left offset.
</span><span class="lines">@@ -2448,37 +2451,49 @@
</span><span class="cx">         floatLogicalLeft -= logicalWidthForFloat(floatingObject);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (isInitialLetter) {
-        const RenderStyle&amp; style = firstLineStyle();
-        const FontMetrics&amp; fontMetrics = style.fontMetrics();
-        if (fontMetrics.hasCapHeight()) {
-            LayoutUnit heightOfLine = lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
-            LayoutUnit beforeMarginBorderPadding = childBox.borderAndPaddingBefore() + childBox.marginBefore();
-            
-            // Make an adjustment to align with the cap height of a theoretical block line.
-            LayoutUnit adjustment = fontMetrics.ascent() + (heightOfLine - fontMetrics.height()) / 2 - fontMetrics.capHeight() - beforeMarginBorderPadding;
-            logicalTopOffset += adjustment;
-           
-            // For sunken and raised caps, we have to make some adjustments. Test if we're sunken or raised (dropHeightDelta will be
-            // positive for raised and negative for sunken).
-            int dropHeightDelta = childBox.style().initialLetterHeight() - childBox.style().initialLetterDrop();
-            
-            // If we're sunken, the float needs to shift down but lines still need to avoid it. In order to do that we increase the float's margin.
-            if (dropHeightDelta &lt; 0) {
-                LayoutUnit marginTopIncrease = -dropHeightDelta * heightOfLine;
-                childBox.setMarginBefore(childBox.marginTop() + marginTopIncrease);
-            }
-            
-            // If we're raised, then we actually have to grow the height of the block, since the lines have to be pushed down as though we're placing
-            // empty lines beside the first letter.
-            if (dropHeightDelta &gt; 0)
-                setLogicalHeight(logicalHeight() + dropHeightDelta * heightOfLine);
-        }
-    }
</del><ins>+    LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
+    LayoutUnit childBeforeMargin = marginBeforeForChild(childBox);
</ins><span class="cx">     
</span><del>-    return LayoutPoint(floatLogicalLeft, logicalTopOffset);
</del><ins>+    if (isInitialLetter)
+        adjustInitialLetterPosition(childBox, logicalTopOffset, childBeforeMargin);
+    
+    setLogicalLeftForFloat(floatingObject, floatLogicalLeft);
+    setLogicalLeftForChild(childBox, floatLogicalLeft + childLogicalLeftMargin);
+    
+    setLogicalTopForFloat(floatingObject, logicalTopOffset);
+    setLogicalTopForChild(childBox, logicalTopOffset + childBeforeMargin);
+    
+    setLogicalMarginsForFloat(floatingObject, childLogicalLeftMargin, childBeforeMargin);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderBlockFlow::adjustInitialLetterPosition(RenderBox&amp; childBox, LayoutUnit&amp; logicalTopOffset, LayoutUnit&amp; marginBeforeOffset)
+{
+    const RenderStyle&amp; style = firstLineStyle();
+    const FontMetrics&amp; fontMetrics = style.fontMetrics();
+    if (!fontMetrics.hasCapHeight())
+        return;
+
+    LayoutUnit heightOfLine = lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
+    LayoutUnit beforeMarginBorderPadding = childBox.borderAndPaddingBefore() + childBox.marginBefore();
+    
+    // Make an adjustment to align with the cap height of a theoretical block line.
+    LayoutUnit adjustment = fontMetrics.ascent() + (heightOfLine - fontMetrics.height()) / 2 - fontMetrics.capHeight() - beforeMarginBorderPadding;
+    logicalTopOffset += adjustment;
+
+    // For sunken and raised caps, we have to make some adjustments. Test if we're sunken or raised (dropHeightDelta will be
+    // positive for raised and negative for sunken).
+    int dropHeightDelta = childBox.style().initialLetterHeight() - childBox.style().initialLetterDrop();
+    
+    // If we're sunken, the float needs to shift down but lines still need to avoid it. In order to do that we increase the float's margin.
+    if (dropHeightDelta &lt; 0)
+        marginBeforeOffset += -dropHeightDelta * heightOfLine;
+    
+    // If we're raised, then we actually have to grow the height of the block, since the lines have to be pushed down as though we're placing
+    // empty lines beside the first letter.
+    if (dropHeightDelta &gt; 0)
+        setLogicalHeight(logicalHeight() + dropHeightDelta * heightOfLine);
+}
+
</ins><span class="cx"> bool RenderBlockFlow::positionNewFloats()
</span><span class="cx"> {
</span><span class="cx">     if (!m_floatingObjects)
</span><span class="lines">@@ -2524,8 +2539,6 @@
</span><span class="cx">         if (childBox.containingBlock() != this)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
-
</del><span class="cx">         LayoutRect oldRect = childBox.frameRect();
</span><span class="cx"> 
</span><span class="cx">         if (childBox.style().clear() &amp; CLEFT)
</span><span class="lines">@@ -2533,28 +2546,24 @@
</span><span class="cx">         if (childBox.style().clear() &amp; CRIGHT)
</span><span class="cx">             logicalTop = std::max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop);
</span><span class="cx"> 
</span><del>-        LayoutPoint floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, logicalTop);
</del><ins>+        computeLogicalLocationForFloat(floatingObject, logicalTop);
+        LayoutUnit childLogicalTop = logicalTopForChild(childBox);
</ins><span class="cx"> 
</span><del>-        setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
-        setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
-        setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
-
</del><span class="cx">         estimateRegionRangeForBoxChild(childBox);
</span><span class="cx"> 
</span><span class="cx">         childBox.markForPaginationRelayoutIfNeeded();
</span><span class="cx">         childBox.layoutIfNeeded();
</span><del>-        
</del><ins>+
</ins><span class="cx">         LayoutState* layoutState = view().layoutState();
</span><span class="cx">         bool isPaginated = layoutState-&gt;isPaginated();
</span><span class="cx">         if (isPaginated) {
</span><span class="cx">             // If we are unsplittable and don't fit, then we need to move down.
</span><span class="cx">             // We include our margins as part of the unsplittable area.
</span><del>-            LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, floatLogicalLocation.y(), true);
</del><ins>+            LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, logicalTop, childLogicalTop - logicalTop, marginAfterForChild(childBox));
</ins><span class="cx">             
</span><span class="cx">             // See if we have a pagination strut that is making us move down further.
</span><del>-            // Note that an unsplittable child can't also have a pagination strut, so this is
-            // exclusive with the case above.
</del><ins>+            // Note that an unsplittable child can't also have a pagination strut, so this
+            // is exclusive with the case above.
</ins><span class="cx">             RenderBlock* childBlock = is&lt;RenderBlock&gt;(childBox) ? &amp;downcast&lt;RenderBlock&gt;(childBox) : nullptr;
</span><span class="cx">             if (childBlock &amp;&amp; childBlock-&gt;paginationStrut()) {
</span><span class="cx">                 newLogicalTop += childBlock-&gt;paginationStrut();
</span><span class="lines">@@ -2561,18 +2570,13 @@
</span><span class="cx">                 childBlock-&gt;setPaginationStrut(0);
</span><span class="cx">             }
</span><span class="cx">             
</span><del>-            if (newLogicalTop != floatLogicalLocation.y()) {
-                floatingObject.setPaginationStrut(newLogicalTop - floatLogicalLocation.y());
-
-                floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, newLogicalTop);
-                setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
-                setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
-                setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
-        
</del><ins>+            if (newLogicalTop != logicalTop) {
+                floatingObject.setPaginationStrut(newLogicalTop - logicalTop);
+                computeLogicalLocationForFloat(floatingObject, newLogicalTop);
</ins><span class="cx">                 if (childBlock)
</span><span class="cx">                     childBlock-&gt;setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx">                 childBox.layoutIfNeeded();
</span><ins>+                logicalTop = newLogicalTop;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             if (updateRegionRangeForBoxChild(childBox)) {
</span><span class="lines">@@ -2581,10 +2585,8 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        setLogicalTopForFloat(floatingObject, floatLogicalLocation.y());
</del><ins>+        setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + (logicalTopForChild(childBox) - logicalTop) + marginAfterForChild(childBox));
</ins><span class="cx"> 
</span><del>-        setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox));
-
</del><span class="cx">         m_floatingObjects-&gt;addPlacedObject(&amp;floatingObject);
</span><span class="cx"> 
</span><span class="cx">         if (ShapeOutsideInfo* shapeOutside = childBox.shapeOutsideInfo())
</span><span class="lines">@@ -2733,7 +2735,7 @@
</span><span class="cx">             
</span><span class="cx">             // Since the float doesn't overhang, it didn't get put into our list. We need to add its overflow in to the child now.
</span><span class="cx">             if (floatingObject.isDescendant())
</span><del>-                child.addOverflowFromChild(&amp;renderer, LayoutSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
</del><ins>+                child.addOverflowFromChild(&amp;renderer, floatingObject.locationOffsetOfBorderBox());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return lowestFloatLogicalBottom;
</span><span class="lines">@@ -2851,8 +2853,8 @@
</span><span class="cx">     // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped
</span><span class="cx">     // case.
</span><span class="cx">     if (isHorizontalWritingMode())
</span><del>-        return LayoutPoint(point.x(), point.y() + height() - child.renderer().height() - 2 * yPositionForFloatIncludingMargin(child));
-    return LayoutPoint(point.x() + width() - child.renderer().width() - 2 * xPositionForFloatIncludingMargin(child), point.y());
</del><ins>+        return LayoutPoint(point.x(), point.y() + height() - child.renderer().height() - 2 * child.locationOffsetOfBorderBox().height());
+    return LayoutPoint(point.x() + width() - child.renderer().width() - 2 * child.locationOffsetOfBorderBox().width(), point.y());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderBlockFlow::getClearDelta(RenderBox&amp; child, LayoutUnit logicalTop)
</span><span class="lines">@@ -2943,9 +2945,7 @@
</span><span class="cx">         const auto&amp; floatingObject = *it-&gt;get();
</span><span class="cx">         auto&amp; renderer = floatingObject.renderer();
</span><span class="cx">         if (floatingObject.shouldPaint() &amp;&amp; !renderer.hasSelfPaintingLayer()) {
</span><del>-            LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - renderer.x();
-            LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - renderer.y();
-            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset));
</del><ins>+            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + floatingObject.translationOffsetToAncestor());
</ins><span class="cx">             if (renderer.hitTest(request, result, locationInContainer, childPoint)) {
</span><span class="cx">                 updateHitTestResult(result, locationInContainer.point() - toLayoutSize(childPoint));
</span><span class="cx">                 return true;
</span><span class="lines">@@ -3003,7 +3003,7 @@
</span><span class="cx">             const auto&amp; floatingObject = *it-&gt;get();
</span><span class="cx">             // Only examine the object if our m_shouldPaint flag is set.
</span><span class="cx">             if (floatingObject.shouldPaint()) {
</span><del>-                LayoutUnit floatLeft = xPositionForFloatIncludingMargin(floatingObject) - floatingObject.renderer().x();
</del><ins>+                LayoutUnit floatLeft = floatingObject.translationOffsetToAncestor().width();
</ins><span class="cx">                 LayoutUnit floatRight = floatLeft + floatingObject.renderer().width();
</span><span class="cx">                 left = std::min(left, floatLeft);
</span><span class="cx">                 right = std::max(right, floatRight);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -333,10 +333,14 @@
</span><span class="cx">         else
</span><span class="cx">             floatingObject.setHeight(logicalWidth);
</span><span class="cx">     }
</span><ins>+    void setLogicalMarginsForFloat(FloatingObject&amp; floatingObject, LayoutUnit logicalLeftMargin, LayoutUnit logicalBeforeMargin)
+    {
+        if (isHorizontalWritingMode())
+            floatingObject.setMarginOffset(LayoutSize(logicalLeftMargin, logicalBeforeMargin));
+        else
+            floatingObject.setMarginOffset(LayoutSize(logicalBeforeMargin, logicalLeftMargin));
+    }
</ins><span class="cx"> 
</span><del>-    LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject&amp; floatingObject) const { return isHorizontalWritingMode() ? floatingObject.x() + floatingObject.renderer().marginLeft() : floatingObject.x() + marginBeforeForChild(floatingObject.renderer()); }
-    LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject&amp; floatingObject) const { return isHorizontalWritingMode() ? floatingObject.y() + marginBeforeForChild(floatingObject.renderer()) : floatingObject.y() + floatingObject.renderer().marginTop(); }
-
</del><span class="cx">     LayoutPoint flipFloatForWritingModeForChild(const FloatingObject&amp;, const LayoutPoint&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     RenderLineBoxList&amp; lineBoxes() { return m_lineBoxes; }
</span><span class="lines">@@ -409,7 +413,7 @@
</span><span class="cx">     bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit&amp; adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const;
</span><span class="cx"> 
</span><span class="cx">     // If the child is unsplittable and can't fit on the current page, return the top of the next page/column.
</span><del>-    LayoutUnit adjustForUnsplittableChild(RenderBox&amp; child, LayoutUnit logicalOffset, bool includeMargins = false);
</del><ins>+    LayoutUnit adjustForUnsplittableChild(RenderBox&amp; child, LayoutUnit logicalOffset, LayoutUnit beforeMargin = LayoutUnit(), LayoutUnit afterMargin = LayoutUnit());
</ins><span class="cx">     LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, LayoutUnit estimateWithoutPagination, RenderBox&amp; child, bool atBeforeSideOfBlock);
</span><span class="cx">     LayoutUnit applyBeforeBreak(RenderBox&amp; child, LayoutUnit logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
</span><span class="cx">     LayoutUnit applyAfterBreak(RenderBox&amp; child, LayoutUnit logicalOffset, MarginInfo&amp;); // If the child has an after break, then return a new offset that shifts to the top of the next page/column.
</span><span class="lines">@@ -492,7 +496,7 @@
</span><span class="cx">     FloatingObject* insertFloatingObject(RenderBox&amp;);
</span><span class="cx">     void removeFloatingObject(RenderBox&amp;);
</span><span class="cx">     void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
</span><del>-    LayoutPoint computeLogicalLocationForFloat(const FloatingObject&amp;, LayoutUnit logicalTopOffset);
</del><ins>+    void computeLogicalLocationForFloat(FloatingObject&amp;, LayoutUnit&amp; logicalTopOffset);
</ins><span class="cx"> 
</span><span class="cx">     // Called from lineWidth, to position the floats added in the last line.
</span><span class="cx">     // Returns true if and only if it has positioned any floats.
</span><span class="lines">@@ -599,6 +603,8 @@
</span><span class="cx"> 
</span><span class="cx">     void computeInlinePreferredLogicalWidths(LayoutUnit&amp; minLogicalWidth, LayoutUnit&amp; maxLogicalWidth) const;
</span><span class="cx"> 
</span><ins>+    void adjustInitialLetterPosition(RenderBox&amp; childBox, LayoutUnit&amp; logicalTopOffset, LayoutUnit&amp; marginBeforeOffset);
+
</ins><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">     int m_widthForTextAutosizing;
</span><span class="cx">     unsigned m_lineCountForTextAutosizing : 2;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -4750,6 +4750,7 @@
</span><span class="cx">     return isReplaced()
</span><span class="cx">         || hasUnsplittableScrollingOverflow()
</span><span class="cx">         || (parent() &amp;&amp; isWritingModeRoot())
</span><ins>+        || (isFloating() &amp;&amp; style().styleType() == FIRST_LETTER &amp;&amp; style().initialLetterDrop() &gt; 0)
</ins><span class="cx">         || isRenderNamedFlowFragmentContainer()
</span><span class="cx">         || fixedPositionedWithNamedFlowContainingBlock();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (214109 => 214110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.cpp        2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp        2017-03-17 18:54:47 UTC (rev 214110)
</span><span class="lines">@@ -986,8 +986,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (includeInitialLetterForBox(box)) {
</span><del>-        // FIXME: Can't use glyph bounds in vertical writing mode because they are garbage.
-        bool canUseGlyphs = isHorizontal() &amp;&amp; glyphOverflow &amp;&amp; glyphOverflow-&gt;computeBounds;
</del><ins>+        bool canUseGlyphs = glyphOverflow &amp;&amp; glyphOverflow-&gt;computeBounds;
</ins><span class="cx">         int letterAscent = baselineType() == AlphabeticBaseline ? boxLineStyle.fontMetrics().capHeight() : (canUseGlyphs ? glyphOverflow-&gt;top : boxLineStyle.fontMetrics().ascent(baselineType()));
</span><span class="cx">         int letterDescent = canUseGlyphs ? glyphOverflow-&gt;bottom : (box.isRootInlineBox() ? 0 : boxLineStyle.fontMetrics().descent(baselineType()));
</span><span class="cx">         setAscentAndDescent(ascent, descent, letterAscent, letterDescent, ascentDescentSet);
</span><span class="lines">@@ -1104,9 +1103,8 @@
</span><span class="cx">     if (!box.behavesLikeText() &amp;&amp; is&lt;InlineFlowBox&gt;(box) &amp;&amp; !downcast&lt;InlineFlowBox&gt;(box).hasTextChildren())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    // For now map &quot;glyphs&quot; to &quot;font&quot; in vertical text mode until the bounds returned by glyphs aren't garbage.
</del><span class="cx">     LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
</span><del>-    return (lineBoxContain &amp; LineBoxContainFont) || (!isHorizontal() &amp;&amp; (lineBoxContain &amp; LineBoxContainGlyphs));
</del><ins>+    return (lineBoxContain &amp; LineBoxContainFont);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RootInlineBox::includeGlyphsForBox(InlineBox&amp; box) const
</span><span class="lines">@@ -1117,9 +1115,8 @@
</span><span class="cx">     if (!box.behavesLikeText() &amp;&amp; is&lt;InlineFlowBox&gt;(box) &amp;&amp; !downcast&lt;InlineFlowBox&gt;(box).hasTextChildren())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    // FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
</del><span class="cx">     LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
</span><del>-    return isHorizontal() &amp;&amp; (lineBoxContain &amp; LineBoxContainGlyphs);
</del><ins>+    return (lineBoxContain &amp; LineBoxContainGlyphs);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RootInlineBox::includeInitialLetterForBox(InlineBox&amp; box) const
</span><span class="lines">@@ -1146,9 +1143,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool RootInlineBox::fitsToGlyphs() const
</span><span class="cx"> {
</span><del>-    // FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
</del><span class="cx">     LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
</span><del>-    return isHorizontal() &amp;&amp; ((lineBoxContain &amp; LineBoxContainGlyphs) || (lineBoxContain &amp; LineBoxContainInitialLetter));
</del><ins>+    return ((lineBoxContain &amp; LineBoxContainGlyphs) || (lineBoxContain &amp; LineBoxContainInitialLetter));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RootInlineBox::includesRootLineBoxFontOrLeading() const
</span></span></pre>
</div>
</div>

</body>
</html>