@@ -1901,28 +1901,18 @@ RefPtr<Gfx::FontCascadeList const> StyleComputer::compute_font_for_style_values(
19011901 };
19021902
19031903 auto font_list = Gfx::FontCascadeList::create ();
1904- if (font_family.is_value_list ()) {
1905- auto const & family_list = static_cast <StyleValueList const &>(font_family).values ();
1906- for (auto const & family : family_list) {
1907- RefPtr<Gfx::FontCascadeList const > other_font_list;
1908- if (family->is_keyword ()) {
1909- other_font_list = find_generic_font (family->to_keyword ());
1910- } else if (family->is_string ()) {
1911- other_font_list = find_font (family->as_string ().string_value ());
1912- } else if (family->is_custom_ident ()) {
1913- other_font_list = find_font (family->as_custom_ident ().custom_ident ());
1914- }
1915- if (other_font_list)
1916- font_list->extend (*other_font_list);
1904+
1905+ for (auto const & family : font_family.as_value_list ().values ()) {
1906+ RefPtr<Gfx::FontCascadeList const > other_font_list;
1907+ if (family->is_keyword ()) {
1908+ other_font_list = find_generic_font (family->to_keyword ());
1909+ } else if (family->is_string ()) {
1910+ other_font_list = find_font (family->as_string ().string_value ());
1911+ } else if (family->is_custom_ident ()) {
1912+ other_font_list = find_font (family->as_custom_ident ().custom_ident ());
19171913 }
1918- } else if (font_family.is_keyword ()) {
1919- if (auto other_font_list = find_generic_font (font_family.to_keyword ()))
1920- font_list->extend (*other_font_list);
1921- } else if (font_family.is_string ()) {
1922- if (auto other_font_list = find_font (font_family.as_string ().string_value ()))
1923- font_list->extend (*other_font_list);
1924- } else if (font_family.is_custom_ident ()) {
1925- if (auto other_font_list = find_font (font_family.as_custom_ident ().custom_ident ()))
1914+
1915+ if (other_font_list)
19261916 font_list->extend (*other_font_list);
19271917 }
19281918
@@ -2430,14 +2420,12 @@ GC::Ptr<ComputedProperties> StyleComputer::compute_style_impl(DOM::AbstractEleme
24302420
24312421static bool is_monospace (StyleValue const & value)
24322422{
2433- if (value.to_keyword () == Keyword::Monospace)
2434- return true ;
2435- if (value.is_value_list ()) {
2436- auto const & values = value.as_value_list ().values ();
2437- if (values.size () == 1 && values[0 ]->to_keyword () == Keyword::Monospace)
2438- return true ;
2439- }
2440- return false ;
2423+ if (!value.is_value_list ())
2424+ return false ;
2425+
2426+ auto const & values = value.as_value_list ().values ();
2427+
2428+ return values.size () == 1 && values[0 ]->to_keyword () == Keyword::Monospace;
24412429}
24422430
24432431// HACK: This function implements time-travelling inheritance for the font-size property
0 commit comments