mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Parse src: local(...) in CSS @font-face rules
Note that we don't load the local font as specified, but at least we no longer reject such src properties in the CSS parser. This makes the custom fonts used on http://apple.com/ actually load. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:16:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/13e2ca6b59 Pull-request: https://github.com/SerenityOS/serenity/pull/20762
@@ -62,8 +62,11 @@ DeprecatedString CSSFontFaceRule::serialized() const
|
||||
|
||||
// 2. The result of invoking serialize a comma-separated list on performing serialize a URL or serialize a LOCAL for each source on the source list.
|
||||
serialize_a_comma_separated_list(builder, m_font_face.sources(), [&](StringBuilder& builder, FontFace::Source source) -> void {
|
||||
// FIXME: Serialize locals once we support those
|
||||
serialize_a_url(builder, source.url.to_deprecated_string());
|
||||
if (source.local_or_url.has<AK::URL>()) {
|
||||
serialize_a_url(builder, source.local_or_url.get<AK::URL>().to_deprecated_string());
|
||||
} else {
|
||||
builder.appendff("local({})", source.local_or_url.get<String>());
|
||||
}
|
||||
|
||||
// NOTE: No spec currently exists for format()
|
||||
if (source.format.has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user