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

Unified Diff: Source/core/layout/LayerScrollableArea.cpp

Issue 910083002: Constify and use LayoutStyle reference in layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined again Created 5 years, 10 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 | « Source/core/layout/Layer.cpp ('k') | Source/core/layout/LayoutCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayerScrollableArea.cpp
diff --git a/Source/core/layout/LayerScrollableArea.cpp b/Source/core/layout/LayerScrollableArea.cpp
index f86d8a8a65c4de1a64e8c8199525087b3f48513b..3a967dc44fec75320afb972a24ff8a414908b764 100644
--- a/Source/core/layout/LayerScrollableArea.cpp
+++ b/Source/core/layout/LayerScrollableArea.cpp
@@ -254,14 +254,14 @@ bool LayerScrollableArea::isScrollCornerVisible() const
return !scrollCornerRect().isEmpty();
}
-static int cornerStart(const LayoutStyle* style, int minX, int maxX, int thickness)
+static int cornerStart(const LayoutStyle& style, int minX, int maxX, int thickness)
{
- if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- return minX + style->borderLeftWidth();
- return maxX - thickness - style->borderRightWidth();
+ if (style.shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ return minX + style.borderLeftWidth();
+ return maxX - thickness - style.borderRightWidth();
}
-static IntRect cornerRect(const LayoutStyle* style, const Scrollbar* horizontalScrollbar, const Scrollbar* verticalScrollbar, const IntRect& bounds)
+static IntRect cornerRect(const LayoutStyle& style, const Scrollbar* horizontalScrollbar, const Scrollbar* verticalScrollbar, const IntRect& bounds)
{
int horizontalThickness;
int verticalThickness;
@@ -281,7 +281,7 @@ static IntRect cornerRect(const LayoutStyle* style, const Scrollbar* horizontalS
verticalThickness = horizontalScrollbar->height();
}
return IntRect(cornerStart(style, bounds.x(), bounds.maxX(), horizontalThickness),
- bounds.maxY() - verticalThickness - style->borderBottomWidth(),
+ bounds.maxY() - verticalThickness - style.borderBottomWidth(),
horizontalThickness, verticalThickness);
}
@@ -296,7 +296,7 @@ IntRect LayerScrollableArea::scrollCornerRect() const
bool hasVerticalBar = verticalScrollbar();
bool hasResizer = box().style()->resize() != RESIZE_NONE;
if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar)))
- return cornerRect(box().style(), horizontalScrollbar(), verticalScrollbar(), box().pixelSnappedBorderBoxRect());
+ return cornerRect(box().styleRef(), horizontalScrollbar(), verticalScrollbar(), box().pixelSnappedBorderBoxRect());
return IntRect();
}
@@ -1102,7 +1102,7 @@ IntRect LayerScrollableArea::resizerCornerRect(const IntRect& bounds, ResizerHit
{
if (box().style()->resize() == RESIZE_NONE)
return IntRect();
- IntRect corner = cornerRect(box().style(), horizontalScrollbar(), verticalScrollbar(), bounds);
+ IntRect corner = cornerRect(box().styleRef(), horizontalScrollbar(), verticalScrollbar(), bounds);
if (resizerHitTestType == ResizerForTouch) {
// We make the resizer virtually larger for touch hit testing. With the
« no previous file with comments | « Source/core/layout/Layer.cpp ('k') | Source/core/layout/LayoutCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698