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

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

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: update 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 9767274a2a6a1a2784f48e208702e6774aae7ad4..f5c9506e7b1f4fd7c1df4e0136dfd35e5504aa5e 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -969,7 +969,7 @@ void PaintLayerScrollableArea::updateAfterStyleChange(
box().style()->visitedDependentColor(CSSPropertyBackgroundColor);
if (newBackground != oldBackground) {
- recalculateScrollbarOverlayStyle(newBackground);
+ recalculateScrollbarOverlayStyle(newBackground, m_layer.isTransparent());
}
}
@@ -1273,6 +1273,25 @@ void PaintLayerScrollableArea::updateScrollCornerStyle() {
}
}
+ScrollbarOverlayStyle PaintLayerScrollableArea::getScrollbarOverlayStyle()
+ const {
+ ScrollbarOverlayStyle style = ScrollableArea::getScrollbarOverlayStyle();
+
+ if (style == ScrollbarOverlayStyleDefault) {
bokan 2016/10/18 19:55:25 ScrollableArea has a layoutBox() method that retur
+ PaintLayer* layer = &this->m_layer;
+ while (layer->isTransparent() && layer->parent())
+ layer = layer->parent();
+
+ if (layer->layoutBox() && layer->layoutBox()->style()) {
+ Color color = layer->layoutBox()->style()->visitedDependentColor(
+ CSSPropertyBackgroundColor);
+ style = calculateScrollbarOverlayStyle(color);
+ }
+ }
+
+ return style;
+}
+
bool PaintLayerScrollableArea::hitTestOverflowControls(
HitTestResult& result,
const IntPoint& localPoint) {

Powered by Google App Engine
This is Rietveld 408576698