Make ScrollView::paint() clip by visibleContentRect
https://bugs.webkit.org/show_bug.cgi?id=108888
Reviewed by Levi Weintraub.
When applyPageScaleFactorInCompositor or fixedVisibleContentRect
are used, frameRect() and visibleContentRect(true).size() are
no longer synonyms, and the latter is the one that should be
used for clipping paints.
New WebFrameTest: pageScaleFactorScalesPaintClip.
Source/WebCore:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
Source/WebKit/chromium:
* tests/WebFrameTest.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index a727c4a..f7fe63e 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -1051,14 +1051,9 @@
notifyPageThatContentAreaWillPaint();
- IntRect clipRect = frameRect();
- if (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
- clipRect.setWidth(clipRect.width() - verticalScrollbar()->width());
- if (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
- clipRect.setHeight(clipRect.height() - horizontalScrollbar()->height());
-
IntRect documentDirtyRect = rect;
- documentDirtyRect.intersect(clipRect);
+ IntRect visibleAreaWithoutScrollbars(location(), visibleContentRect(false).size());
+ documentDirtyRect.intersect(visibleAreaWithoutScrollbars);
if (!documentDirtyRect.isEmpty()) {
GraphicsContextStateSaver stateSaver(*context);
@@ -1087,7 +1082,8 @@
if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
GraphicsContextStateSaver stateSaver(*context);
IntRect scrollViewDirtyRect = rect;
- scrollViewDirtyRect.intersect(frameRect());
+ IntRect visibleAreaWithScrollbars(location(), visibleContentRect(true).size());
+ scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
context->translate(x(), y());
scrollViewDirtyRect.moveBy(-location());