Commit 49a124c2 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Eliminate redundant calls of Font::Update() in FontFaceSetDocument

Both call sites of Font::Update() in FontFaceSetDocument are
redundant, so this patch removes them.

The first call site is redundant as StyleResolver::ComputeFont()
will set the underlying Document's FontSelector to the font.

The second call site is redundant as it repeatedly sets the Document's
FontSelector to the font.

This is also preparation for eliminating Font::Update().

Bug: 1049295
Change-Id: I43196beb8c77e420083a125a6050d73d06e7b9c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103146Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750591}
parent f6ca3b78
......@@ -173,14 +173,16 @@ bool FontFaceSetDocument::ResolveFontStyle(const String& font_string,
style->SetFontDescription(default_font_description);
style->GetFont().Update(style->GetFont().GetFontSelector());
GetDocument()->UpdateActiveStyle();
GetDocument()->EnsureStyleResolver().ComputeFont(
*GetDocument()->documentElement(), style.get(), *parsed_style);
font = style->GetFont();
font.Update(GetFontSelector());
// StyleResolver::ComputeFont() should have set the document's FontSelector
// to |style|.
DCHECK_EQ(font.GetFontSelector(), GetFontSelector());
return true;
}
......
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