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

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

Issue 2640143005: Support subpixel layout for borders. (Closed)
Patch Set: Created 3 years, 11 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
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 017c2ed163cc6e5f1ce641666a7653c1cdb3390a..a6ab308ac1e96e4680766c3b5cde4f1de9cca2ff 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1043,10 +1043,10 @@ IntRect PaintLayerScrollableArea::rectForHorizontalScrollbar(
const IntRect& scrollCorner = scrollCornerRect();
return IntRect(horizontalScrollbarStart(borderBoxRect.x()),
- borderBoxRect.maxY() - box().borderBottom() -
+ borderBoxRect.maxY() - box().borderBottom().toInt() -
horizontalScrollbar()->scrollbarThickness(),
borderBoxRect.width() -
- (box().borderLeft() + box().borderRight()) -
+ (box().borderLeft() + box().borderRight()).toInt() -
scrollCorner.width(),
horizontalScrollbar()->scrollbarThickness());
}
@@ -1060,20 +1060,22 @@ IntRect PaintLayerScrollableArea::rectForVerticalScrollbar(
return IntRect(
verticalScrollbarStart(borderBoxRect.x(), borderBoxRect.maxX()),
- borderBoxRect.y() + box().borderTop(),
+ borderBoxRect.y() + box().borderTop().toInt(),
verticalScrollbar()->scrollbarThickness(),
- borderBoxRect.height() - (box().borderTop() + box().borderBottom()) -
+ borderBoxRect.height() -
+ (box().borderTop() + box().borderBottom()).toInt() -
scrollCorner.height());
}
int PaintLayerScrollableArea::verticalScrollbarStart(int minX, int maxX) const {
if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- return minX + box().borderLeft();
- return maxX - box().borderRight() - verticalScrollbar()->scrollbarThickness();
+ return minX + box().borderLeft().toInt();
+ return maxX - box().borderRight().toInt() -
+ verticalScrollbar()->scrollbarThickness();
}
int PaintLayerScrollableArea::horizontalScrollbarStart(int minX) const {
- int x = minX + box().borderLeft();
+ int x = minX + box().borderLeft().toInt();
if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
x += hasVerticalScrollbar()
? verticalScrollbar()->scrollbarThickness()
@@ -1085,9 +1087,10 @@ int PaintLayerScrollableArea::horizontalScrollbarStart(int minX) const {
IntSize PaintLayerScrollableArea::scrollbarOffset(
const Scrollbar& scrollbar) const {
- if (&scrollbar == verticalScrollbar())
+ if (&scrollbar == verticalScrollbar()) {
return IntSize(verticalScrollbarStart(0, box().size().width().toInt()),
- box().borderTop());
+ box().borderTop().toInt());
+ }
if (&scrollbar == horizontalScrollbar())
return IntSize(
@@ -1365,10 +1368,10 @@ bool PaintLayerScrollableArea::hitTestOverflowControls(
if (hasVerticalScrollbar() &&
verticalScrollbar()->shouldParticipateInHitTesting()) {
LayoutRect vBarRect(verticalScrollbarStart(0, box().size().width().toInt()),
- box().borderTop(),
+ box().borderTop().toInt(),
verticalScrollbar()->scrollbarThickness(),
box().size().height().toInt() -
- (box().borderTop() + box().borderBottom()) -
+ (box().borderTop() + box().borderBottom()).toInt() -
(hasHorizontalScrollbar()
? horizontalScrollbar()->scrollbarThickness()
: resizeControlSize));

Powered by Google App Engine
This is Rietveld 408576698