<!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>[162098] trunk/Source/WebCore</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/162098">162098</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2014-01-15 15:51:25 -0800 (Wed, 15 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Repeating background images should continue into margin tiles
https://bugs.webkit.org/show_bug.cgi?id=127021
-and corresponding-
&lt;rdar://problem/15571300&gt;

Reviewed by Simon Fraser.

This patch makes repeating background images continue into margin tiles. 

RenderObject::repaintRectangle() now takes an addition bool parameter which 
indicates whether or not the repaint rect should be clipped to the layer size.
* WebCore.exp.in:

These new functions on FrameView provide a way for code in the render tree to know 
if the TiledBacking has a margin. tiledBacking() is now const. It should have 
always been const, and it needs to be const to make these new functions const.
* page/FrameView.cpp:
(WebCore::FrameView::tiledBacking):
(WebCore::FrameView::hasExtendedBackground):
(WebCore::FrameView::extendedBackgroundRect):
* page/FrameView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::tiledBacking):

If we’re painting the root background and it is an extended background, we need to 
inflate the repaint rect to span the extended background. 
* rendering/RenderBox.cpp:
(WebCore::RenderBox::repaintLayerRectsForImage):

To get the phase right on repeated background images on a page with margin tiles, 
we need to make sure we factor the size of the margin tiles into the left and top 
values that we use when calculating background image geometry.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

setBackingNeedsRepaintInRect() now takes GraphicsLayer::ShouldClipToLayer as a 
parameter, just like setBackingNeedsRepaint(). 
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

setContentsNeedDisplayInRect() also takes a GraphicsLayer::ShouldClipToLayer now, 
and it passes that information down to the GraphicsLayer.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderLayerBacking.h:

These two RenderObject functions now take an optional bool parameter which 
indicates whether or not the rect should be clipped to the layer size. They use a 
bool instead of the GraphicsLayer enum in order to avoid including GraphicsLayer.h 
from within RenderObject.h. This seems like a simpler solution than adding a new 
stand-alone file for this very simple enum.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::repaintRectangle):
* rendering/RenderObject.h:

