fix: default to system accent color on invalid user color (#47921)

fix: default to system accent color on invalid user color"

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-08-05 15:08:55 +02:00 committed by GitHub
commit c787127e91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 38 additions and 41 deletions

View file

@ -864,9 +864,10 @@ WebContents::WebContents(v8::Isolate* isolate,
// webPreferences does not have a transparent option, so if the window needs
// to be transparent, that will be set at electron_api_browser_window.cc#L57
// and we then need to pull it back out and check it here.
std::string background_color;
options.GetHidden(options::kBackgroundColor, &background_color);
bool transparent = ParseCSSColor(background_color) == SK_ColorTRANSPARENT;
std::string background_color_str;
options.GetHidden(options::kBackgroundColor, &background_color_str);
SkColor bc = ParseCSSColor(background_color_str).value_or(SK_ColorWHITE);
bool transparent = bc == SK_ColorTRANSPARENT;
content::WebContents::CreateParams params(session->browser_context());
auto* view = new OffScreenWebContentsView(