Skip to content

Commit

Permalink
WebContent: Invalidate document style when changing the page's palette
Browse files Browse the repository at this point in the history
This makes the page automatically update to reflect the system theme
when in "Color Scheme > Follow System Theme" mode without having to
manually cause a style update.
  • Loading branch information
Lubrsi authored and linusg committed Jul 5, 2022
1 parent 3294753 commit a4e3fff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Userland/Services/WebContent/PageHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Gfx::Palette PageHost::palette() const
void PageHost::set_palette_impl(Gfx::PaletteImpl const& impl)
{
m_palette_impl = impl;
if (auto* document = page().top_level_browsing_context().active_document())
document->invalidate_style();
}

void PageHost::set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme)
Expand Down

0 comments on commit a4e3fff

Please sign in to comment.