<!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>[178822] 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/178822">178822</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2015-01-21 02:02:59 -0800 (Wed, 21 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
https://bugs.webkit.org/show_bug.cgi?id=138424

Reviewed by Benjamin Poulain.

Source/WebCore:

Source/WebCore:

According to the grid and flexbox specs:
&quot;::first-letter pseudo-element do not apply to grid/flex containers&quot;.
http://dev.w3.org/csswg/css-grid/#grid-containers
http://dev.w3.org/csswg/css-flexbox/#flex-containers

Check also the CSS WG mailing list discussion:
http://lists.w3.org/Archives/Public/www-style/2014Dec/0305.html

This was almost working right, except in the case that an ancestor was
setting the ::first-letter pseudo-element.

Added a few more cases to the current tests in order to check this
behavior.
Also created some new tests to increase coverage

Tests: fast/css/first-letter-from-ancestors-not-apply-inline-elements.html
       fast/css/first-letter-ignores-display-property.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::getFirstLetter): Go to the next sibling when
looking for the first text child if you reach a grid or flexbox.

LayoutTests:

Modified current tests to check that first-letter from ancestors is
ignored too.
Added 2 new tests to increase coverage.

* css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt:
* css3/flexbox/flexbox-ignore-container-firstLetter.html:
* fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt:
* fast/css-grid-layout/grid-container-ignore-first-letter.html:
* fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html: Added.
* fast/css/first-letter-from-ancestors-not-apply-inline-elements.html: Added.
* fast/css/first-letter-ignores-display-property-expected.html: Added.
* fast/css/first-letter-ignores-display-property.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3flexboxflexboxignorecontainerfirstLetterexpectedtxt">trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3flexboxflexboxignorecontainerfirstLetterhtml">trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontainerignorefirstletterexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontainerignorefirstletterhtml">trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssfirstletterfromancestorsnotapplyinlineelementsexpectedhtml">trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssfirstletterfromancestorsnotapplyinlineelementshtml">trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements.html</a></li>
<li><a href="#trunkLayoutTestsfastcssfirstletterignoresdisplaypropertyexpectedhtml">trunk/LayoutTests/fast/css/first-letter-ignores-display-property-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssfirstletterignoresdisplaypropertyhtml">trunk/LayoutTests/fast/css/first-letter-ignores-display-property.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/LayoutTests/ChangeLog        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-01-21  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
+        https://bugs.webkit.org/show_bug.cgi?id=138424
+
+        Reviewed by Benjamin Poulain.
+
+        Modified current tests to check that first-letter from ancestors is
+        ignored too.
+        Added 2 new tests to increase coverage.
+
+        * css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt:
+        * css3/flexbox/flexbox-ignore-container-firstLetter.html:
+        * fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt:
+        * fast/css-grid-layout/grid-container-ignore-first-letter.html:
+        * fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html: Added.
+        * fast/css/first-letter-from-ancestors-not-apply-inline-elements.html: Added.
+        * fast/css/first-letter-ignores-display-property-expected.html: Added.
+        * fast/css/first-letter-ignores-display-property.html: Added.
+
</ins><span class="cx"> 2015-01-20  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Unreviewed gardening.
</span></span></pre></div>
<a id="trunkLayoutTestscss3flexboxflexboxignorecontainerfirstLetterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -1,7 +1,80 @@
</span><span class="cx"> This test flex item should ignore container's firstLetter pseudo element.
</span><span class="cx"> 
</span><span class="cx"> The first item.
</span><del>-
</del><span class="cx"> The second item.
</span><del>-
</del><span class="cx"> PASS
</span><ins>+The first item.
+The second item.
+ PASS
+Anonymous item.
+PASS
+Anonymous item.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+Anonymous item.
+Out of flexbox.
+PASS
+Anonymous item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+The first item.
+The second item.
+Out of flexbox.
+PASS
+Anonymous item.
+Out of flexbox.
+PASS
+Anonymous item.
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
+Out of flexbox.
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestscss3flexboxflexboxignorecontainerfirstLetterhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -2,20 +2,223 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;link href=&quot;resources/flexbox.css&quot; rel=&quot;stylesheet&quot;&gt;
</span><span class="cx"> &lt;style&gt;
</span><del>-    .container::first-letter { line-height: 100px; }
-    .flexbox::first-letter { line-height: 200px; }
-    p { line-height: 20px; }
</del><ins>+    body {
+        line-height: 20px;
+    }
+
+    .flexbox-first-letter::first-letter {
+        line-height: 100px;
+        color: red;
+    }
+
+    .container-first-letter::first-letter {
+        line-height: 200px;
+        color: green;
+    }
+
+    .float {
+        float: left;
+    }
+
+    .flexbox-before::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-flex;
+        display: flex;
+    }
+
+    .flexbox-after::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-flex;
+        display: flex;
+    }
+
+    .inline-flexbox-before::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-inline-flex;
+        display: inline-flex;
+    }
+
+    .inline-flexbox-after::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-inline-flex;
+        display: inline-flex;
+    }
+
+    .before-after-first-letter::first-letter {
+        line-height: 50px;
+        color: blue;
+    }
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;body onload=&quot;checkLayout('.flexbox')&quot;&gt;
</del><ins>+&lt;body onload=&quot;checkLayout('.container')&quot;&gt;
</ins><span class="cx"> &lt;p&gt;This test flex item should ignore container's firstLetter pseudo element.&lt;/p&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;container&quot;&gt;
</span><ins>+    &lt;div class=&quot;flexbox flexbox-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-flexbox flexbox-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;flexbox flexbox-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-flexbox flexbox-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox flexbox-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox flexbox-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox flexbox-first-letter float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox flexbox-first-letter float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox flexbox-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox flexbox-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;flexbox&quot;&gt;
</span><del>-        &lt;p data-expected-height=20&gt;The first item.&lt;/p&gt;
-        &lt;p data-expected-height=20&gt;The second item.&lt;/p&gt;
</del><ins>+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><ins>+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><ins>+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox-before&quot; data-expected-height=220&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;flexbox-before before-after-first-letter&quot; data-expected-height=70&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox-before before-after-first-letter&quot; data-expected-height=70&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox-after&quot; data-expected-height=220&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;flexbox-after before-after-first-letter&quot; data-expected-height=70&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;flexbox-after before-after-first-letter&quot; data-expected-height=70&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-before&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-before before-after-first-letter&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-before before-after-first-letter&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-after&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-after before-after-first-letter&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-flexbox-after before-after-first-letter&quot; data-expected-height=20&gt;Out of flexbox.&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssfirstletterfromancestorsnotapplyinlineelementsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html (0 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements-expected.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;This test checks that inline elements cannot be the first letter of an ancestor element.&lt;/p&gt;
+&lt;p&gt;The tests passes if you see all the letters black and you see no red.&lt;/p&gt;
+
+&lt;div&gt;
+    &lt;div style=&quot;display: inline-block;&quot;&gt;Text&lt;/div&gt;
+    Out
+&lt;/div&gt;
+
+&lt;div&gt;
+    &lt;button&gt;Text&lt;/button&gt;
+    Out
+&lt;/div&gt;
+
+&lt;div&gt;
+    &lt;select&gt;
+        &lt;option&gt;Text&lt;/option&gt;
+    &lt;/select&gt;
+    Out
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssfirstletterfromancestorsnotapplyinlineelementshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements.html (0 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/first-letter-from-ancestors-not-apply-inline-elements.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;style&gt;
+    .first-letter::first-letter {
+        color: red;
+    }
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;p&gt;This test checks that inline elements cannot be the first letter of an ancestor element.&lt;/p&gt;
+&lt;p&gt;The tests passes if you see all the letters black and you see no red.&lt;/p&gt;
+
+&lt;div class=&quot;first-letter&quot;&gt;
+    &lt;div style=&quot;display: inline-block;&quot;&gt;Text&lt;/div&gt;
+    Out
+&lt;/div&gt;
+
+&lt;div class=&quot;first-letter&quot;&gt;
+    &lt;button&gt;Text&lt;/button&gt;
+    Out
+&lt;/div&gt;
+
+&lt;div class=&quot;first-letter&quot;&gt;
+    &lt;select&gt;
+        &lt;option&gt;Text&lt;/option&gt;
+    &lt;/select&gt;
+    Out
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssfirstletterignoresdisplaypropertyexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/first-letter-ignores-display-property-expected.html (0 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/first-letter-ignores-display-property-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/first-letter-ignores-display-property-expected.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;style&gt;
+    div::first-letter {
+        color: green;
+    }
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;p&gt;This test checks that display property is ignored in ::first-letter pseudo-element.&lt;/p&gt;
+&lt;p&gt;The tests passes if you see 5 lines with &quot;Text&quot; and the first letter green.&lt;/p&gt;
+
+&lt;div&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div&gt;
+    Text
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssfirstletterignoresdisplaypropertyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/first-letter-ignores-display-property.html (0 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/first-letter-ignores-display-property.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/first-letter-ignores-display-property.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;style&gt;
+    .none::first-letter {
+        color: green;
+        display: none;
+    }
+
+    .block::first-letter {
+        color: green;
+        display: block;
+    }
+
+    .table::first-letter {
+        color: green;
+        display: table;
+    }
+
+    .flex::first-letter {
+        color: green;
+        display: -webkit-flex;
+        display: flex;
+    }
+
+    .grid::first-letter {
+        color: green;
+        display: -webkit-grid;
+        display: grid;
+    }
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;p&gt;This test checks that display property is ignored in ::first-letter pseudo-element.&lt;/p&gt;
+&lt;p&gt;The tests passes if you see 5 lines with &quot;Text&quot; and the first letter green.&lt;/p&gt;
+
+&lt;div class=&quot;none&quot;&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div class=&quot;block&quot;&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div class=&quot;table&quot;&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div class=&quot;flex&quot;&gt;
+    Text
+&lt;/div&gt;
+
+&lt;div class=&quot;grid&quot;&gt;
+    Text
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontainerignorefirstletterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -5,18 +5,76 @@
</span><span class="cx"> PASS
</span><span class="cx"> The first item.
</span><span class="cx"> The second item.
</span><ins>+ PASS
+Anonymous item.
</ins><span class="cx"> PASS
</span><span class="cx"> Anonymous item.
</span><span class="cx"> PASS
</span><ins>+The first item.
+The second item.
+Out of grid.
+PASS
+The first item.
+The second item.
+Out of grid.
+PASS
+The first item.
+The second item.
+Out of grid.
+PASS
+The first item.
+The second item.
+Out of grid.
+PASS
</ins><span class="cx"> Anonymous item.
</span><ins>+Out of grid.
</ins><span class="cx"> PASS
</span><ins>+Anonymous item.
+Out of grid.
+PASS
</ins><span class="cx"> The first item.
</span><span class="cx"> The second item.
</span><ins>+Out of grid.
</ins><span class="cx"> PASS
</span><span class="cx"> The first item.
</span><span class="cx"> The second item.
</span><del>- PASS
</del><ins>+Out of grid.
+PASS
+The first item.
+The second item.
+Out of grid.
+PASS
+The first item.
+The second item.
+Out of grid.
+PASS
</ins><span class="cx"> Anonymous item.
</span><ins>+Out of grid.
</ins><span class="cx"> PASS
</span><span class="cx"> Anonymous item.
</span><ins>+Out of grid.
</ins><span class="cx"> PASS
</span><ins>+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
+Out of grid.
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontainerignorefirstletterhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-container-ignore-first-letter.html        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -2,58 +2,219 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
</span><span class="cx"> &lt;style&gt;
</span><del>-    body { line-height: 20px; }
-    .grid-first-letter::first-letter { line-height: 100px; color: red; }
-    .container::first-letter { line-height: 200px; color: green; }
</del><ins>+    body {
+        line-height: 20px;
+    }
+
+    .grid-first-letter::first-letter {
+        line-height: 100px;
+        color: red;
+    }
+
+    .container-first-letter::first-letter {
+        line-height: 200px;
+        color: green;
+    }
+
+    .float {
+        float: left;
+    }
+
+    .grid-before::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-grid;
+    }
+
+    .grid-after::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-grid;
+    }
+
+    .inline-grid-before::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-inline-grid;
+    }
+
+    .inline-grid-after::before {
+        content: &quot;Anonymous item.&quot;;
+        display: -webkit-inline-grid;
+    }
+
+    .before-after-first-letter::first-letter {
+        line-height: 50px;
+        color: blue;
+    }
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;body onload=&quot;checkLayout('.grid-first-letter');&quot;&gt;
</del><ins>+&lt;body onload=&quot;checkLayout('.container');&quot;&gt;
</ins><span class="cx"> &lt;p&gt;This test grid item should ignore grid container's first-letter pseudo-element.&lt;/p&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;grid grid-first-letter&quot;&gt;
-    &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
-    &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
</del><ins>+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid grid-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;inline-grid grid-first-letter&quot;&gt;
-    &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
-    &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
</del><ins>+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-grid grid-first-letter&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;grid grid-first-letter&quot; data-expected-height=20&gt;
-    Anonymous item.
</del><ins>+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid grid-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;inline-grid grid-first-letter&quot; data-expected-height=20&gt;
-    Anonymous item.
</del><ins>+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-grid grid-first-letter&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;container&quot;&gt;
</del><ins>+&lt;div class=&quot;container container-first-letter&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;grid grid-first-letter&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
</span><span class="cx">     &lt;/div&gt;
</span><ins>+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;container&quot;&gt;
</del><ins>+&lt;div class=&quot;container container-first-letter&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;inline-grid grid-first-letter&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
</span><span class="cx">     &lt;/div&gt;
</span><ins>+    &lt;div data-expected-height=20&gt;Out of grid.&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;container&quot;&gt;
</del><ins>+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid grid-first-letter float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid grid-first-letter float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;grid grid-first-letter&quot; data-expected-height=20&gt;
</span><span class="cx">         Anonymous item.
</span><span class="cx">     &lt;/div&gt;
</span><ins>+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;container&quot;&gt;
</del><ins>+&lt;div class=&quot;container container-first-letter&quot;&gt;
</ins><span class="cx">     &lt;div class=&quot;inline-grid grid-first-letter&quot; data-expected-height=20&gt;
</span><span class="cx">         Anonymous item.
</span><span class="cx">     &lt;/div&gt;
</span><ins>+    &lt;div data-expected-height=20&gt;Out of grid.&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid float&quot;&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The first item.&lt;/div&gt;
+        &lt;div class=&quot;item&quot; data-expected-height=20&gt;The second item.&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=200&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid&quot; data-expected-height=20&gt;
+        Anonymous item.
+    &lt;/div&gt;
+    &lt;div data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid-before&quot; data-expected-height=220&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid-before before-after-first-letter&quot; data-expected-height=70&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid-before before-after-first-letter&quot; data-expected-height=70&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid-after&quot; data-expected-height=220&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;grid-after before-after-first-letter&quot; data-expected-height=70&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid-after before-after-first-letter&quot; data-expected-height=70&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid-before&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-grid-before before-after-first-letter&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid-before before-after-first-letter&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid-after&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container container-first-letter&quot;&gt;
+    &lt;div class=&quot;inline-grid-after before-after-first-letter&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;inline-grid-after before-after-first-letter&quot; data-expected-height=20&gt;Out of grid.&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/Source/WebCore/ChangeLog        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-01-21  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
+        https://bugs.webkit.org/show_bug.cgi?id=138424
+
+        Reviewed by Benjamin Poulain.
+
+        Source/WebCore:
+
+        According to the grid and flexbox specs:
+        &quot;::first-letter pseudo-element do not apply to grid/flex containers&quot;.
+        http://dev.w3.org/csswg/css-grid/#grid-containers
+        http://dev.w3.org/csswg/css-flexbox/#flex-containers
+
+        Check also the CSS WG mailing list discussion:
+        http://lists.w3.org/Archives/Public/www-style/2014Dec/0305.html
+
+        This was almost working right, except in the case that an ancestor was
+        setting the ::first-letter pseudo-element.
+
+        Added a few more cases to the current tests in order to check this
+        behavior.
+        Also created some new tests to increase coverage
+
+        Tests: fast/css/first-letter-from-ancestors-not-apply-inline-elements.html
+               fast/css/first-letter-ignores-display-property.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::getFirstLetter): Go to the next sibling when
+        looking for the first text child if you reach a grid or flexbox.
+
</ins><span class="cx"> 2015-01-21  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix cast-align warning in Source/WebCore/platform/efl/EflScreenUtilities.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (178821 => 178822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-01-21 08:46:42 UTC (rev 178821)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-01-21 10:02:59 UTC (rev 178822)
</span><span class="lines">@@ -3209,6 +3209,12 @@
</span><span class="cx">             firstLetter = current.nextSibling();
</span><span class="cx">         } else if (current.isReplaced() || is&lt;RenderButton&gt;(current) || is&lt;RenderMenuList&gt;(current))
</span><span class="cx">             break;
</span><ins>+        else if (current.isFlexibleBoxIncludingDeprecated()
+#if ENABLE(CSS_GRID_LAYOUT)
+            || current.isRenderGrid()
+#endif
+            )
+            firstLetter = current.nextSibling();
</ins><span class="cx">         else if (current.style().hasPseudoStyle(FIRST_LETTER) &amp;&amp; current.canHaveGeneratedChildren())  {
</span><span class="cx">             // We found a lower-level node with first-letter, which supersedes the higher-level style
</span><span class="cx">             firstLetterContainer = &amp;current;
</span><span class="lines">@@ -3217,7 +3223,7 @@
</span><span class="cx">             firstLetter = current.firstChild();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (!firstLetter || !isRenderBlockFlowOrRenderButton(*firstLetterContainer))
</del><ins>+    if (!firstLetter)
</ins><span class="cx">         firstLetterContainer = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>