Commit a76165cb authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Wrap OS preferred font name with quotes.

This is necessary to ensure that the font name will be correctly
parsed in CSS, even when it contains a number or punctuation mark.

Fixed: 1128566
Change-Id: Ia4159483cac30a350eabaddaf5142fd58a9bd299
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2456633
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814849}
parent ce70940a
......@@ -230,10 +230,12 @@ std::string GetFontFamily() {
// into Ozone: crbug.com/320050
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
if (!features::IsUsingOzonePlatform()) {
font_family = ui::ResourceBundle::GetSharedInstance()
.GetFont(ui::ResourceBundle::BaseFont)
.GetFontName() +
", " + font_family;
std::string font_name = ui::ResourceBundle::GetSharedInstance()
.GetFont(ui::ResourceBundle::BaseFont)
.GetFontName();
// Wrap |font_name| with quotes to ensure it will always be parsed correctly
// in CSS.
font_family = "\"" + font_name + "\", " + font_family;
}
#endif
......
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