diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderInline.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderInline.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp index 941375509..234cea28b 100644 --- a/Source/WebCore/rendering/RenderInline.cpp +++ b/Source/WebCore/rendering/RenderInline.cpp @@ -993,15 +993,8 @@ LayoutRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* rep if (cb->hasColumns()) 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. - repaintRect.move(-cb->scrolledContentOffset()); // For overflow:auto/scroll/hidden. - - LayoutRect boxRect(LayoutPoint(), cb->cachedSizeForOverflowClip()); - repaintRect.intersect(boxRect); - } + if (cb->hasOverflowClip()) + cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); cb->computeRectForRepaint(repaintContainer, repaintRect); @@ -1073,21 +1066,13 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout, // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. + rect.setLocation(topLeft); if (o->hasOverflowClip()) { RenderBox* containerBox = toRenderBox(o); - - // o->height() is inaccurate if we're in the middle of a layout of |o|, 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. - topLeft -= containerBox->scrolledContentOffset(); // For overflow:auto/scroll/hidden. - - LayoutRect repaintRect(topLeft, rect.size()); - LayoutRect boxRect(LayoutPoint(), containerBox->cachedSizeForOverflowClip()); - rect = intersection(repaintRect, boxRect); + containerBox->applyCachedClipAndScrollOffsetForRepaint(rect); if (rect.isEmpty()) return; - } else - rect.setLocation(topLeft); + } if (containerSkipped) { // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. |