RenderView::backgroundRect needs to return the extendedBackgroundRect when it had 
one.
* rendering/RenderView.cpp:
(WebCore::RenderView::backgroundRect):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjecth">trunk/Source/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/ChangeLog        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2014-01-15  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Repeating background images should continue into margin tiles
+        https://bugs.webkit.org/show_bug.cgi?id=127021
+        -and corresponding-
+        &lt;rdar://problem/15571300&gt;
+
+        Reviewed by Simon Fraser.
+
+        This patch makes repeating background images continue into margin tiles. 
+
+        RenderObject::repaintRectangle() now takes an addition bool parameter which 
+        indicates whether or not the repaint rect should be clipped to the layer size.
+        * WebCore.exp.in:
+
+        These new functions on FrameView provide a way for code in the render tree to know 
+        if the TiledBacking has a margin. tiledBacking() is now const. It should have 
+        always been const, and it needs to be const to make these new functions const.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::tiledBacking):
+        (WebCore::FrameView::hasExtendedBackground):
+        (WebCore::FrameView::extendedBackgroundRect):
+        * page/FrameView.h:
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::tiledBacking):
+
+        If we’re painting the root background and it is an extended background, we need to 
+        inflate the repaint rect to span the extended background. 
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::repaintLayerRectsForImage):
+
+        To get the phase right on repeated background images on a page with margin tiles, 
+        we need to make sure we factor the size of the margin tiles into the left and top 
+        values that we use when calculating background image geometry.
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+
+        setBackingNeedsRepaintInRect() now takes GraphicsLayer::ShouldClipToLayer as a 
+        parameter, just like setBackingNeedsRepaint(). 
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+
+        setContentsNeedDisplayInRect() also takes a GraphicsLayer::ShouldClipToLayer now, 
+        and it passes that information down to the GraphicsLayer.
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
+        * rendering/RenderLayerBacking.h:
+
+        These two RenderObject functions now take an optional bool parameter which 
+        indicates whether or not the rect should be clipped to the layer size. They use a 
+        bool instead of the GraphicsLayer enum in order to avoid including GraphicsLayer.h 
+        from within RenderObject.h. This seems like a simpler solution than adding a new 
+        stand-alone file for this very simple enum.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintUsingContainer):
+        (WebCore::RenderObject::repaintRectangle):
+        * rendering/RenderObject.h:
+
+        RenderView::backgroundRect needs to return the extendedBackgroundRect when it had 
+        one.
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::backgroundRect):
+
</ins><span class="cx"> 2014-01-15  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: capture probe samples on the backend
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1258,7 +1258,6 @@
</span><span class="cx"> __ZN7WebCore9FrameTree9clearNameEv
</span><span class="cx"> __ZN7WebCore9FrameView11forceLayoutEb
</span><span class="cx"> __ZN7WebCore9FrameView12setMediaTypeERKN3WTF6StringE
</span><del>-__ZN7WebCore9FrameView12tiledBackingEv
</del><span class="cx"> __ZN7WebCore9FrameView13paintContentsEPNS_15GraphicsContextERKNS_7IntRectE
</span><span class="cx"> __ZN7WebCore9FrameView13setNodeToDrawEPNS_4NodeE
</span><span class="cx"> __ZN7WebCore9FrameView14adjustViewSizeEv
</span><span class="lines">@@ -1471,7 +1470,7 @@
</span><span class="cx"> __ZNK7WebCore11RenderStyle4fontEv
</span><span class="cx"> __ZNK7WebCore12RenderObject14enclosingLayerEv
</span><span class="cx"> __ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEj
</span><del>-__ZNK7WebCore12RenderObject16repaintRectangleERKNS_10LayoutRectEb
</del><ins>+__ZNK7WebCore12RenderObject16repaintRectangleERKNS_10LayoutRectEbb
</ins><span class="cx"> __ZNK7WebCore12RenderObject20localToContainerQuadERKNS_9FloatQuadEPKNS_22RenderLayerModelObjectEjPb
</span><span class="cx"> __ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb
</span><span class="cx"> __ZNK7WebCore12RenderObject39pixelSnappedAbsoluteClippedOverflowRectEv
</span><span class="lines">@@ -1815,6 +1814,7 @@
</span><span class="cx"> __ZNK7WebCore9FrameTree6parentEv
</span><span class="cx"> __ZNK7WebCore9FrameView10renderViewEv
</span><span class="cx"> __ZNK7WebCore9FrameView11needsLayoutEv
</span><ins>+__ZNK7WebCore9FrameView12tiledBackingEv
</ins><span class="cx"> __ZNK7WebCore9FrameView13isTransparentEv
</span><span class="cx"> __ZNK7WebCore9FrameView13paintBehaviorEv
</span><span class="cx"> __ZNK7WebCore9FrameView14didFirstLayoutEv
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -832,7 +832,7 @@
</span><span class="cx">     return renderView-&gt;compositor().layerForScrollCorner();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TiledBacking* FrameView::tiledBacking()
</del><ins>+TiledBacking* FrameView::tiledBacking() const
</ins><span class="cx"> {
</span><span class="cx">     RenderView* renderView = this-&gt;renderView();
</span><span class="cx">     if (!renderView)
</span><span class="lines">@@ -2645,6 +2645,27 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool FrameView::hasExtendedBackground() const
+{
+    if (!frame().settings().backgroundShouldExtendBeyondPage())
+        return false;
+
+    TiledBacking* tiledBacking = this-&gt;tiledBacking();
+    if (!tiledBacking)
+        return false;
+
+    return tiledBacking-&gt;hasMargins();
+}
+
+IntRect FrameView::extendedBackgroundRect() const
+{
+    TiledBacking* tiledBacking = this-&gt;tiledBacking();
+    if (!tiledBacking)
+        return IntRect();
+
+    return tiledBacking-&gt;bounds();
+}
+
</ins><span class="cx"> bool FrameView::shouldUpdateWhileOffscreen() const
</span><span class="cx"> {
</span><span class="cx">     return m_shouldUpdateWhileOffscreen;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/page/FrameView.h        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">     GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget);
</span><span class="cx">     void scheduleLayerFlushAllowingThrottling();
</span><span class="cx"> 
</span><del>-    virtual TiledBacking* tiledBacking() OVERRIDE;
</del><ins>+    virtual TiledBacking* tiledBacking() const OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx">     // In the future when any ScrollableArea can have a node in th ScrollingTree, this should
</span><span class="cx">     // become a virtual function on ScrollableArea.
</span><span class="lines">@@ -193,6 +193,10 @@
</span><span class="cx">     void setBaseBackgroundColor(const Color&amp;);
</span><span class="cx">     void updateBackgroundRecursively(const Color&amp;, bool);
</span><span class="cx"> 
</span><ins>+    // extendedBackgroundRect() is in the viewport's coordinate space. 
+    bool hasExtendedBackground() const;
+    IntRect extendedBackgroundRect() const;
+
</ins><span class="cx">     bool shouldUpdateWhileOffscreen() const;
</span><span class="cx">     void setShouldUpdateWhileOffscreen(bool);
</span><span class="cx">     bool shouldUpdate(bool = false) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><del>-    virtual TiledBacking* tiledBacking() { return 0; }
</del><ins>+    virtual TiledBacking* tiledBacking() const { return 0; }
</ins><span class="cx">     virtual bool usesCompositedScrolling() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1557,8 +1557,8 @@
</span><span class="cx">     for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer-&gt;next()) {
</span><span class="cx">         if (curLayer-&gt;image() &amp;&amp; image == curLayer-&gt;image()-&gt;data() &amp;&amp; curLayer-&gt;image()-&gt;canRender(this, style().effectiveZoom())) {
</span><span class="cx">             // Now that we know this image is being used, compute the renderer and the rect if we haven't already.
</span><ins>+            bool drawingRootBackground = drawingBackground &amp;&amp; (isRoot() || (isBody() &amp;&amp; !document().documentElement()-&gt;renderer()-&gt;hasBackground()));
</ins><span class="cx">             if (!layerRenderer) {
</span><del>-                bool drawingRootBackground = drawingBackground &amp;&amp; (isRoot() || (isBody() &amp;&amp; !document().documentElement()-&gt;renderer()-&gt;hasBackground()));
</del><span class="cx">                 if (drawingRootBackground) {
</span><span class="cx">                     layerRenderer = &amp;view();
</span><span class="cx"> 
</span><span class="lines">@@ -1584,7 +1584,26 @@
</span><span class="cx">                 return true;
</span><span class="cx">             }
</span><span class="cx">             
</span><del>-            layerRenderer-&gt;repaintRectangle(geometry.destRect());
</del><ins>+            IntRect rectToRepaint = geometry.destRect();
+            bool shouldClipToLayer = true;
+
+            // If this is the root background layer, we may need to extend the repaintRect if the FrameView has an
+            // extendedBackground. We should only extend the rect if it is already extending the full width or height
+            // of the rendererRect.
+            if (drawingRootBackground &amp;&amp; view().frameView().hasExtendedBackground()) {
+                shouldClipToLayer = false;
+                IntRect extendedBackgroundRect = view().frameView().extendedBackgroundRect();
+                if (rectToRepaint.width() == rendererRect.width()) {
+                    rectToRepaint.move(extendedBackgroundRect.x(), 0);
+                    rectToRepaint.setWidth(extendedBackgroundRect.width());
+                }
+                if (rectToRepaint.height() == rendererRect.height()) {
+                    rectToRepaint.move(0, extendedBackgroundRect.y());
+                    rectToRepaint.setHeight(extendedBackgroundRect.height());
+                }
+            }
+
+            layerRenderer-&gt;repaintRectangle(rectToRepaint, false, shouldClipToLayer);
</ins><span class="cx">             if (geometry.destRect() == rendererRect)
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1106,8 +1106,11 @@
</span><span class="cx">         // the background positioning area.
</span><span class="cx">         if (isRoot()) {
</span><span class="cx">             positioningAreaSize = pixelSnappedIntSize(toRenderBox(this)-&gt;size() - LayoutSize(left + right, top + bottom), toRenderBox(this)-&gt;location());
</span><del>-            left += marginLeft();
-            top += marginTop();
</del><ins>+            if (view().frameView().hasExtendedBackground()) {
+                IntRect extendedBackgroundRect = view().frameView().extendedBackgroundRect();
+                left += (marginLeft() - extendedBackgroundRect.x());
+                top += (marginTop() - extendedBackgroundRect.y());
+            }
</ins><span class="cx">         } else
</span><span class="cx">             positioningAreaSize = pixelSnappedIntSize(paintRect.size() - LayoutSize(left + right, top + bottom), paintRect.location());
</span><span class="cx">     } else {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -6315,7 +6315,7 @@
</span><span class="cx">         backing()-&gt;setContentsNeedDisplay(shouldClip);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect&amp; r)
</del><ins>+void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect&amp; r, GraphicsLayer::ShouldClipToLayer shouldClip)
</ins><span class="cx"> {
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
</span><span class="cx">     // so assert but check that the layer is composited.
</span><span class="lines">@@ -6330,7 +6330,7 @@
</span><span class="cx"> 
</span><span class="cx">         renderer().view().repaintViewRectangle(absRect);
</span><span class="cx">     } else
</span><del>-        backing()-&gt;setContentsNeedDisplayInRect(pixelSnappedIntRect(r));
</del><ins>+        backing()-&gt;setContentsNeedDisplayInRect(pixelSnappedIntRect(r), shouldClip);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -346,9 +346,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><span class="cx">     // Indicate that the layer contents need to be repainted. Only has an effect
</span><del>-    // if layer compositing is being used,
</del><ins>+    // if layer compositing is being used.
</ins><span class="cx">     void setBackingNeedsRepaint(GraphicsLayer::ShouldClipToLayer = GraphicsLayer::ClipToLayer);
</span><del>-    void setBackingNeedsRepaintInRect(const LayoutRect&amp;); // r is in the coordinate space of the layer's render object
</del><ins>+
+    // The rect is in the coordinate space of the layer's render object.
+    void setBackingNeedsRepaintInRect(const LayoutRect&amp;, GraphicsLayer::ShouldClipToLayer = GraphicsLayer::ClipToLayer);
</ins><span class="cx">     void repaintIncludingNonCompositingDescendants(RenderLayerModelObject* repaintContainer);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -2111,7 +2111,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // r is in the coordinate space of the layer's render object
</span><del>-void RenderLayerBacking::setContentsNeedDisplayInRect(const IntRect&amp; r)
</del><ins>+void RenderLayerBacking::setContentsNeedDisplayInRect(const IntRect&amp; r, GraphicsLayer::ShouldClipToLayer shouldClip)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!paintsIntoCompositedAncestor());
</span><span class="cx"> 
</span><span class="lines">@@ -2122,26 +2122,26 @@
</span><span class="cx">     if (m_graphicsLayer &amp;&amp; m_graphicsLayer-&gt;drawsContent()) {
</span><span class="cx">         IntRect layerDirtyRect = r;
</span><span class="cx">         layerDirtyRect.move(-m_graphicsLayer-&gt;offsetFromRenderer());
</span><del>-        m_graphicsLayer-&gt;setNeedsDisplayInRect(layerDirtyRect);
</del><ins>+        m_graphicsLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_foregroundLayer &amp;&amp; m_foregroundLayer-&gt;drawsContent()) {
</span><span class="cx">         IntRect layerDirtyRect = r;
</span><span class="cx">         layerDirtyRect.move(-m_foregroundLayer-&gt;offsetFromRenderer());
</span><del>-        m_foregroundLayer-&gt;setNeedsDisplayInRect(layerDirtyRect);
</del><ins>+        m_foregroundLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: need to split out repaints for the background.
</span><span class="cx">     if (m_backgroundLayer &amp;&amp; m_backgroundLayer-&gt;drawsContent()) {
</span><span class="cx">         IntRect layerDirtyRect = r;
</span><span class="cx">         layerDirtyRect.move(-m_backgroundLayer-&gt;offsetFromRenderer());
</span><del>-        m_backgroundLayer-&gt;setNeedsDisplayInRect(layerDirtyRect);
</del><ins>+        m_backgroundLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_maskLayer &amp;&amp; m_maskLayer-&gt;drawsContent()) {
</span><span class="cx">         IntRect layerDirtyRect = r;
</span><span class="cx">         layerDirtyRect.move(-m_maskLayer-&gt;offsetFromRenderer());
</span><del>-        m_maskLayer-&gt;setNeedsDisplayInRect(layerDirtyRect);
</del><ins>+        m_maskLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_scrollingContentsLayer &amp;&amp; m_scrollingContentsLayer-&gt;drawsContent()) {
</span><span class="lines">@@ -2151,7 +2151,7 @@
</span><span class="cx">         // Account for the fact that RenderLayerBacking::updateGraphicsLayerGeometry() bakes scrollOffset into offsetFromRenderer on iOS.
</span><span class="cx">         layerDirtyRect.move(-m_owningLayer.scrollOffset());
</span><span class="cx"> #endif
</span><del>-        m_scrollingContentsLayer-&gt;setNeedsDisplayInRect(layerDirtyRect);
</del><ins>+        m_scrollingContentsLayer-&gt;setNeedsDisplayInRect(layerDirtyRect, shouldClip);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setContentsNeedDisplay(GraphicsLayer::ShouldClipToLayer = GraphicsLayer::ClipToLayer);
</span><span class="cx">     // r is in the coordinate space of the layer's render object
</span><del>-    void setContentsNeedDisplayInRect(const IntRect&amp;);
</del><ins>+    void setContentsNeedDisplayInRect(const IntRect&amp;, GraphicsLayer::ShouldClipToLayer = GraphicsLayer::ClipToLayer);
</ins><span class="cx"> 
</span><span class="cx">     // Notification from the renderer that its content changed.
</span><span class="cx">     void contentChanged(ContentChangeType);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1236,7 +1236,7 @@
</span><span class="cx">     return repaintContainer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const IntRect&amp; r, bool immediate) const
</del><ins>+void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const IntRect&amp; r, bool immediate, bool shouldClipToLayer) const
</ins><span class="cx"> {
</span><span class="cx">     if (!repaintContainer) {
</span><span class="cx">         view().repaintViewRectangle(r, immediate);
</span><span class="lines">@@ -1268,7 +1268,7 @@
</span><span class="cx">     
</span><span class="cx">     if (v.usesCompositing()) {
</span><span class="cx">         ASSERT(repaintContainer-&gt;hasLayer() &amp;&amp; repaintContainer-&gt;layer()-&gt;isComposited());
</span><del>-        repaintContainer-&gt;layer()-&gt;setBackingNeedsRepaintInRect(r);
</del><ins>+        repaintContainer-&gt;layer()-&gt;setBackingNeedsRepaintInRect(r, shouldClipToLayer ? GraphicsLayer::ClipToLayer : GraphicsLayer::DoNotClipToLayer);
</ins><span class="cx">     }
</span><span class="cx"> #else
</span><span class="cx">     if (repaintContainer-&gt;isRenderView())
</span><span class="lines">@@ -1290,7 +1290,7 @@
</span><span class="cx">     repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), immediate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderObject::repaintRectangle(const LayoutRect&amp; r, bool immediate) const
</del><ins>+void RenderObject::repaintRectangle(const LayoutRect&amp; r, bool immediate, bool shouldClipToLayer) const
</ins><span class="cx"> {
</span><span class="cx">     // Don't repaint if we're unrooted (note that view() still returns the view when unrooted)
</span><span class="cx">     RenderView* view;
</span><span class="lines">@@ -1308,7 +1308,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderLayerModelObject* repaintContainer = containerForRepaint();
</span><span class="cx">     computeRectForRepaint(repaintContainer, dirtyRect);
</span><del>-    repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(dirtyRect), immediate);
</del><ins>+    repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(dirtyRect), immediate, shouldClipToLayer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderObject.h        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -740,14 +740,14 @@
</span><span class="cx">     RenderLayerModelObject* containerForRepaint() const;
</span><span class="cx">     // Actually do the repaint of rect r for this object which has been computed in the coordinate space
</span><span class="cx">     // of repaintContainer. If repaintContainer is 0, repaint via the view.
</span><del>-    void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const IntRect&amp;, bool immediate = false) const;
</del><ins>+    void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const IntRect&amp;, bool immediate = false, bool shouldClipToLayer = true) const;
</ins><span class="cx">     
</span><span class="cx">     // Repaint the entire object.  Called when, e.g., the color of a border changes, or when a border
</span><span class="cx">     // style changes.
</span><span class="cx">     void repaint(bool immediate = false) const;
</span><span class="cx"> 
</span><span class="cx">     // Repaint a specific subrectangle within a given object.  The rect |r| is in the object's coordinate space.
</span><del>-    void repaintRectangle(const LayoutRect&amp;, bool immediate = false) const;
</del><ins>+    void repaintRectangle(const LayoutRect&amp;, bool immediate = false, bool shouldClipToLayer = true) const;
</ins><span class="cx"> 
</span><span class="cx">     bool checkForRepaintDuringLayout() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (162097 => 162098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2014-01-15 23:26:19 UTC (rev 162097)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2014-01-15 23:51:25 UTC (rev 162098)
</span><span class="lines">@@ -1009,7 +1009,7 @@
</span><span class="cx"> LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const
</span><span class="cx"> {
</span><span class="cx">     if (!hasColumns())
</span><del>-        return unscaledDocumentRect();
</del><ins>+        return frameView().hasExtendedBackground() ? frameView().extendedBackgroundRect() : unscaledDocumentRect();
</ins><span class="cx"> 
</span><span class="cx">     ColumnInfo* columnInfo = this-&gt;columnInfo();
</span><span class="cx">     LayoutRect backgroundRect(0, 0, columnInfo-&gt;desiredColumnWidth(), columnInfo-&gt;columnHeight() * columnInfo-&gt;columnCount());
</span></span></pre>
</div>
</div>

</body>
</html>