fix: use white background for non-OSR renderer by default (#14934)

This commit is contained in:
Cheng Zhao 2018-10-03 13:41:37 +09:00 committed by GitHub
parent ee6de82c08
commit bf928ee443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,8 +213,13 @@ void WebContentsPreferences::AppendCommandLineSwitches(
// --background-color. // --background-color.
std::string s; std::string s;
if (dict_.GetString(options::kBackgroundColor, &s)) if (dict_.GetString(options::kBackgroundColor, &s)) {
command_line->AppendSwitchASCII(switches::kBackgroundColor, s); command_line->AppendSwitchASCII(switches::kBackgroundColor, s);
} else if (!(dict_.GetBoolean(options::kOffscreen, &b) && b)) {
// For non-OSR WebContents, we expect to have white background, see
// https://github.com/electron/electron/issues/13764 for more.
command_line->AppendSwitchASCII(switches::kBackgroundColor, "#fff");
}
// --guest-instance-id, which is used to identify guest WebContents. // --guest-instance-id, which is used to identify guest WebContents.
int guest_instance_id = 0; int guest_instance_id = 0;