<!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>[160590] 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/160590">160590</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2013-12-13 23:29:30 -0800 (Fri, 13 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move RenderObject::repaintAfterLayoutIfNeeded() to RenderElement.
<https://webkit.org/b/125712>
This function is only ever called on RenderElements, so move it there.
Removes some RenderObject::style() branchiness.
Reviewed by Darin Adler.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.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>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160589 => 160590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-14 07:17:59 UTC (rev 160589)
+++ trunk/Source/WebCore/ChangeLog        2013-12-14 07:29:30 UTC (rev 160590)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2013-12-13 Andreas Kling <akling@apple.com>
+
+ Move RenderObject::repaintAfterLayoutIfNeeded() to RenderElement.
+ <https://webkit.org/b/125712>
+
+ This function is only ever called on RenderElements, so move it there.
+ Removes some RenderObject::style() branchiness.
+
+ Reviewed by Darin Adler.
+
</ins><span class="cx"> 2013-12-13 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Move Inspector and Debugger protocol domains into JavaScriptCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (160589 => 160590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2013-12-14 07:17:59 UTC (rev 160589)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2013-12-14 07:29:30 UTC (rev 160590)
</span><span class="lines">@@ -1131,4 +1131,173 @@
</span><span class="cx"> clearNeedsLayout();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static bool mustRepaintFillLayers(const RenderElement& renderer, const FillLayer* layer)
+{
+ // Nobody will use multiple layers without wanting fancy positioning.
+ if (layer->next())
+ return true;
+
+ // Make sure we have a valid image.
+ StyleImage* image = layer->image();
+ if (!image || !image->canRender(&renderer, renderer.style().effectiveZoom()))
+ return false;
+
+ if (!layer->xPosition().isZero() || !layer->yPosition().isZero())
+ return true;
+
+ EFillSizeType sizeType = layer->sizeType();
+
+ if (sizeType == Contain || sizeType == Cover)
+ return true;
+
+ if (sizeType == SizeLength) {
+ LengthSize size = layer->sizeLength();
+ if (size.width().isPercent() || size.height().isPercent())
+ return true;
+ // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
+ if ((size.width().isAuto() || size.height().isAuto()) && image->isGeneratedImage())
+ return true;
+ } else if (image->usesImageContainerSize())
+ return true;
+
+ return false;
</ins><span class="cx"> }
</span><ins>+
+static bool mustRepaintBackgroundOrBorder(const RenderElement& renderer)
+{
+ if (renderer.hasMask() && mustRepaintFillLayers(renderer, renderer.style().maskLayers()))
+ return true;
+
+ // If we don't have a background/border/mask, then nothing to do.
+ if (!renderer.hasBoxDecorations())
+ return false;
+
+ if (mustRepaintFillLayers(renderer, renderer.style().backgroundLayers()))
+ return true;
+
+ // Our fill layers are ok. Let's check border.
+ if (renderer.style().hasBorder() && renderer.borderImageIsLoadedAndCanBeRendered())
+ return true;
+
+ return false;
+}
+
+bool RenderElement::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr, const LayoutRect* newOutlineBoxRectPtr)
+{
+ if (view().printing())
+ return false; // Don't repaint if we're printing.
+
+ // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
+ // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
+ LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
+ LayoutRect newOutlineBox;
+
+ bool fullRepaint = selfNeedsLayout();
+ // Presumably a background or a border exists if border-fit:lines was specified.
+ if (!fullRepaint && style().borderFit() == BorderFitLines)
+ fullRepaint = true;
+ if (!fullRepaint) {
+ // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
+ // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
+ newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBoundsForRepaint(repaintContainer);
+ if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder(*this) && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
+ fullRepaint = true;
+ }
+
+ if (!repaintContainer)
+ repaintContainer = &view();
+
+ if (fullRepaint) {
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds));
+ if (newBounds != oldBounds)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds));
+ return true;
+ }
+
+ if (newBounds == oldBounds && newOutlineBox == oldOutlineBox)
+ return false;
+
+ LayoutUnit deltaLeft = newBounds.x() - oldBounds.x();
+ if (deltaLeft > 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
+ else if (deltaLeft < 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
+
+ LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
+ if (deltaRight > 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()));
+ else if (deltaRight < 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()));
+
+ LayoutUnit deltaTop = newBounds.y() - oldBounds.y();
+ if (deltaTop > 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
+ else if (deltaTop < 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
+
+ LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
+ if (deltaBottom > 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom));
+ else if (deltaBottom < 0)
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom));
+
+ if (newOutlineBox == oldOutlineBox)
+ return false;
+
+ // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
+ // two rectangles (but typically only one).
+ const RenderStyle& outlineStyle = outlineStyleForRepaint();
+ LayoutUnit outlineWidth = outlineStyle.outlineSize();
+ LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent();
+ LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width());
+ if (width) {
+ LayoutUnit shadowLeft;
+ LayoutUnit shadowRight;
+ style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
+ int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
+ LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
+ LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width()));
+ LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
+ LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowRight);
+ LayoutRect rightRect(newOutlineBox.x() + std::min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth,
+ newOutlineBox.y(),
+ width + decorationsWidth,
+ std::max(newOutlineBox.height(), oldOutlineBox.height()));
+ LayoutUnit right = std::min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
+ if (rightRect.x() < right) {
+ rightRect.setWidth(std::min(rightRect.width(), right - rightRect.x()));
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRect));
+ }
+ }
+ LayoutUnit height = absoluteValue(newOutlineBox.height() - oldOutlineBox.height());
+ if (height) {
+ LayoutUnit shadowTop;
+ LayoutUnit shadowBottom;
+ style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
+ int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
+ LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
+ LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height()));
+ LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom, std::max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
+ LayoutUnit decorationsHeight = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowBottom);
+ LayoutRect bottomRect(newOutlineBox.x(),
+ std::min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight,
+ std::max(newOutlineBox.width(), oldOutlineBox.width()),
+ height + decorationsHeight);
+ LayoutUnit bottom = std::min(newBounds.maxY(), oldBounds.maxY());
+ if (bottomRect.y() < bottom) {
+ bottomRect.setHeight(std::min(bottomRect.height(), bottom - bottomRect.y()));
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRect));
+ }
+ }
+ return false;
+}
+
+bool RenderElement::borderImageIsLoadedAndCanBeRendered() const
+{
+ ASSERT(style().hasBorder());
+
+ StyleImage* borderImage = style().borderImage().image();
+ return borderImage && borderImage->canRender(this, style().effectiveZoom()) && borderImage->isLoaded();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (160589 => 160590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2013-12-14 07:17:59 UTC (rev 160589)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2013-12-14 07:29:30 UTC (rev 160590)
</span><span class="lines">@@ -109,6 +109,11 @@
</span><span class="cx"> // and so only should be called when the style is known not to have changed (or from setStyle).
</span><span class="cx"> void setStyleInternal(PassRef<RenderStyle> style) { m_style = std::move(style); }
</span><span class="cx">
</span><ins>+ // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
+ bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = nullptr, const LayoutRect* newOutlineBoxPtr = nullptr);
+
+ bool borderImageIsLoadedAndCanBeRendered() const;
+
</ins><span class="cx"> protected:
</span><span class="cx"> enum BaseTypeFlags {
</span><span class="cx"> RenderLayerModelObjectFlag = 1 << 0,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (160589 => 160590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2013-12-14 07:17:59 UTC (rev 160589)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2013-12-14 07:29:30 UTC (rev 160590)
</span><span class="lines">@@ -754,65 +754,6 @@
</span><span class="cx"> return toRenderBlock(o);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool mustRepaintFillLayers(const RenderObject* renderer, const FillLayer* layer)
-{
- // Nobody will use multiple layers without wanting fancy positioning.
- if (layer->next())
- return true;
-
- // Make sure we have a valid image.
- StyleImage* image = layer->image();
- if (!image || !image->canRender(renderer, renderer->style().effectiveZoom()))
- return false;
-
- if (!layer->xPosition().isZero() || !layer->yPosition().isZero())
- return true;
-
- EFillSizeType sizeType = layer->sizeType();
-
- if (sizeType == Contain || sizeType == Cover)
- return true;
-
- if (sizeType == SizeLength) {
- LengthSize size = layer->sizeLength();
- if (size.width().isPercent() || size.height().isPercent())
- return true;
- // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
- if ((size.width().isAuto() || size.height().isAuto()) && image->isGeneratedImage())
- return true;
- } else if (image->usesImageContainerSize())
- return true;
-
- return false;
-}
-
-bool RenderObject::borderImageIsLoadedAndCanBeRendered() const
-{
- ASSERT(style().hasBorder());
-
- StyleImage* borderImage = style().borderImage().image();
- return borderImage && borderImage->canRender(toRenderElement(this), style().effectiveZoom()) && borderImage->isLoaded();
-}
-
-bool RenderObject::mustRepaintBackgroundOrBorder() const
-{
- if (hasMask() && mustRepaintFillLayers(this, style().maskLayers()))
- return true;
-
- // If we don't have a background/border/mask, then nothing to do.
- if (!hasBoxDecorations())
- return false;
-
- if (mustRepaintFillLayers(this, style().backgroundLayers()))
- return true;
-
- // Our fill layers are ok. Let's check border.
- if (style().hasBorder() && borderImageIsLoadedAndCanBeRendered())
- return true;
-
- return false;
-}
-
</del><span class="cx"> void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, int x1, int y1, int x2, int y2,
</span><span class="cx"> BoxSide side, Color color, EBorderStyle borderStyle, int adjacentWidth1, int adjacentWidth2, bool antialias)
</span><span class="cx"> {
</span><span class="lines">@@ -1393,116 +1334,6 @@
</span><span class="cx"> return pixelSnappedIntRect(absoluteClippedOverflowRect());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr, const LayoutRect* newOutlineBoxRectPtr)
-{
- if (view().printing())
- return false; // Don't repaint if we're printing.
-
- // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
- // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
- LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
- LayoutRect newOutlineBox;
-
- bool fullRepaint = selfNeedsLayout();
- // Presumably a background or a border exists if border-fit:lines was specified.
- if (!fullRepaint && style().borderFit() == BorderFitLines)
- fullRepaint = true;
- if (!fullRepaint) {
- // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
- // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
- newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBoundsForRepaint(repaintContainer);
- if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
- fullRepaint = true;
- }
-
- if (!repaintContainer)
- repaintContainer = &view();
-
- if (fullRepaint) {
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds));
- if (newBounds != oldBounds)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds));
- return true;
- }
-
- if (newBounds == oldBounds && newOutlineBox == oldOutlineBox)
- return false;
-
- LayoutUnit deltaLeft = newBounds.x() - oldBounds.x();
- if (deltaLeft > 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
- else if (deltaLeft < 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
-
- LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
- if (deltaRight > 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()));
- else if (deltaRight < 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()));
-
- LayoutUnit deltaTop = newBounds.y() - oldBounds.y();
- if (deltaTop > 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
- else if (deltaTop < 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
-
- LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
- if (deltaBottom > 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom));
- else if (deltaBottom < 0)
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom));
-
- if (newOutlineBox == oldOutlineBox)
- return false;
-
- // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
- // two rectangles (but typically only one).
- const RenderStyle& outlineStyle = outlineStyleForRepaint();
- LayoutUnit outlineWidth = outlineStyle.outlineSize();
- LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent();
- LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width());
- if (width) {
- LayoutUnit shadowLeft;
- LayoutUnit shadowRight;
- style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
- int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
- LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
- LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width()));
- LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
- LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowRight);
- LayoutRect rightRect(newOutlineBox.x() + std::min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth,
- newOutlineBox.y(),
- width + decorationsWidth,
- std::max(newOutlineBox.height(), oldOutlineBox.height()));
- LayoutUnit right = std::min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
- if (rightRect.x() < right) {
- rightRect.setWidth(std::min(rightRect.width(), right - rightRect.x()));
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRect));
- }
- }
- LayoutUnit height = absoluteValue(newOutlineBox.height() - oldOutlineBox.height());
- if (height) {
- LayoutUnit shadowTop;
- LayoutUnit shadowBottom;
- style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
- int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
- LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
- LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height()));
- LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom, std::max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
- LayoutUnit decorationsHeight = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + std::max<LayoutUnit>(outlineWidth, shadowBottom);
- LayoutRect bottomRect(newOutlineBox.x(),
- std::min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight,
- std::max(newOutlineBox.width(), oldOutlineBox.width()),
- height + decorationsHeight);
- LayoutUnit bottom = std::min(newBounds.maxY(), oldBounds.maxY());
- if (bottomRect.y() < bottom) {
- bottomRect.setHeight(std::min(bottomRect.height(), bottom - bottomRect.y()));
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRect));
- }
- }
- return false;
-}
-
</del><span class="cx"> bool RenderObject::checkForRepaintDuringLayout() const
</span><span class="cx"> {
</span><span class="cx"> return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayout();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (160589 => 160590)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h        2013-12-14 07:17:59 UTC (rev 160589)
+++ trunk/Source/WebCore/rendering/RenderObject.h        2013-12-14 07:29:30 UTC (rev 160590)
</span><span class="lines">@@ -541,8 +541,6 @@
</span><span class="cx"> };
</span><span class="cx"> bool hasBoxDecorations() const { return m_bitfields.boxDecorationState() != NoBoxDecorations; }
</span><span class="cx"> bool backgroundIsKnownToBeObscured();
</span><del>- bool borderImageIsLoadedAndCanBeRendered() const;
- bool mustRepaintBackgroundOrBorder() const;
</del><span class="cx"> bool hasBackground() const { return style().hasBackground(); }
</span><span class="cx"> bool hasEntirelyFixedBackground() const;
</span><span class="cx">
</span><span class="lines">@@ -769,9 +767,6 @@
</span><span class="cx"> // Repaint a specific subrectangle within a given object. The rect |r| is in the object's coordinate space.
</span><span class="cx"> void repaintRectangle(const LayoutRect&, bool immediate = false) const;
</span><span class="cx">
</span><del>- // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
- bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0);
-
</del><span class="cx"> bool checkForRepaintDuringLayout() const;
</span><span class="cx">
</span><span class="cx"> // Returns the rect that should be repainted whenever this object changes. The rect is in the view's
</span></span></pre>
</div>
</div>
</body>
</html>