Commit 127d99bb authored by Sam Sebree's avatar Sam Sebree Committed by Commit Bot

[Controls Refresh] Dark mode scrollbars are not dynamically updated bugfix

This CL addresses a bug in which, when the OS color scheme is changed, the scrollbars on the page maintain their old color scheme.

Bug: 1137169
Change-Id: I22416b906aa06e0476dc298fd2d3a0e9653305d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522563Reviewed-by: default avatarYu Han <yuzhehan@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Sam Sebree <sasebree@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#826430}
parent 33026f0b
......@@ -8477,11 +8477,24 @@ void Document::SetShowBeforeUnloadDialog(bool show_dialog) {
}
void Document::ColorSchemeChanged() {
InvalidateScrollbars();
UpdateForcedColors();
GetStyleEngine().ColorSchemeChanged();
MediaQueryAffectingValueChanged(MediaValueChange::kOther);
}
void Document::InvalidateScrollbars() {
if (PaintLayerScrollableArea* scrollable_area =
GetLayoutView()->GetScrollableArea()) {
if (auto* horizontal_scrollbar = scrollable_area->HorizontalScrollbar()) {
horizontal_scrollbar->SetNeedsPaintInvalidation(kAllParts);
}
if (auto* vertical_scrollbar = scrollable_area->VerticalScrollbar()) {
vertical_scrollbar->SetNeedsPaintInvalidation(kAllParts);
}
}
}
void Document::VisionDeficiencyChanged() {
GetStyleEngine().VisionDeficiencyChanged();
}
......
......@@ -1724,6 +1724,8 @@ class CORE_EXPORT Document : public ContainerNode,
void PropagateStyleToViewport();
void InvalidateScrollbars();
void UpdateUseShadowTreesIfNeeded();
void EvaluateMediaQueryListIfNeeded();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment