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

Unified Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 178903004: RenderLayerScrollableArea::updateScrollCornerStyle shouldn't do work if we're using overlay scrollb… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the test Created 6 years, 9 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/rendering/RenderLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollableArea.cpp
diff --git a/Source/platform/scroll/ScrollableArea.cpp b/Source/platform/scroll/ScrollableArea.cpp
index e5c157112e9bd4d49893d9e125a1f9a402d5d1f8..af06540c5bcd3a037411713aa75eaa5027163db2 100644
--- a/Source/platform/scroll/ScrollableArea.cpp
+++ b/Source/platform/scroll/ScrollableArea.cpp
@@ -319,22 +319,25 @@ void ScrollableArea::contentsResized()
bool ScrollableArea::hasOverlayScrollbars() const
{
- return (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar())
- || (horizontalScrollbar() && horizontalScrollbar()->isOverlayScrollbar());
+ Scrollbar* vScrollbar = verticalScrollbar();
+ if (vScrollbar && vScrollbar->isOverlayScrollbar())
+ return true;
+ Scrollbar* hScrollbar = horizontalScrollbar();
+ return hScrollbar && hScrollbar->isOverlayScrollbar();
}
void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
{
m_scrollbarOverlayStyle = overlayStyle;
- if (horizontalScrollbar()) {
- ScrollbarTheme::theme()->updateScrollbarOverlayStyle(horizontalScrollbar());
- horizontalScrollbar()->invalidate();
+ if (Scrollbar* scrollbar = horizontalScrollbar()) {
+ ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar);
+ scrollbar->invalidate();
}
- if (verticalScrollbar()) {
- ScrollbarTheme::theme()->updateScrollbarOverlayStyle(verticalScrollbar());
- verticalScrollbar()->invalidate();
+ if (Scrollbar* scrollbar = verticalScrollbar()) {
+ ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar);
+ scrollbar->invalidate();
}
}
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698