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 60e26e7f06221dc65c16a6a16a84f84d02d69581..d1c08245d8532baa6b91bcbc05e685bf6d91618b 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -857,6 +857,22 @@ void PaintLayerScrollableArea::updateAfterStyleChange( |
hasScrollableVerticalOverflow()); |
} |
+ // Whenever background changes on the scrollable element, the scroll bar |
+ // overlay style might need to be changed to have contrast against the |
+ // background. |
+ // Skip the need scrollbar check, because we dont know do we need a scrollbar |
+ // when this method get called. |
+ Color oldBackground; |
+ if (oldStyle) { |
+ oldBackground = oldStyle->visitedDependentColor(CSSPropertyBackgroundColor); |
+ } |
+ Color newBackground = |
+ box().style()->visitedDependentColor(CSSPropertyBackgroundColor); |
+ |
+ if (newBackground != oldBackground) { |
+ recalculateScrollbarOverlayColorTheme(newBackground); |
+ } |
+ |
bool needsHorizontalScrollbar; |
bool needsVerticalScrollbar; |
// We add auto scrollbars only during layout to prevent spurious activations. |
@@ -894,20 +910,6 @@ void PaintLayerScrollableArea::updateAfterStyleChange( |
updateScrollCornerStyle(); |
updateResizerAreaSet(); |
updateResizerStyle(); |
- |
- // Whenever background changes on the scrollable element, the scroll bar |
- // overlay style might need to be changed to have contrast against the |
- // background. |
- Color oldBackground; |
- if (oldStyle) { |
- oldBackground = oldStyle->visitedDependentColor(CSSPropertyBackgroundColor); |
- } |
- Color newBackground = |
- box().style()->visitedDependentColor(CSSPropertyBackgroundColor); |
- |
- if (newBackground != oldBackground) { |
- recalculateScrollbarOverlayStyle(newBackground); |
- } |
} |
bool PaintLayerScrollableArea::updateAfterCompositingChange() { |