<!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>[161626] 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/161626">161626</a></dd>
<dt>Author</dt> <dd>abucur@adobe.com</dd>
<dt>Date</dt> <dd>2014-01-10 02:38:18 -0800 (Fri, 10 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Regions] Implement visual overflow computation for inline elements
https://bugs.webkit.org/show_bug.cgi?id=125291

Reviewed by David Hyatt.

Source/WebCore:

The patch implements visual overflow computation for inline elements per region. The algorithm
uses the container region of each root line box to determine the lines in a region generated by
a RenderInline. The overflow of a RenderInline inside a region is the smallest rectangle that fits
all the line boxes belonging to that region.

The patch also correctly flips for writing mode the overflow of a renderer before clipping with it.

Tests: fast/regions/overflow-in-variable-width-regions-inline-bt.html
       fast/regions/overflow-in-variable-width-regions-inline-continuation.html
       fast/regions/overflow-in-variable-width-regions-inline-lr.html
       fast/regions/overflow-in-variable-width-regions-inline-rl.html
       fast/regions/overflow-in-variable-width-regions-inline.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::objectShouldPaintInFlowRegion):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::updateAlwaysCreateLineBoxes): Always create line boxes for RenderInline
(WebCore::RenderInline::linesVisualOverflowBoundingBoxInRegion):
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::visualOverflowRectForBox):
(WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
* rendering/RenderRegion.h:

LayoutTests:

Tests for inline elements overflow correct painting inside regions.

* fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-bt.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-continuation.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-expected.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-lr.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline-rl.html: Added.
* fast/regions/overflow-in-variable-width-regions-inline.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFlowThreadcpp">trunk/Source/WebCore/rendering/RenderFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlineh">trunk/Source/WebCore/rendering/RenderInline.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRegioncpp">trunk/Source/WebCore/rendering/RenderRegion.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRegionh">trunk/Source/WebCore/rendering/RenderRegion.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinebtexpectedhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinebthtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinecontinuationexpectedhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinecontinuationhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlineexpectedhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinelrexpectedhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinelrhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinerlexpectedhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinerlhtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl.html</a></li>
<li><a href="#trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinehtml">trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/LayoutTests/ChangeLog        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-01-10  Andrei Bucur  &lt;abucur@adobe.com&gt;
+
+        [CSS Regions] Implement visual overflow computation for inline elements
+        https://bugs.webkit.org/show_bug.cgi?id=125291
+
+        Reviewed by David Hyatt.
+
+        Tests for inline elements overflow correct painting inside regions.
+
+        * fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-bt.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-continuation.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-expected.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-lr.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline-rl.html: Added.
+        * fast/regions/overflow-in-variable-width-regions-inline.html: Added.
+
</ins><span class="cx"> 2014-01-09  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] .mp3 media document controls missing their background
</span></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinebtexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt-expected.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-bt;
+    }
+
+    .content {
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    .positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXB&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinebthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-bt.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-bt;
+    }
+
+    #content {
+        -webkit-flow-into: flow1;
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+        -webkit-flow-from: flow1;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    #positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;content&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinecontinuationexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation-expected.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-tb;
+    }
+
+    .content {
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 90px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    .positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+
+    .split {
+        height: 5px;
+        width: 50px;
+        background-color: green;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;span&gt;Ne&lt;span&gt;sted&lt;div class=&quot;split&quot;&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;&lt;span&gt;SPANS&lt;/br&gt;&lt;/span&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXB&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinecontinuationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-continuation.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-tb;
+    }
+
+    #content {
+        -webkit-flow-into: flow1;
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+        -webkit-flow-from: flow1;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 90px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    #positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+
+    .split {
+        height: 5px;
+        width: 50px;
+        background-color: green;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;content&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;span&gt;Ne&lt;span&gt;sted&lt;div class=&quot;split&quot;&gt;&lt;/div&gt;&lt;span&gt;SPANS&lt;/br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXX &lt;div class=&quot;split&quot;&gt;&lt;/div&gt; XXXXB&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlineexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-expected.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-expected.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-tb;
+    }
+
+    .content {
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    .positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXX&lt;br/&gt;XXXXB&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinelrexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr-expected.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: vertical-lr;
+    }
+
+    .content {
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    .positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinelrhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-lr.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: vertical-lr;
+    }
+
+    #content {
+        -webkit-flow-into: flow1;
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+        -webkit-flow-from: flow1;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    #positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;content&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinerlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl-expected.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: vertical-rl;
+    }
+
+    .content {
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    .positioned {
+        position: relative;
+        top: 60px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;div class=&quot;content&quot;&gt;&lt;span class=&quot;positioned&quot;&gt;XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinerlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline-rl.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: vertical-rl;
+    }
+
+    #content {
+        -webkit-flow-into: flow1;
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+        -webkit-flow-from: flow1;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    #positioned {
+        position: relative;
+        top: 60px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;content&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastregionsoverflowinvariablewidthregionsinlinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline.html (0 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline.html                                (rev 0)
+++ trunk/LayoutTests/fast/regions/overflow-in-variable-width-regions-inline.html        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+
+ &lt;style&gt;
+    html {
+        -webkit-writing-mode: horizontal-tb;
+    }
+
+    #content {
+        -webkit-flow-into: flow1;
+        width: 200px;
+        font: 16px Ahem;
+        -webkit-font-smoothing: none;
+    }
+    
+    #region1, #region2 {
+        border: 1px solid black;
+        margin: 50px;
+        float: left;
+        -webkit-flow-from: flow1;
+    }
+
+    #region1 {
+        width: 200px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 250px;
+        height: 100px;
+    }
+
+    #positioned {
+        position: relative;
+        top: 30px;
+        left: 30px;
+    }
+&lt;/style&gt;
+
+&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125291&quot;&gt;[CSS Regions] Implement visual overflow computation for inline elements&lt;/a&gt;
+&lt;p&gt;The paragraph inside the regions must be fragmented. Each fragment must be relatively positioned based on the fragment position.&lt;/p&gt;
+
+&lt;div id=&quot;content&quot;&gt;&lt;span id=&quot;positioned&quot;&gt;AXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXX&lt;br/&gt; XXXXB&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+    &lt;div id=&quot;region1&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/ChangeLog        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-01-10  Andrei Bucur  &lt;abucur@adobe.com&gt;
+
+        [CSS Regions] Implement visual overflow computation for inline elements
+        https://bugs.webkit.org/show_bug.cgi?id=125291
+
+        Reviewed by David Hyatt.
+
+        The patch implements visual overflow computation for inline elements per region. The algorithm
+        uses the container region of each root line box to determine the lines in a region generated by
+        a RenderInline. The overflow of a RenderInline inside a region is the smallest rectangle that fits
+        all the line boxes belonging to that region.
+
+        The patch also correctly flips for writing mode the overflow of a renderer before clipping with it.
+
+        Tests: fast/regions/overflow-in-variable-width-regions-inline-bt.html
+               fast/regions/overflow-in-variable-width-regions-inline-continuation.html
+               fast/regions/overflow-in-variable-width-regions-inline-lr.html
+               fast/regions/overflow-in-variable-width-regions-inline-rl.html
+               fast/regions/overflow-in-variable-width-regions-inline.html
+
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::objectShouldPaintInFlowRegion):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::updateAlwaysCreateLineBoxes): Always create line boxes for RenderInline
+        (WebCore::RenderInline::linesVisualOverflowBoundingBoxInRegion):
+        * rendering/RenderInline.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::visualOverflowRectForBox):
+        (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
+        * rendering/RenderRegion.h:
+
</ins><span class="cx"> 2014-01-09  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] .mp3 media document controls missing their background
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -843,7 +843,7 @@
</span><span class="cx">     if (enclosingBoxStartRegion &amp;&amp; enclosingBoxEndRegion &amp;&amp; !regionInRange(region, enclosingBoxStartRegion, enclosingBoxEndRegion))
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    return object-&gt;isBox();
</del><ins>+    return object-&gt;isBox() || object-&gt;isRenderInline();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderFlowThread::objectInFlowRegion(const RenderObject* object, const RenderRegion* region) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">         || style().textEmphasisMark() != TextEmphasisMarkNone
</span><span class="cx">         || (checkFonts &amp;&amp; (!parentStyle-&gt;font().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().font().fontMetrics())
</span><span class="cx">         || parentStyle-&gt;lineHeight() != style().lineHeight()))
</span><del>-        || (flowThread &amp;&amp; flowThread-&gt;isRenderNamedFlowThread() &amp;&amp; toRenderNamedFlowThread(flowThread)-&gt;hasRegionsWithStyling());
</del><ins>+        || (flowThread &amp;&amp; flowThread-&gt;isRenderNamedFlowThread()); // FIXME: Enable the optimization once we make overflow computation for culled inlines in regions.
</ins><span class="cx"> 
</span><span class="cx">     if (!alwaysCreateLineBoxes &amp;&amp; checkFonts &amp;&amp; document().styleSheetCollection().usesFirstLineRules()) {
</span><span class="cx">         // Have to check the first line style as well.
</span><span class="lines">@@ -1040,6 +1040,50 @@
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutRect RenderInline::linesVisualOverflowBoundingBoxInRegion(const RenderRegion* region) const
+{
+    ASSERT(alwaysCreateLineBoxes());
+    ASSERT(region);
+
+    if (!firstLineBox() || !lastLineBox())
+        return LayoutRect();
+
+    // Return the width of the minimal left side and the maximal right side.
+    LayoutUnit logicalLeftSide = LayoutUnit::max();
+    LayoutUnit logicalRightSide = LayoutUnit::min();
+    LayoutUnit logicalTop;
+    LayoutUnit logicalHeight;
+    InlineFlowBox* lastInlineInRegion = 0;
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr-&gt;nextLineBox()) {
+        const RootInlineBox&amp; root = curr-&gt;root();
+        if (root.containingRegion() != region) {
+            if (lastInlineInRegion)
+                break;
+            continue;
+        }
+
+        if (!lastInlineInRegion)
+            logicalTop = curr-&gt;logicalTopVisualOverflow(root.lineTop());
+
+        lastInlineInRegion = curr;
+
+        logicalLeftSide = std::min(logicalLeftSide, curr-&gt;logicalLeftVisualOverflow());
+        logicalRightSide = std::max(logicalRightSide, curr-&gt;logicalRightVisualOverflow());
+    }
+
+    if (!lastInlineInRegion)
+        return LayoutRect();
+
+    logicalHeight = lastInlineInRegion-&gt;logicalBottomVisualOverflow(lastInlineInRegion-&gt;root().lineBottom()) - logicalTop;
+    
+    LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide;
+    
+    LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
+    if (!style().isHorizontalWritingMode())
+        rect = rect.transposedRect();
+    return rect;
+}
+
</ins><span class="cx"> LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
</span><span class="cx"> {
</span><span class="cx">     // Only run-ins and first-letter renderers are allowed in here during layout. They mutate the tree triggering repaints.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.h (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.h        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderInline.h        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntRect linesBoundingBox() const;
</span><span class="cx">     LayoutRect linesVisualOverflowBoundingBox() const;
</span><ins>+    LayoutRect linesVisualOverflowBoundingBoxInRegion(const RenderRegion*) const;
</ins><span class="cx"> 
</span><span class="cx">     InlineFlowBox* createAndAppendInlineFlowBox();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -5499,16 +5499,20 @@
</span><span class="cx">     outlineRect = backgroundRect;
</span><span class="cx"> 
</span><span class="cx">     RenderFlowThread* flowThread = clipRectsContext.region ? clipRectsContext.region-&gt;flowThread() : 0;
</span><del>-    if (isSelfPaintingLayer() &amp;&amp; flowThread &amp;&amp; !renderer().isInFlowRenderFlowThread() &amp;&amp; renderBox()) {
-        // FIXME: Handle the case where the renderer is not a RenderBox.
-        LayoutRect layerBoundsWithVisualOverflow = clipRectsContext.region-&gt;visualOverflowRectForBox(renderBox());
</del><ins>+    if (isSelfPaintingLayer() &amp;&amp; flowThread &amp;&amp; !renderer().isInFlowRenderFlowThread()) {
+        const RenderBoxModelObject&amp; boxModelObject = toRenderBoxModelObject(renderer());
+        LayoutRect layerBoundsWithVisualOverflow = clipRectsContext.region-&gt;visualOverflowRectForBox(&amp;boxModelObject);
</ins><span class="cx"> 
</span><span class="cx">         // Layers are in physical coordinates so the origin must be moved to the physical top-left of the flowthread.
</span><del>-        if (flowThread-&gt;style().isFlippedBlocksWritingMode()) {
</del><ins>+        if (&amp;boxModelObject == flowThread &amp;&amp; flowThread-&gt;style().isFlippedBlocksWritingMode()) {
</ins><span class="cx">             if (flowThread-&gt;style().isHorizontalWritingMode())
</span><span class="cx">                 layerBoundsWithVisualOverflow.moveBy(LayoutPoint(0, flowThread-&gt;height()));
</span><span class="cx">             else
</span><span class="cx">                 layerBoundsWithVisualOverflow.moveBy(LayoutPoint(flowThread-&gt;width(), 0));
</span><ins>+        } else {
+            RenderBlock* rendererContainingBlock = boxModelObject.enclosingBox()-&gt;isRenderBlock() ? toRenderBlock(boxModelObject.enclosingBox()) : 0;
+            if (rendererContainingBlock)
+                rendererContainingBlock-&gt;flipForWritingMode(layerBoundsWithVisualOverflow);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         layerBoundsWithVisualOverflow.moveBy(offset);
</span><span class="lines">@@ -5660,9 +5664,9 @@
</span><span class="cx">     // cause the paint rejection algorithm to prevent them from painting when using different width regions.
</span><span class="cx">     // e.g. an absolutely positioned box with bottom:0px and right:0px would have it's frameRect.x relative
</span><span class="cx">     // to the flow thread, not the last region (in which it will end up because of bottom:0px)
</span><del>-    if (region &amp;&amp; renderer().isBox() &amp;&amp; renderer().flowThreadContainingBlock()) {
</del><ins>+    if (region &amp;&amp; renderer().flowThreadContainingBlock()) {
</ins><span class="cx">         LayoutRect b = layerBounds;
</span><del>-        b.moveBy(region-&gt;visualOverflowRectForBox(toRenderBox(&amp;renderer())).location());
</del><ins>+        b.moveBy(region-&gt;visualOverflowRectForBox(toRenderBoxModelObject(&amp;renderer())).location());
</ins><span class="cx">         b.inflate(renderer().view().maximalOutlineSize());
</span><span class="cx">         if (b.intersects(damageRect))
</span><span class="cx">             return true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRegioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRegion.cpp (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRegion.cpp        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderRegion.cpp        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><span class="cx"> #include &quot;RenderBoxRegionInfo.h&quot;
</span><ins>+#include &quot;RenderInline.h&quot;
</ins><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderNamedFlowFragment.h&quot;
</span><span class="lines">@@ -560,13 +561,23 @@
</span><span class="cx">     return overflow-&gt;layoutOverflowRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutRect RenderRegion::visualOverflowRectForBox(const RenderBox* box)
</del><ins>+LayoutRect RenderRegion::visualOverflowRectForBox(const RenderBoxModelObject* box)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;RenderOverflow&gt; overflow;
-    ensureOverflowForBox(box, overflow, true);
-    
-    ASSERT(overflow);
-    return overflow-&gt;visualOverflowRect();
</del><ins>+    if (box-&gt;isRenderInline()) {
+        const RenderInline* inlineBox = toRenderInline(box);
+        return inlineBox-&gt;linesVisualOverflowBoundingBoxInRegion(this);
+    }
+
+    if (box-&gt;isBox()) {
+        RefPtr&lt;RenderOverflow&gt; overflow;
+        ensureOverflowForBox(toRenderBox(box), overflow, true);
+
+        ASSERT(overflow);
+        return overflow-&gt;visualOverflowRect();
+    }
+
+    ASSERT_NOT_REACHED();
+    return LayoutRect();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: This doesn't work for writing modes.
</span><span class="lines">@@ -590,7 +601,7 @@
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutRect RenderRegion::visualOverflowRectForBoxForPropagation(const RenderBox* box)
</del><ins>+LayoutRect RenderRegion::visualOverflowRectForBoxForPropagation(const RenderBoxModelObject* box)
</ins><span class="cx"> {
</span><span class="cx">     LayoutRect rect = visualOverflowRectForBox(box);
</span><span class="cx">     flowThread()-&gt;flipForWritingModeLocalCoordinates(rect);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRegionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRegion.h (161625 => 161626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRegion.h        2014-01-10 09:11:00 UTC (rev 161625)
+++ trunk/Source/WebCore/rendering/RenderRegion.h        2014-01-10 10:38:18 UTC (rev 161626)
</span><span class="lines">@@ -120,9 +120,9 @@
</span><span class="cx">     void addLayoutOverflowForBox(const RenderBox*, const LayoutRect&amp;);
</span><span class="cx">     void addVisualOverflowForBox(const RenderBox*, const LayoutRect&amp;);
</span><span class="cx">     LayoutRect layoutOverflowRectForBox(const RenderBox*);
</span><del>-    LayoutRect visualOverflowRectForBox(const RenderBox*);
</del><ins>+    LayoutRect visualOverflowRectForBox(const RenderBoxModelObject*);
</ins><span class="cx">     LayoutRect layoutOverflowRectForBoxForPropagation(const RenderBox*);
</span><del>-    LayoutRect visualOverflowRectForBoxForPropagation(const RenderBox*);
</del><ins>+    LayoutRect visualOverflowRectForBoxForPropagation(const RenderBoxModelObject*);
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect rectFlowPortionForBox(const RenderBox*, const LayoutRect&amp;) const;
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>