Changeset 88183 in webkit
- Timestamp:
- Jun 6, 2011 12:57:36 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88178 r88183 1 2011-06-06 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Convert RenderBox::clipRect to IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62045 7 8 Covered by existing tests. 9 10 * rendering/RenderBox.cpp: 11 (WebCore::RenderBox::clipRect): 12 * rendering/RenderBox.h: 13 * rendering/RenderLayer.cpp: 14 (WebCore::RenderLayer::calculateClipRects): 15 (WebCore::RenderLayer::calculateRects): 16 (WebCore::RenderLayer::repaintBlockSelectionGaps): 17 * rendering/RenderLayerBacking.cpp: 18 (WebCore::clipBox): 19 1 20 2011-06-06 Peter Kasting <pkasting@google.com> 2 21 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r88178 r88183 1150 1150 } 1151 1151 1152 IntRect RenderBox::clipRect(int tx, int ty) 1153 { 1154 int clipX = tx; 1155 int clipY = ty; 1156 int clipWidth = width(); 1157 int clipHeight = height(); 1158 1152 IntRect RenderBox::clipRect(const IntPoint& location) 1153 { 1154 IntRect clipRect(location, size()); 1159 1155 if (!style()->clipLeft().isAuto()) { 1160 1156 int c = style()->clipLeft().calcValue(width()); 1161 clip X += c;1162 clip Width -= c;1157 clipRect.move(c, 0); 1158 clipRect.contract(c, 0); 1163 1159 } 1164 1160 1165 1161 if (!style()->clipRight().isAuto()) 1166 clip Width -= width() - style()->clipRight().calcValue(width());1162 clipRect.contract(width() - style()->clipRight().calcValue(width()), 0); 1167 1163 1168 1164 if (!style()->clipTop().isAuto()) { 1169 1165 int c = style()->clipTop().calcValue(height()); 1170 clip Y += c;1171 clip Height -= c;1166 clipRect.move(0, c); 1167 clipRect.contract(0, c); 1172 1168 } 1173 1169 1174 1170 if (!style()->clipBottom().isAuto()) 1175 clip Height -= height() - style()->clipBottom().calcValue(height());1176 1177 return IntRect(clipX, clipY, clipWidth, clipHeight);1171 clipRect.contract(0, height() - style()->clipBottom().calcValue(height())); 1172 1173 return clipRect; 1178 1174 } 1179 1175 -
trunk/Source/WebCore/rendering/RenderBox.h
r88178 r88183 347 347 348 348 virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 349 IntRect clipRect( int tx, int ty);349 IntRect clipRect(const IntPoint& location); 350 350 virtual bool hasControlClip() const { return false; } 351 351 virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r88178 r88183 3380 3380 } 3381 3381 if (renderer()->hasClip()) { 3382 IntRect newPosClip = toRenderBox(renderer())->clipRect(offset .x(), offset.y());3382 IntRect newPosClip = toRenderBox(renderer())->clipRect(offset); 3383 3383 clipRects.setPosClipRect(intersection(newPosClip, clipRects.posClipRect())); 3384 3384 clipRects.setOverflowClipRect(intersection(newPosClip, clipRects.overflowClipRect())); … … 3441 3441 if (renderer()->hasClip()) { 3442 3442 // Clip applies to *us* as well, so go ahead and update the damageRect. 3443 IntRect newPosClip = toRenderBox(renderer())->clipRect(offset .x(), offset.y());3443 IntRect newPosClip = toRenderBox(renderer())->clipRect(offset); 3444 3444 backgroundRect.intersect(newPosClip); 3445 3445 foregroundRect.intersect(newPosClip); … … 3512 3512 rect.intersect(toRenderBox(renderer())->overflowClipRect(IntPoint())); 3513 3513 if (renderer()->hasClip()) 3514 rect.intersect(toRenderBox(renderer())->clipRect( 0, 0));3514 rect.intersect(toRenderBox(renderer())->clipRect(IntPoint())); 3515 3515 if (!rect.isEmpty()) 3516 3516 renderer()->repaintRectangle(rect); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r88102 r88183 320 320 321 321 if (renderer->hasClip()) 322 result.intersect(renderer->clipRect( 0, 0));322 result.intersect(renderer->clipRect(IntPoint())); 323 323 324 324 return result;
Note: See TracChangeset
for help on using the changeset viewer.