<!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>[182419] releases/WebKitGTK/webkit-2.6</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/182419">182419</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-06 08:18:34 -0700 (Mon, 06 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/181691">r181691</a> - Flex and grid items should be painted as inline-blocks
https://bugs.webkit.org/show_bug.cgi?id=142266

Reviewed by Darin Adler.

Source/WebCore:

Based on Blink <a href="http://trac.webkit.org/projects/webkit/changeset/157004">r157004</a> by &lt;cbiesinger@chromium.org&gt;.
https://src.chromium.org/viewvc/blink?revision=157004&amp;view=revision

Both flexbox and grid specs define that the painting order of flex/grid
items is the same as inline blocks. See
http://dev.w3.org/csswg/css-flexbox/#painting and
http://dev.w3.org/csswg/css-grid/#z-order.

Extracted inline blocks painting code from InlineElementBox and moved to
a helper method that will be reused for flexboxes and grids.

Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
       fast/css-grid-layout/grid-item-text-background-not-interleaved.html

* rendering/InlineElementBox.cpp:
(WebCore::InlineElementBox::paint): Move code to
RenderElement::paintAsInlineBlock().
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintChild): Add new argument to paint children
as inline blocks.
* rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
signature to add the new argument.
* rendering/RenderElement.cpp:
(WebCore::paintPhase): Paint element in a phase.
(WebCore::RenderElement::paintAsInlineBlock): Code extracted from
InlineElementBox::paint().
* rendering/RenderElement.h: Add new method signature.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::paintChildren): Call
RenderBlock::paintChild() with the new argument.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::paintChildren): Ditto.

LayoutTests:

