25
25
#include < LibWeb/CSS/CSSStyleProperties.h>
26
26
#include < LibWeb/CSS/CSSStyleRule.h>
27
27
#include < LibWeb/CSS/CSSSupportsRule.h>
28
+ #include < LibWeb/CSS/FontFace.h>
28
29
#include < LibWeb/CSS/Parser/Parser.h>
29
30
#include < LibWeb/CSS/PropertyName.h>
30
31
#include < LibWeb/CSS/StyleValues/CSSKeywordValue.h>
@@ -592,15 +593,6 @@ GC::Ptr<CSSPropertyRule> Parser::convert_to_property_rule(AtRule const& rule)
592
593
template <typename T>
593
594
Vector<ParsedFontFace::Source> Parser::parse_font_face_src (TokenStream<T>& component_values)
594
595
{
595
- // FIXME: Get this information from the system somehow?
596
- // Format-name table: https://www.w3.org/TR/css-fonts-4/#font-format-definitions
597
- auto font_format_is_supported = [](StringView name) {
598
- // The spec requires us to treat opentype and truetype as synonymous.
599
- if (name.is_one_of_ignoring_ascii_case (" opentype" sv, " truetype" sv, " woff" sv, " woff2" sv))
600
- return true ;
601
- return false ;
602
- };
603
-
604
596
Vector<ParsedFontFace::Source> supported_sources;
605
597
606
598
auto list_of_source_token_lists = parse_a_comma_separated_list_of_component_values (component_values);
@@ -637,7 +629,7 @@ Vector<ParsedFontFace::Source> Parser::parse_font_face_src(TokenStream<T>& compo
637
629
TokenStream format_tokens { function.value };
638
630
format_tokens.discard_whitespace ();
639
631
auto const & format_name_token = format_tokens.consume_a_token ();
640
- StringView format_name;
632
+ FlyString format_name;
641
633
if (format_name_token.is (Token::Type::Ident)) {
642
634
format_name = format_name_token.token ().ident ();
643
635
} else if (format_name_token.is (Token::Type::String)) {
@@ -652,7 +644,7 @@ Vector<ParsedFontFace::Source> Parser::parse_font_face_src(TokenStream<T>& compo
652
644
continue ;
653
645
}
654
646
655
- format = FlyString::from_utf8 (format_name). release_value_but_fixme_should_propagate_errors ( );
647
+ format = move (format_name);
656
648
} else {
657
649
dbgln_if (CSS_PARSER_DEBUG, " CSSParser: @font-face src invalid (unrecognized function token `{}`); discarding." , function.name );
658
650
return {};
0 commit comments