Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2382103006: Use scrollbar thickness to set layout (Closed)
Patch Set: Updated Layout Test Expectations Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 54d58702ce7aba8c032085c93db3168a3dbf0e41..32054fb3d7af13061465e7b559e9ec93b3931750 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -490,11 +490,11 @@ IntRect PaintLayerScrollableArea::visibleContentRect(
if (scrollbarInclusion == IncludeScrollbars) {
verticalScrollbarWidth =
(verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
- ? verticalScrollbar()->width()
+ ? verticalScrollbar()->scrollbarThickness()
: 0;
horizontalScrollbarHeight =
(horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
- ? horizontalScrollbar()->height()
+ ? horizontalScrollbar()->scrollbarThickness()
: 0;
}
@@ -1002,7 +1002,7 @@ IntRect PaintLayerScrollableArea::rectForHorizontalScrollbar(
return IntRect(horizontalScrollbarStart(borderBoxRect.x()),
borderBoxRect.maxY() - box().borderBottom() -
- horizontalScrollbar()->height(),
+ horizontalScrollbar()->scrollbarThickness(),
borderBoxRect.width() -
(box().borderLeft() + box().borderRight()) -
scrollCorner.width(),
@@ -1027,14 +1027,14 @@ IntRect PaintLayerScrollableArea::rectForVerticalScrollbar(
int PaintLayerScrollableArea::verticalScrollbarStart(int minX, int maxX) const {
if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
return minX + box().borderLeft();
- return maxX - box().borderRight() - verticalScrollbar()->width();
+ return maxX - box().borderRight() - verticalScrollbar()->scrollbarThickness();
}
int PaintLayerScrollableArea::horizontalScrollbarStart(int minX) const {
int x = minX + box().borderLeft();
if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
x += hasVerticalScrollbar()
- ? verticalScrollbar()->width()
+ ? verticalScrollbar()->scrollbarThickness()
: resizerCornerRect(box().pixelSnappedBorderBoxRect(),
ResizerForPointer)
.width();
@@ -1191,7 +1191,7 @@ int PaintLayerScrollableArea::verticalScrollbarWidth(
(overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize ||
!verticalScrollbar()->shouldParticipateInHitTesting()))
return 0;
- return verticalScrollbar()->width();
+ return verticalScrollbar()->scrollbarThickness();
}
int PaintLayerScrollableArea::horizontalScrollbarHeight(
@@ -1202,7 +1202,7 @@ int PaintLayerScrollableArea::horizontalScrollbarHeight(
(overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize ||
!horizontalScrollbar()->shouldParticipateInHitTesting()))
return 0;
- return horizontalScrollbar()->height();
+ return horizontalScrollbar()->scrollbarThickness();
}
void PaintLayerScrollableArea::positionOverflowControls() {
@@ -1274,13 +1274,14 @@ bool PaintLayerScrollableArea::hitTestOverflowControls(
int resizeControlSize = max(resizeControlRect.height(), 0);
if (hasVerticalScrollbar() &&
verticalScrollbar()->shouldParticipateInHitTesting()) {
- LayoutRect vBarRect(
- verticalScrollbarStart(0, box().size().width().toInt()),
- box().borderTop(), verticalScrollbar()->width(),
- box().size().height().toInt() -
- (box().borderTop() + box().borderBottom()) -
- (hasHorizontalScrollbar() ? horizontalScrollbar()->height()
- : resizeControlSize));
+ LayoutRect vBarRect(verticalScrollbarStart(0, box().size().width().toInt()),
+ box().borderTop(),
+ verticalScrollbar()->scrollbarThickness(),
+ box().size().height().toInt() -
+ (box().borderTop() + box().borderBottom()) -
+ (hasHorizontalScrollbar()
+ ? horizontalScrollbar()->scrollbarThickness()
+ : resizeControlSize));
if (vBarRect.contains(localPoint)) {
result.setScrollbar(verticalScrollbar());
return true;
@@ -1294,13 +1295,13 @@ bool PaintLayerScrollableArea::hitTestOverflowControls(
LayoutRect hBarRect(
horizontalScrollbarStart(0),
(box().size().height() - box().borderBottom() -
- horizontalScrollbar()->height())
+ horizontalScrollbar()->scrollbarThickness())
.toInt(),
(box().size().width() - (box().borderLeft() + box().borderRight()) -
- (hasVerticalScrollbar() ? verticalScrollbar()->width()
+ (hasVerticalScrollbar() ? verticalScrollbar()->scrollbarThickness()
: resizeControlSize))
.toInt(),
- horizontalScrollbar()->height());
+ horizontalScrollbar()->scrollbarThickness());
if (hBarRect.contains(localPoint)) {
result.setScrollbar(horizontalScrollbar());
return true;
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698