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

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

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: fix test 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
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 269315c8c8c2b9484cf5b7e4a151c033feff5db1..d24d79670ec318bbe425e2f953f40ce35ecc177f 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -853,6 +853,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.
@@ -890,20 +906,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() {

Powered by Google App Engine
This is Rietveld 408576698