Changeset 88183 in webkit


Ignore:
Timestamp:
Jun 6, 2011 12:57:36 PM (13 years ago)
Author:
eae@chromium.org
Message:

2011-06-06 Emil A Eklund <eae@chromium.org>

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):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88178 r88183  
     12011-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
    1202011-06-06  Peter Kasting  <pkasting@google.com>
    221
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r88178 r88183  
    11501150}
    11511151
    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 
     1152IntRect RenderBox::clipRect(const IntPoint& location)
     1153{
     1154    IntRect clipRect(location, size());
    11591155    if (!style()->clipLeft().isAuto()) {
    11601156        int c = style()->clipLeft().calcValue(width());
    1161         clipX += c;
    1162         clipWidth -= c;
     1157        clipRect.move(c, 0);
     1158        clipRect.contract(c, 0);
    11631159    }
    11641160
    11651161    if (!style()->clipRight().isAuto())
    1166         clipWidth -= width() - style()->clipRight().calcValue(width());
     1162        clipRect.contract(width() - style()->clipRight().calcValue(width()), 0);
    11671163
    11681164    if (!style()->clipTop().isAuto()) {
    11691165        int c = style()->clipTop().calcValue(height());
    1170         clipY += c;
    1171         clipHeight -= c;
     1166        clipRect.move(0, c);
     1167        clipRect.contract(0, c);
    11721168    }
    11731169
    11741170    if (!style()->clipBottom().isAuto())
    1175         clipHeight -= 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;
    11781174}
    11791175
  • trunk/Source/WebCore/rendering/RenderBox.h

    r88178 r88183  
    347347
    348348    virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
    349     IntRect clipRect(int tx, int ty);
     349    IntRect clipRect(const IntPoint& location);
    350350    virtual bool hasControlClip() const { return false; }
    351351    virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); }
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r88178 r88183  
    33803380        }
    33813381        if (renderer()->hasClip()) {
    3382             IntRect newPosClip = toRenderBox(renderer())->clipRect(offset.x(), offset.y());
     3382            IntRect newPosClip = toRenderBox(renderer())->clipRect(offset);
    33833383            clipRects.setPosClipRect(intersection(newPosClip, clipRects.posClipRect()));
    33843384            clipRects.setOverflowClipRect(intersection(newPosClip, clipRects.overflowClipRect()));
     
    34413441        if (renderer()->hasClip()) {
    34423442            // 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);
    34443444            backgroundRect.intersect(newPosClip);
    34453445            foregroundRect.intersect(newPosClip);
     
    35123512        rect.intersect(toRenderBox(renderer())->overflowClipRect(IntPoint()));
    35133513    if (renderer()->hasClip())
    3514         rect.intersect(toRenderBox(renderer())->clipRect(0, 0));
     3514        rect.intersect(toRenderBox(renderer())->clipRect(IntPoint()));
    35153515    if (!rect.isEmpty())
    35163516        renderer()->repaintRectangle(rect);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r88102 r88183  
    320320
    321321    if (renderer->hasClip())
    322         result.intersect(renderer->clipRect(0, 0));
     322        result.intersect(renderer->clipRect(IntPoint()));
    323323
    324324    return result;
Note: See TracChangeset for help on using the changeset viewer.