Title: [117497] trunk/Source/WebCore
- Revision
- 117497
- Author
- jchaffr...@webkit.org
- Date
- 2012-05-17 14:31:10 -0700 (Thu, 17 May 2012)
Log Message
Kill RenderLayer::relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) and cleanup RenderInline::clippedOverflowRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=86551
Reviewed by Abhishek Arya.
No test since there is no expected change in behavior.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint):
Changed the function to use LayoutRect arithmetics instead of calculating
top / left manually. While at it, improved the naming, removed some local
variables and removed an unneeded style() NULL-check.
* rendering/RenderLayer.h: Removed the function.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (117496 => 117497)
--- trunk/Source/WebCore/ChangeLog 2012-05-17 21:23:22 UTC (rev 117496)
+++ trunk/Source/WebCore/ChangeLog 2012-05-17 21:31:10 UTC (rev 117497)
@@ -1,3 +1,20 @@
+2012-05-17 Julien Chaffraix <jchaffr...@webkit.org>
+
+ Kill RenderLayer::relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) and cleanup RenderInline::clippedOverflowRectForRepaint
+ https://bugs.webkit.org/show_bug.cgi?id=86551
+
+ Reviewed by Abhishek Arya.
+
+ No test since there is no expected change in behavior.
+
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::clippedOverflowRectForRepaint):
+ Changed the function to use LayoutRect arithmetics instead of calculating
+ top / left manually. While at it, improved the naming, removed some local
+ variables and removed an unneeded style() NULL-check.
+
+ * rendering/RenderLayer.h: Removed the function.
+
2012-05-17 Rob Buis <rwlb...@webkit.org>
[BlackBerry] Fix linking errors
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (117496 => 117497)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2012-05-17 21:23:22 UTC (rev 117496)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2012-05-17 21:31:10 UTC (rev 117497)
@@ -932,14 +932,7 @@
if (!firstLineBoxIncludingCulling() && !continuation())
return LayoutRect();
- // Find our leftmost position.
- LayoutRect boundingBox(linesVisualOverflowBoundingBox());
- LayoutUnit left = boundingBox.x();
- LayoutUnit top = boundingBox.y();
-
- // Now invalidate a rectangle.
- LayoutUnit ow = style() ? style()->outlineSize() : 0;
-
+ LayoutRect repaintRect(linesVisualOverflowBoundingBox());
bool hitRepaintContainer = false;
// We need to add in the relative position offsets of any inlines (including us) up to our
@@ -952,45 +945,41 @@
break;
}
if (inlineFlow->style()->position() == RelativePosition && inlineFlow->hasLayer())
- toRenderInline(inlineFlow)->layer()->relativePositionOffset(left, top);
+ repaintRect.move(toRenderInline(inlineFlow)->layer()->relativePositionOffset());
}
- LayoutRect r(-ow + left, -ow + top, boundingBox.width() + ow * 2, boundingBox.height() + ow * 2);
+ LayoutUnit outlineSize = style()->outlineSize();
+ repaintRect.inflate(outlineSize);
if (hitRepaintContainer || !cb)
- return r;
+ return repaintRect;
if (cb->hasColumns())
- cb->adjustRectForColumns(r);
+ cb->adjustRectForColumns(repaintRect);
if (cb->hasOverflowClip()) {
// cb->height() is inaccurate if we're in the middle of a layout of |cb|, so use the
// layer's size instead. Even if the layer's size is wrong, the layer itself will repaint
// anyway if its size does change.
- LayoutRect repaintRect(r);
repaintRect.move(-cb->scrolledContentOffset()); // For overflow:auto/scroll/hidden.
LayoutRect boxRect(LayoutPoint(), cb->cachedSizeForOverflowClip());
- r = intersection(repaintRect, boxRect);
+ repaintRect.intersect(boxRect);
}
- cb->computeRectForRepaint(repaintContainer, r);
+ cb->computeRectForRepaint(repaintContainer, repaintRect);
- if (ow) {
+ if (outlineSize) {
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
- if (!curr->isText()) {
- LayoutRect childRect = curr->rectWithOutlineForRepaint(repaintContainer, ow);
- r.unite(childRect);
- }
+ if (!curr->isText())
+ repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContainer, outlineSize));
}
- if (continuation() && !continuation()->isInline() && continuation()->parent()) {
- LayoutRect contRect = continuation()->rectWithOutlineForRepaint(repaintContainer, ow);
- r.unite(contRect);
- }
+ if (continuation() && !continuation()->isInline() && continuation()->parent())
+ repaintRect.unite(continuation()->rectWithOutlineForRepaint(repaintContainer, outlineSize));
}
- return r;
+ return repaintRect;
}
LayoutRect RenderInline::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (117496 => 117497)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2012-05-17 21:23:22 UTC (rev 117496)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2012-05-17 21:31:10 UTC (rev 117497)
@@ -369,7 +369,6 @@
void updateTransform();
- void relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) const { relX += m_relativeOffset.width(); relY += m_relativeOffset.height(); }
const LayoutSize& relativePositionOffset() const { return m_relativeOffset; }
void clearClipRectsIncludingDescendants();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes