Index: Source/core/platform/ScrollView.cpp |
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp |
index 7337a3b54c7e8239a9dd91ef8f4dccc9ec3cf6cd..7844ceec8bacb84d00df0362a9cd821069c11bf9 100644 |
--- a/Source/core/platform/ScrollView.cpp |
+++ b/Source/core/platform/ScrollView.cpp |
@@ -184,15 +184,15 @@ IntSize ScrollView::unscaledVisibleContentSize(IncludeScrollbarsInRect scrollbar |
IntSize ScrollView::excludeScrollbars(const IntSize& size) const |
{ |
- int verticalScrollbarWidth = 0; |
+// int verticalScrollbarWidth = 0; |
int horizontalScrollbarHeight = 0; |
- if (Scrollbar* verticalBar = verticalScrollbar()) |
- verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0; |
+// if (Scrollbar* verticalBar = verticalScrollbar()) |
+// verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0; |
if (Scrollbar* horizontalBar = horizontalScrollbar()) |
horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0; |
- return IntSize(max(0, size.width() - verticalScrollbarWidth), |
+ return IntSize(max(0, size.width()), |
max(0, size.height() - horizontalScrollbarHeight)); |
} |
@@ -498,7 +498,8 @@ const int panIconSizeLength = 16; |
IntRect ScrollView::rectToCopyOnScroll() const |
{ |
- IntRect scrollViewRect = convertToRootView(IntRect((shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, visibleWidth(), visibleHeight())); |
+ // IntRect scrollViewRect = convertToRootView(IntRect((shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, visibleWidth(), visibleHeight())); |
+ IntRect scrollViewRect = convertToRootView(IntRect(0, 0, visibleWidth(), visibleHeight())); |
if (hasOverlayScrollbars()) { |
int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0; |
int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0; |
@@ -563,12 +564,14 @@ void ScrollView::scrollContentsSlowPath(const IntRect& updateRect) |
IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const |
{ |
IntPoint viewPoint = convertFromRootView(rootViewPoint); |
+ viewPoint.move(-verticalScrollbarWidth(), 0); |
return viewPoint + scrollOffset(); |
} |
IntPoint ScrollView::contentsToRootView(const IntPoint& contentsPoint) const |
{ |
IntPoint viewPoint = contentsPoint - scrollOffset(); |
+ viewPoint.move(verticalScrollbarWidth(), 0); |
return convertToRootView(viewPoint); |
} |
@@ -576,6 +579,7 @@ IntRect ScrollView::rootViewToContents(const IntRect& rootViewRect) const |
{ |
IntRect viewRect = convertFromRootView(rootViewRect); |
viewRect.move(scrollOffset()); |
+ viewRect.move(-verticalScrollbarWidth(), 0); |
return viewRect; |
} |
@@ -583,18 +587,21 @@ IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const |
{ |
IntRect viewRect = contentsRect; |
viewRect.move(-scrollOffset()); |
+ viewRect.move(verticalScrollbarWidth(), 0); |
return convertToRootView(viewRect); |
} |
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const |
{ |
IntPoint viewPoint = convertFromContainingWindow(windowPoint); |
+ viewPoint.move(-verticalScrollbarWidth(), 0); |
return viewPoint + scrollOffset(); |
} |
IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const |
{ |
IntPoint viewPoint = contentsPoint - scrollOffset(); |
+ viewPoint.move(verticalScrollbarWidth(), 0); |
return convertToContainingWindow(viewPoint); |
} |
@@ -602,6 +609,7 @@ IntRect ScrollView::windowToContents(const IntRect& windowRect) const |
{ |
IntRect viewRect = convertFromContainingWindow(windowRect); |
viewRect.move(scrollOffset()); |
+ viewRect.move(-verticalScrollbarWidth(), 0); |
return viewRect; |
} |
@@ -609,6 +617,7 @@ IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const |
{ |
IntRect viewRect = contentsRect; |
viewRect.move(-scrollOffset()); |
+ viewRect.move(verticalScrollbarWidth(), 0); |
return convertToContainingWindow(viewRect); |
} |
@@ -769,7 +778,7 @@ bool ScrollView::userInputScrollable(ScrollbarOrientation orientation) const |
bool ScrollView::shouldPlaceVerticalScrollbarOnLeft() const |
{ |
- return false; |
+ return true; |
} |
void ScrollView::repaintContentRectangle(const IntRect& rect) |
@@ -871,6 +880,8 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect) |
notifyPageThatContentAreaWillPaint(); |
IntRect documentDirtyRect = rect; |
+ documentDirtyRect.move(-verticalScrollbarWidth(), 0); |
+ documentDirtyRect.setWidth(rect.width() + 2*verticalScrollbarWidth()); |
if (!paintsEntireContents()) { |
IntRect visibleAreaWithoutScrollbars(location(), visibleContentRect().size()); |
documentDirtyRect.intersect(visibleAreaWithoutScrollbars); |
@@ -879,7 +890,7 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect) |
if (!documentDirtyRect.isEmpty()) { |
GraphicsContextStateSaver stateSaver(*context); |
- context->translate(x(), y()); |
+ context->translate(x() + verticalScrollbarWidth(), y()); |
documentDirtyRect.moveBy(-location()); |
if (!paintsEntireContents()) { |