Diff
Modified: trunk/Source/WebCore/ChangeLog (88182 => 88183)
--- trunk/Source/WebCore/ChangeLog 2011-06-06 19:57:32 UTC (rev 88182)
+++ trunk/Source/WebCore/ChangeLog 2011-06-06 19:57:36 UTC (rev 88183)
@@ -1,3 +1,22 @@
+2011-06-06 Emil A Eklund <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Convert RenderBox::clipRect to IntPoint
+ https://bugs.webkit.org/show_bug.cgi?id=62045
+
+ Covered by existing tests.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::clipRect):
+ * rendering/RenderBox.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects):
+ (WebCore::RenderLayer::calculateRects):
+ (WebCore::RenderLayer::repaintBlockSelectionGaps):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::clipBox):
+
2011-06-06 Peter Kasting <[email protected]>
Reviewed by Antonio Gomes.
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (88182 => 88183)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-06 19:57:32 UTC (rev 88182)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-06 19:57:36 UTC (rev 88183)
@@ -1149,32 +1149,28 @@
return clipRect;
}
-IntRect RenderBox::clipRect(int tx, int ty)
+IntRect RenderBox::clipRect(const IntPoint& location)
{
- int clipX = tx;
- int clipY = ty;
- int clipWidth = width();
- int clipHeight = height();
-
+ IntRect clipRect(location, size());
if (!style()->clipLeft().isAuto()) {
int c = style()->clipLeft().calcValue(width());
- clipX += c;
- clipWidth -= c;
+ clipRect.move(c, 0);
+ clipRect.contract(c, 0);
}
if (!style()->clipRight().isAuto())
- clipWidth -= width() - style()->clipRight().calcValue(width());
+ clipRect.contract(width() - style()->clipRight().calcValue(width()), 0);
if (!style()->clipTop().isAuto()) {
int c = style()->clipTop().calcValue(height());
- clipY += c;
- clipHeight -= c;
+ clipRect.move(0, c);
+ clipRect.contract(0, c);
}
if (!style()->clipBottom().isAuto())
- clipHeight -= height() - style()->clipBottom().calcValue(height());
+ clipRect.contract(0, height() - style()->clipBottom().calcValue(height()));
- return IntRect(clipX, clipY, clipWidth, clipHeight);
+ return clipRect;
}
int RenderBox::containingBlockLogicalWidthForContent() const
Modified: trunk/Source/WebCore/rendering/RenderBox.h (88182 => 88183)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-06-06 19:57:32 UTC (rev 88182)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-06-06 19:57:36 UTC (rev 88183)
@@ -346,7 +346,7 @@
virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
- IntRect clipRect(int tx, int ty);
+ IntRect clipRect(const IntPoint& location);
virtual bool hasControlClip() const { return false; }
virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); }
bool pushContentsClip(PaintInfo&, int tx, int ty);
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (88182 => 88183)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-06 19:57:32 UTC (rev 88182)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-06 19:57:36 UTC (rev 88183)
@@ -3379,7 +3379,7 @@
clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect()));
}
if (renderer()->hasClip()) {
- IntRect newPosClip = toRenderBox(renderer())->clipRect(offset.x(), offset.y());
+ IntRect newPosClip = toRenderBox(renderer())->clipRect(offset);
clipRects.setPosClipRect(intersection(newPosClip, clipRects.posClipRect()));
clipRects.setOverflowClipRect(intersection(newPosClip, clipRects.overflowClipRect()));
clipRects.setFixedClipRect(intersection(newPosClip, clipRects.fixedClipRect()));
@@ -3440,7 +3440,7 @@
foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(offset, relevancy));
if (renderer()->hasClip()) {
// Clip applies to *us* as well, so go ahead and update the damageRect.
- IntRect newPosClip = toRenderBox(renderer())->clipRect(offset.x(), offset.y());
+ IntRect newPosClip = toRenderBox(renderer())->clipRect(offset);
backgroundRect.intersect(newPosClip);
foregroundRect.intersect(newPosClip);
outlineRect.intersect(newPosClip);
@@ -3511,7 +3511,7 @@
if (renderer()->hasOverflowClip())
rect.intersect(toRenderBox(renderer())->overflowClipRect(IntPoint()));
if (renderer()->hasClip())
- rect.intersect(toRenderBox(renderer())->clipRect(0, 0));
+ rect.intersect(toRenderBox(renderer())->clipRect(IntPoint()));
if (!rect.isEmpty())
renderer()->repaintRectangle(rect);
}
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (88182 => 88183)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-06-06 19:57:32 UTC (rev 88182)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-06-06 19:57:36 UTC (rev 88183)
@@ -319,7 +319,7 @@
result = renderer->overflowClipRect(IntPoint());
if (renderer->hasClip())
- result.intersect(renderer->clipRect(0, 0));
+ result.intersect(renderer->clipRect(IntPoint()));
return result;
}