<!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>[188744] 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/188744">188744</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2015-08-20 19:57:32 -0700 (Thu, 20 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make outline: auto repaint rect inflate more explicit.
https://bugs.webkit.org/show_bug.cgi?id=148263

Reviewed by Simon Fraser.

Use RenderObject::adjustRectWithMaximumOutline() when inflating is conditional and call
RenderView::maximalOutlineSize() when it is not.
After this changeset, we can clearly tell calls when inflating is unconditional (adjusting the size of the compositing layer) apart from
calls when we just simply inflate the repaint rect during outline painting phase.

No change in behaviour.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::computeMaxOutlineSize):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLineBoxList.cpp:
(WebCore::isOutlinePhase):
(WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
(WebCore::RenderLineBoxList::paint):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustRectWithMaximumOutline):
(WebCore::RenderObject::maximalOutlineSize): Deleted.
* rendering/RenderObject.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::overflowRectForFlowThreadPortion):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldPaint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paint):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorders):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintObject):
* rendering/RenderView.cpp:
(WebCore::RenderView::setMaximalOutlineSize):
(WebCore::RenderView::RenderView): Deleted.
* rendering/RenderView.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderDetailsMarkercpp">trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLineBoxListcpp">trunk/Source/WebCore/rendering/RenderLineBoxList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListMarkercpp">trunk/Source/WebCore/rendering/RenderListMarker.cpp</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="#trunkSourceWebCorerenderingRenderRegioncpp">trunk/Source/WebCore/rendering/RenderRegion.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderReplacedcpp">trunk/Source/WebCore/rendering/RenderReplaced.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTablecpp">trunk/Source/WebCore/rendering/RenderTable.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableCellcpp">trunk/Source/WebCore/rendering/RenderTableCell.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectioncpp">trunk/Source/WebCore/rendering/RenderTableSection.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewh">trunk/Source/WebCore/rendering/RenderView.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/ChangeLog        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-08-20  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Make outline: auto repaint rect inflate more explicit.
+        https://bugs.webkit.org/show_bug.cgi?id=148263
+
+        Reviewed by Simon Fraser.
+
+        Use RenderObject::adjustRectWithMaximumOutline() when inflating is conditional and call
+        RenderView::maximalOutlineSize() when it is not.
+        After this changeset, we can clearly tell calls when inflating is unconditional (adjusting the size of the compositing layer) apart from
+        calls when we just simply inflate the repaint rect during outline painting phase.
+
+        No change in behaviour.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paint):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::layoutBlock):
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::paint):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::computeMaxOutlineSize):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLineBoxList.cpp:
+        (WebCore::isOutlinePhase):
+        (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
+        (WebCore::RenderLineBoxList::paint):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::adjustRectWithMaximumOutline):
+        (WebCore::RenderObject::maximalOutlineSize): Deleted.
+        * rendering/RenderObject.h:
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::shouldPaint):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::paint):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintCollapsedBorders):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::paintObject):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setMaximalOutlineSize):
+        (WebCore::RenderView::RenderView): Deleted.
+        * rendering/RenderView.h:
+
</ins><span class="cx"> 2015-08-20  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [OS X] Cleaup after r188591
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1126,7 +1126,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));
</span><del>-    overflowRect.inflate(renderer().maximalOutlineSize(paintInfo.phase));
</del><ins>+    renderer().adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
</ins><span class="cx">     flipForWritingMode(overflowRect);
</span><span class="cx">     overflowRect.moveBy(paintOffset);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1400,7 +1400,7 @@
</span><span class="cx">     if (!isRoot()) {
</span><span class="cx">         LayoutRect overflowBox = overflowRectForPaintRejection(namedFlowFragment);
</span><span class="cx">         flipForWritingMode(overflowBox);
</span><del>-        overflowBox.inflate(maximalOutlineSize(phase));
</del><ins>+        adjustRectWithMaximumOutline(phase, overflowBox);
</ins><span class="cx">         overflowBox.moveBy(adjustedPaintOffset);
</span><span class="cx">         if (!overflowBox.intersects(paintInfo.rect)
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx">         else
</span><span class="cx">             repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
</span><span class="cx"> 
</span><del>-        repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
</del><ins>+        repaintRect.inflate(view().maximalOutlineSize());
</ins><span class="cx">         
</span><span class="cx">         if (hasOverflowClip()) {
</span><span class="cx">             // Adjust repaint rect for scroll offset
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderDetailsMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">     LayoutPoint boxOrigin(paintOffset + location());
</span><span class="cx">     LayoutRect overflowRect(visualOverflowRect());
</span><span class="cx">     overflowRect.moveBy(boxOrigin);
</span><del>-    overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
</del><ins>+    adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
</ins><span class="cx"> 
</span><span class="cx">     if (!paintInfo.rect.intersects(snappedIntRect(overflowRect)))
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx">     if (m_style-&gt;outlineStyleIsAuto())
</span><span class="cx">         maxOutlineSize = std::max(theme().platformFocusRingWidth() + m_style-&gt;outlineOffset(), maxOutlineSize);
</span><span class="cx"> 
</span><del>-    if (maxOutlineSize &lt; maximalOutlineSize(PaintPhaseOutline))
</del><ins>+    if (maxOutlineSize &lt; view().maximalOutlineSize())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     view().setMaximalOutlineSize(maxOutlineSize);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -5612,7 +5612,7 @@
</span><span class="cx">         // If the region does not clip its overflow, inflate the outline rect.
</span><span class="cx">         if (namedFlowFragment) {
</span><span class="cx">             if (!(namedFlowFragment-&gt;parent()-&gt;hasOverflowClip() &amp;&amp; (&amp;namedFlowFragment-&gt;fragmentContainerLayer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)))
</span><del>-                outlineRect.inflate(renderer().maximalOutlineSize(PaintPhaseOutline));
</del><ins>+                outlineRect.inflate(renderer().view().maximalOutlineSize());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -5830,7 +5830,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    result.inflate(renderer().view().maximalOutlineSize()); // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
</del><ins>+    result.inflate(renderer().view().maximalOutlineSize());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLineBoxListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -200,11 +200,17 @@
</span><span class="cx">     return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isOutlinePhase(PaintPhase phase)
+{
+    return phase == PaintPhaseOutline || phase == PaintPhaseSelfOutline || phase == PaintPhaseChildOutlines;
+}
+
</ins><span class="cx"> bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo&amp; paintInfo, const LayoutPoint&amp; offset) const
</span><span class="cx"> {
</span><span class="cx">     const RootInlineBox&amp; rootBox = box-&gt;root();
</span><del>-    LayoutUnit logicalTop = std::min&lt;LayoutUnit&gt;(box-&gt;logicalTopVisualOverflow(rootBox.lineTop()), rootBox.selectionTop()) - renderer-&gt;maximalOutlineSize(paintInfo.phase);
-    LayoutUnit logicalBottom = box-&gt;logicalBottomVisualOverflow(rootBox.lineBottom()) + renderer-&gt;maximalOutlineSize(paintInfo.phase);
</del><ins>+    const LayoutUnit outlineSize = isOutlinePhase(paintInfo.phase) ? renderer-&gt;view().maximalOutlineSize() : 0;
+    LayoutUnit logicalTop = std::min(box-&gt;logicalTopVisualOverflow(rootBox.lineTop()), rootBox.selectionTop()) - outlineSize;
+    LayoutUnit logicalBottom = box-&gt;logicalBottomVisualOverflow(rootBox.lineBottom()) + outlineSize;
</ins><span class="cx">     
</span><span class="cx">     return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, offset);
</span><span class="cx"> }
</span><span class="lines">@@ -221,7 +227,7 @@
</span><span class="cx">     // NSViews.  Do not add any more code for this.
</span><span class="cx">     RenderView&amp; v = renderer-&gt;view();
</span><span class="cx">     bool usePrintRect = !v.printRect().isEmpty();
</span><del>-    LayoutUnit outlineSize = renderer-&gt;maximalOutlineSize(paintInfo.phase);
</del><ins>+    LayoutUnit outlineSize = isOutlinePhase(paintInfo.phase) ? v.maximalOutlineSize() : 0;
</ins><span class="cx">     if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, usePrintRect, outlineSize))
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListMarker.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1184,7 +1184,7 @@
</span><span class="cx">     LayoutPoint boxOrigin(paintOffset + location());
</span><span class="cx">     LayoutRect overflowRect(visualOverflowRect());
</span><span class="cx">     overflowRect.moveBy(boxOrigin);
</span><del>-    overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
</del><ins>+    adjustRectWithMaximumOutline(paintInfo.phase, overflowRect);
</ins><span class="cx"> 
</span><span class="cx">     if (!paintInfo.rect.intersects(overflowRect))
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1878,11 +1878,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-int RenderObject::maximalOutlineSize(PaintPhase p) const
</del><ins>+void RenderObject::adjustRectWithMaximumOutline(PaintPhase phase, LayoutRect&amp; rect) const
</ins><span class="cx"> {
</span><del>-    if (p != PaintPhaseOutline &amp;&amp; p != PaintPhaseSelfOutline &amp;&amp; p != PaintPhaseChildOutlines)
-        return 0;
-    return view().maximalOutlineSize();
</del><ins>+    if (phase != PaintPhaseOutline &amp;&amp; phase != PaintPhaseSelfOutline &amp;&amp; phase != PaintPhaseChildOutlines)
+        return;
+    rect.inflate(view().maximalOutlineSize());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int RenderObject::caretMinOffset() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderObject.h        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -764,7 +764,7 @@
</span><span class="cx">     bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
</span><span class="cx"> 
</span><span class="cx">     // Applied as a &quot;slop&quot; to dirty rect checks during the outline painting phase's dirty-rect checks.
</span><del>-    int maximalOutlineSize(PaintPhase) const;
</del><ins>+    void adjustRectWithMaximumOutline(PaintPhase, LayoutRect&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     enum SelectionState {
</span><span class="cx">         SelectionNone, // The object is not selected.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRegioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRegion.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRegion.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderRegion.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     LayoutRect flowThreadOverflow = overflowType == VisualOverflow ? visualOverflowRectForBox(*m_flowThread) : layoutOverflowRectForBox(m_flowThread);
</span><span class="cx"> 
</span><span class="cx">     // We are interested about the outline size only when computing the visual overflow.
</span><del>-    LayoutUnit outlineSize = overflowType == VisualOverflow ? LayoutUnit(maximalOutlineSize(PaintPhaseOutline)) : LayoutUnit();
</del><ins>+    LayoutUnit outlineSize = overflowType == VisualOverflow ? LayoutUnit(view().maximalOutlineSize()) : LayoutUnit();
</ins><span class="cx">     LayoutRect clipRect;
</span><span class="cx">     if (m_flowThread-&gt;isHorizontalWritingMode()) {
</span><span class="cx">         LayoutUnit minY = isFirstPortion ? (flowThreadOverflow.y() - outlineSize) : flowThreadPortionRect.y();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderReplacedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderReplaced.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     LayoutRect localRepaintRect = paintInfo.rect;
</span><del>-    localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
</del><ins>+    adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
</ins><span class="cx">     if (adjustedPaintOffset.x() + visualOverflowRect().x() &gt;= localRepaintRect.maxX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() &lt;= localRepaintRect.x())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -661,8 +661,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (!isRoot()) {
</span><span class="cx">         LayoutRect overflowBox = visualOverflowRect();
</span><ins>+        adjustRectWithMaximumOutline(paintInfo.phase, overflowBox);
</ins><span class="cx">         flipForWritingMode(overflowBox);
</span><del>-        overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
</del><span class="cx">         overflowBox.moveBy(adjustedPaintOffset);
</span><span class="cx">         if (!overflowBox.intersects(paintInfo.rect))
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCell.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1192,7 +1192,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LayoutRect localRepaintRect = paintInfo.rect;
</span><del>-    localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
</del><ins>+    adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect paintRect = LayoutRect(paintOffset + location(), snappedIntRect(frameRect()).size());
</span><span class="cx">     if (paintRect.y() - table()-&gt;outerBorderTop() &gt;= localRepaintRect.maxY())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -1228,11 +1228,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTableSection::paintObject(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset)
</span><span class="cx"> {
</span><del>-    PaintPhase paintPhase = paintInfo.phase;
-
</del><span class="cx">     LayoutRect localRepaintRect = paintInfo.rect;
</span><ins>+    adjustRectWithMaximumOutline(paintInfo.phase, localRepaintRect);
</ins><span class="cx">     localRepaintRect.moveBy(-paintOffset);
</span><del>-    localRepaintRect.inflate(maximalOutlineSize(paintPhase));
</del><span class="cx"> 
</span><span class="cx">     LayoutRect tableAlignedRect = logicalRectForWritingModeAndDirection(localRepaintRect);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -122,7 +122,6 @@
</span><span class="cx">     , m_selectionUnsplitStartPos(-1)
</span><span class="cx">     , m_selectionUnsplitEndPos(-1)
</span><span class="cx">     , m_rendererCount(0)
</span><del>-    , m_maximalOutlineSize(0)
</del><span class="cx">     , m_lazyRepaintTimer(*this, &amp;RenderView::lazyRepaintTimerFired)
</span><span class="cx">     , m_pageLogicalHeight(0)
</span><span class="cx">     , m_pageLogicalHeightChanged(false)
</span><span class="lines">@@ -854,14 +853,15 @@
</span><span class="cx"> // Compositing layer dimensions take outline size into account, so we have to recompute layer
</span><span class="cx"> // bounds when it changes.
</span><span class="cx"> // FIXME: This is ugly; it would be nice to have a better way to do this.
</span><del>-void RenderView::setMaximalOutlineSize(int o)
</del><ins>+void RenderView::setMaximalOutlineSize(int outlineSize)
</ins><span class="cx"> {
</span><del>-    if (o != m_maximalOutlineSize) {
-        m_maximalOutlineSize = o;
-
-        // maximalOutlineSize affects compositing layer dimensions.
-        compositor().setCompositingLayersNeedRebuild();    // FIXME: this really just needs to be a geometry update.
-    }
</del><ins>+    if (outlineSize == m_maximalOutlineSize)
+        return;
+    
+    m_maximalOutlineSize = outlineSize;
+    // maximalOutlineSize affects compositing layer dimensions.
+    // FIXME: this really just needs to be a geometry update.
+    compositor().setCompositingLayersNeedRebuild();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode blockRepaintMode)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.h (188743 => 188744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.h        2015-08-21 02:54:27 UTC (rev 188743)
+++ trunk/Source/WebCore/rendering/RenderView.h        2015-08-21 02:57:32 UTC (rev 188744)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     virtual void absoluteRects(Vector&lt;IntRect&gt;&amp;, const LayoutPoint&amp; accumulatedOffset) const override;
</span><span class="cx">     virtual void absoluteQuads(Vector&lt;FloatQuad&gt;&amp;, bool* wasFixed) const override;
</span><span class="cx"> 
</span><del>-    void setMaximalOutlineSize(int o);
</del><ins>+    void setMaximalOutlineSize(int);
</ins><span class="cx">     int maximalOutlineSize() const { return m_maximalOutlineSize; }
</span><span class="cx"> 
</span><span class="cx">     LayoutRect viewRect() const;
</span><span class="lines">@@ -345,7 +345,8 @@
</span><span class="cx">     LegacyPrinting m_legacyPrinting;
</span><span class="cx">     // End deprecated members.
</span><span class="cx"> 
</span><del>-    int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
</del><ins>+    // Used to inflate compositing layers and repaint rects.
+    int m_maximalOutlineSize { 0 };
</ins><span class="cx"> 
</span><span class="cx">     bool shouldUsePrintingLayout() const;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>