* css3/flexbox/flex-item-text-background-not-interleaved-expected.html: Added.
* css3/flexbox/flex-item-text-background-not-interleaved.html: Added.
* fast/css-grid-layout/float-not-protruding-into-next-grid-item-expected.html:
Add some vertical space to avoid issues with backgrounds.
* fast/css-grid-layout/float-not-protruding-into-next-grid-item.html:
Ditto.
* fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html: Added.
* fast/css-grid-layout/grid-item-text-background-not-interleaved.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingInlineElementBoxcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/InlineElementBox.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderBlockcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderBlockh">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderElementcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderElementh">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderFlexibleBoxcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderFlexibleBox.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorerenderingRenderGridcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderGrid.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexitemtextbackgroundnotinterleavedexpectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexitemtextbackgroundnotinterleavedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssgridlayoutgriditemtextbackgroundnotinterleavedexpectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssgridlayoutgriditemtextbackgroundnotinterleavedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-03-18  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        Flex and grid items should be painted as inline-blocks
+        https://bugs.webkit.org/show_bug.cgi?id=142266
+
+        Reviewed by Darin Adler.
+
+        * css3/flexbox/flex-item-text-background-not-interleaved-expected.html: Added.
+        * css3/flexbox/flex-item-text-background-not-interleaved.html: Added.
+        * fast/css-grid-layout/float-not-protruding-into-next-grid-item-expected.html:
+        Add some vertical space to avoid issues with backgrounds.
+        * fast/css-grid-layout/float-not-protruding-into-next-grid-item.html:
+        Ditto.
+        * fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html: Added.
+        * fast/css-grid-layout/grid-item-text-background-not-interleaved.html: Added.
+
</ins><span class="cx"> 2015-03-16  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Crash viewing http://www.last.fm/
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexitemtextbackgroundnotinterleavedexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved-expected.html (0 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved-expected.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved-expected.html        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;style&gt;
+.first {
+    display: inline-block;
+    width: 50px;
+    background: lime;
+}
+
+.second {
+    display: inline-block;
+    width: 50px;
+    background: cyan;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that flex items text and background are not interleaved.&lt;/p&gt;
+&lt;p&gt;The test passes if you see &quot;Item2&quot; on top of &quot;VeryLongItem1&quot;.&lt;/p&gt;
+&lt;div&gt;
+    &lt;div class=&quot;first&quot;&gt;VeryLongItem1&lt;/div&gt;&lt;div class=&quot;second&quot;&gt;Item2&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexitemtextbackgroundnotinterleavedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved.html (0 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-item-text-background-not-interleaved.html        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/flexbox.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.first {
+    width: 50px;
+    background: lime;
+}
+
+.second {
+    width: 50px;
+    background: cyan;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that flex items text and background are not interleaved.&lt;/p&gt;
+&lt;p&gt;The test passes if you see &quot;Item2&quot; on top of &quot;VeryLongItem1&quot;.&lt;/p&gt;
+&lt;div class=&quot;flexbox&quot;&gt;
+    &lt;div class=&quot;first&quot;&gt;VeryLongItem1&lt;/div&gt;
+    &lt;div class=&quot;second&quot;&gt;Item2&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssgridlayoutgriditemtextbackgroundnotinterleavedexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html (0 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved-expected.html        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;style&gt;
+.container {
+    background-color: grey;
+}
+.element {
+    background: lime;
+    width: 100px;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that grid items text and background are not interleaved.&lt;/p&gt;
+&lt;p&gt;The test passes if you see only &quot;PASS&quot; text and not &quot;FAIL&quot;.&lt;/p&gt;
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;element&quot;&gt;PASS&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssgridlayoutgriditemtextbackgroundnotinterleavedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved.html (0 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css-grid-layout/grid-item-text-background-not-interleaved.html        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+.grid {
+    -webkit-grid-template-columns: 50px 50px;
+}
+.firstRowFirstColumnSpanning2 {
+    background: lime;
+    -webkit-grid-column: 1 / span 2;
+    -webkit-grid-row: 1;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that grid items text and background are not interleaved.&lt;/p&gt;
+&lt;p&gt;The test passes if you see only &quot;PASS&quot; text and not &quot;FAIL&quot;.&lt;/p&gt;
+&lt;div class=&quot;grid&quot;&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;&gt;FAIL&lt;/div&gt;
+    &lt;div class=&quot;firstRowFirstColumnSpanning2&quot;&gt;PASS&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2015-03-18  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        Flex and grid items should be painted as inline-blocks
+        https://bugs.webkit.org/show_bug.cgi?id=142266
+
+        Reviewed by Darin Adler.
+
+        Based on Blink r157004 by &lt;cbiesinger@chromium.org&gt;.
+        https://src.chromium.org/viewvc/blink?revision=157004&amp;view=revision
+
+        Both flexbox and grid specs define that the painting order of flex/grid
+        items is the same as inline blocks. See
+        http://dev.w3.org/csswg/css-flexbox/#painting and
+        http://dev.w3.org/csswg/css-grid/#z-order.
+
+        Extracted inline blocks painting code from InlineElementBox and moved to
+        a helper method that will be reused for flexboxes and grids.
+
+        Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
+               fast/css-grid-layout/grid-item-text-background-not-interleaved.html
+
+        * rendering/InlineElementBox.cpp:
+        (WebCore::InlineElementBox::paint): Move code to
+        RenderElement::paintAsInlineBlock().
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintChild): Add new argument to paint children
+        as inline blocks.
+        * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
+        signature to add the new argument.
+        * rendering/RenderElement.cpp:
+        (WebCore::paintPhase): Paint element in a phase.
+        (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
+        InlineElementBox::paint().
+        * rendering/RenderElement.h: Add new method signature.
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::paintChildren): Call
+        RenderBlock::paintChild() with the new argument.
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::paintChildren): Ditto.
+
</ins><span class="cx"> 2015-03-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Crash due to empty drag image during drag-and-drop
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingInlineElementBoxcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/InlineElementBox.cpp (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/InlineElementBox.cpp        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/InlineElementBox.cpp        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -72,23 +72,7 @@
</span><span class="cx">     if (renderer().isBox() &amp;&amp; parent()-&gt;renderer().style().isFlippedBlocksWritingMode()) // Faster than calling containingBlock().
</span><span class="cx">         childPoint = renderer().containingBlock()-&gt;flipForWritingModeForChild(&amp;toRenderBox(renderer()), childPoint);
</span><span class="cx"> 
</span><del>-    // Paint all phases of replaced elements atomically, as though the replaced element established its
-    // own stacking context.  (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
-    // specification.)
-    bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip;
-    PaintInfo info(paintInfo);
-    info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
-    renderer().paint(info, childPoint);
-    if (!preservePhase) {
-        info.phase = PaintPhaseChildBlockBackgrounds;
-        renderer().paint(info, childPoint);
-        info.phase = PaintPhaseFloat;
-        renderer().paint(info, childPoint);
-        info.phase = PaintPhaseForeground;
-        renderer().paint(info, childPoint);
-        info.phase = PaintPhaseOutline;
-        renderer().paint(info, childPoint);
-    }
</del><ins>+    renderer().paintAsInlineBlock(paintInfo, childPoint);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InlineElementBox::nodeAtPoint(const HitTestRequest&amp; request, HitTestResult&amp; result, const HitTestLocation&amp; locationInContainer, const LayoutPoint&amp; accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.cpp (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.cpp        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.cpp        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -1578,7 +1578,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderBlock::paintChild(RenderBox&amp; child, PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; paintInfoForChild, bool usePrintRect)
</del><ins>+bool RenderBlock::paintChild(RenderBox&amp; child, PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; paintInfoForChild, bool usePrintRect, PaintBlockType paintType)
</ins><span class="cx"> {
</span><span class="cx">     // Check for page-break-before: always, and if it's set, break and bail.
</span><span class="cx">     bool checkBeforeAlways = !childrenInline() &amp;&amp; (usePrintRect &amp;&amp; child.style().pageBreakBefore() == PBALWAYS);
</span><span class="lines">@@ -1602,8 +1602,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     LayoutPoint childPoint = flipForWritingModeForChild(&amp;child, paintOffset);
</span><del>-    if (!child.hasSelfPaintingLayer() &amp;&amp; !child.isFloating())
-        child.paint(paintInfoForChild, childPoint);
</del><ins>+    if (!child.hasSelfPaintingLayer() &amp;&amp; !child.isFloating()) {
+        if (paintType == PaintAsInlineBlock)
+            child.paintAsInlineBlock(paintInfoForChild, childPoint);
+        else
+            child.paint(paintInfoForChild, childPoint);
+    }
</ins><span class="cx"> 
</span><span class="cx">     // Check for page-break-after: always, and if it's set, break and bail.
</span><span class="cx">     bool checkAfterAlways = !childrenInline() &amp;&amp; (usePrintRect &amp;&amp; child.style().pageBreakAfter() == PBALWAYS);
</span><span class="lines">@@ -1617,7 +1621,6 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> void RenderBlock::paintCaret(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, CaretType type)
</span><span class="cx"> {
</span><span class="cx">     // Paint the caret if the FrameSelection says so or if caret browsing is enabled
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.h (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.h        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlock.h        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -330,7 +330,8 @@
</span><span class="cx">     virtual void paint(PaintInfo&amp;, const LayoutPoint&amp;) override;
</span><span class="cx">     virtual void paintObject(PaintInfo&amp;, const LayoutPoint&amp;) override;
</span><span class="cx">     virtual void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect);
</span><del>-    bool paintChild(RenderBox&amp;, PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect);
</del><ins>+    enum PaintBlockType { PaintAsBlock, PaintAsInlineBlock };
+    bool paintChild(RenderBox&amp;, PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect, PaintBlockType paintType = PaintAsBlock);
</ins><span class="cx">    
</span><span class="cx">     LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const
</span><span class="cx">     {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.cpp (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.cpp        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.cpp        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -1103,6 +1103,31 @@
</span><span class="cx">     return hoverAncestor;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline void paintPhase(RenderElement&amp; element, PaintPhase phase, PaintInfo&amp; paintInfo, const LayoutPoint&amp; childPoint)
+{
+    paintInfo.phase = phase;
+    element.paint(paintInfo, childPoint);
+}
+
+void RenderElement::paintAsInlineBlock(PaintInfo&amp; paintInfo, const LayoutPoint&amp; childPoint)
+{
+    // Paint all phases atomically, as though the element established its own stacking context.
+    // (See Appendix E.2, section 6.4 on inline block/table/replaced elements in the CSS2.1 specification.)
+    // This is also used by other elements (e.g. flex items and grid items).
+    if (paintInfo.phase == PaintPhaseSelection) {
+        paint(paintInfo, childPoint);
+    } else if (paintInfo.phase == PaintPhaseForeground) {
+        paintPhase(*this, PaintPhaseBlockBackground, paintInfo, childPoint);
+        paintPhase(*this, PaintPhaseChildBlockBackgrounds, paintInfo, childPoint);
+        paintPhase(*this, PaintPhaseFloat, paintInfo, childPoint);
+        paintPhase(*this, PaintPhaseForeground, paintInfo, childPoint);
+        paintPhase(*this, PaintPhaseOutline, paintInfo, childPoint);
+
+        // Reset |paintInfo| to the original phase.
+        paintInfo.phase = PaintPhaseForeground;
+    }
+}
+
</ins><span class="cx"> void RenderElement::layout()
</span><span class="cx"> {
</span><span class="cx">     StackStats::LayoutCheckPoint layoutCheckPoint;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.h (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.h        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderElement.h        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -95,6 +95,11 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void paint(PaintInfo&amp;, const LayoutPoint&amp;) = 0;
</span><span class="cx"> 
</span><ins>+    // inline-block elements paint all phases atomically. This function ensures that. Certain other elements
+    // (grid items, flex items) require this behavior as well, and this function exists as a helper for them.
+    // It is expected that the caller will call this function independent of the value of paintInfo.phase.
+    void paintAsInlineBlock(PaintInfo&amp;, const LayoutPoint&amp;);
+
</ins><span class="cx">     // Recursive function that computes the size and position of this object and all its descendants.
</span><span class="cx">     virtual void layout();
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderFlexibleBox.cpp (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderFlexibleBox.cpp        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderFlexibleBox.cpp        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -336,7 +336,7 @@
</span><span class="cx"> void RenderFlexibleBox::paintChildren(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; paintInfoForChild, bool usePrintRect)
</span><span class="cx"> {
</span><span class="cx">     for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
</span><del>-        if (!paintChild(*child, paintInfo, paintOffset, paintInfoForChild, usePrintRect))
</del><ins>+        if (!paintChild(*child, paintInfo, paintOffset, paintInfoForChild, usePrintRect, PaintAsInlineBlock))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderGrid.cpp (182418 => 182419)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderGrid.cpp        2015-04-06 15:09:52 UTC (rev 182418)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderGrid.cpp        2015-04-06 15:18:34 UTC (rev 182419)
</span><span class="lines">@@ -968,7 +968,7 @@
</span><span class="cx"> void RenderGrid::paintChildren(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; forChild, bool usePrintRect)
</span><span class="cx"> {
</span><span class="cx">     for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next())
</span><del>-        paintChild(*child, paintInfo, paintOffset, forChild, usePrintRect);
</del><ins>+        paintChild(*child, paintInfo, paintOffset, forChild, usePrintRect, PaintAsInlineBlock);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const char* RenderGrid::renderName() const
</span></span></pre>
</div>
</div>

</body>
</html>