Index: Source/core/layout/LayoutReplaced.cpp |
diff --git a/Source/core/layout/LayoutReplaced.cpp b/Source/core/layout/LayoutReplaced.cpp |
index 7a6250239a1cd7d7684e5fc56643f443814f3a3e..80096013623213eb402c3d0f3951b4ee69efe83e 100644 |
--- a/Source/core/layout/LayoutReplaced.cpp |
+++ b/Source/core/layout/LayoutReplaced.cpp |
@@ -124,11 +124,12 @@ bool LayoutReplaced::shouldPaint(const PaintInfo& paintInfo, const LayoutPoint& |
if (style()->visibility() != VISIBLE) |
return false; |
- LayoutPoint adjustedPaintOffset = paintOffset + location(); |
+ LayoutRect paintRect(visualOverflowRect()); |
+ paintRect.moveBy(paintOffset + location()); |
// Early exit if the element touches the edges. |
- LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); |
- LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); |
+ LayoutUnit top = paintRect.y(); |
+ LayoutUnit bottom = paintRect.maxY(); |
if (isSelected() && inlineBoxWrapper()) { |
LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selectionTop(); |
LayoutUnit selBottom = paintOffset.y() + selTop + inlineBoxWrapper()->root().selectionHeight(); |
@@ -136,7 +137,7 @@ bool LayoutReplaced::shouldPaint(const PaintInfo& paintInfo, const LayoutPoint& |
bottom = std::max(selBottom, bottom); |
} |
- if (adjustedPaintOffset.x() + visualOverflowRect().x() >= paintInfo.rect.maxX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= paintInfo.rect.x()) |
+ if (paintRect.x() >= paintInfo.rect.maxX() || paintRect.maxX() <= paintInfo.rect.x()) |
return false; |
if (top >= paintInfo.rect.maxY() || bottom <= paintInfo.rect.y()) |