mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Parse and use tech() in @font-face { src }
This commit is contained in:
parent
5b42f8d707
commit
d611806f18
Notes:
github-actions[bot]
2025-06-05 11:39:21 +00:00
Author: https://github.com/AtkinsSJ
Commit: d611806f18
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4983
Reviewed-by: https://github.com/shannonbooth
10 changed files with 131 additions and 35 deletions
|
@ -9,10 +9,11 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
FontSourceStyleValue::FontSourceStyleValue(Source source, Optional<FlyString> format)
|
||||
FontSourceStyleValue::FontSourceStyleValue(Source source, Optional<FlyString> format, Vector<FontTech> tech)
|
||||
: StyleValueWithDefaultOperators(Type::FontSource)
|
||||
, m_source(move(source))
|
||||
, m_format(move(format))
|
||||
, m_tech(move(tech))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -36,7 +37,6 @@ String FontSourceStyleValue::to_string(SerializationMode) const
|
|||
},
|
||||
[this](URL const& url) {
|
||||
// <url> [ format(<font-format>)]? [ tech( <font-tech>#)]?
|
||||
// FIXME: tech()
|
||||
StringBuilder builder;
|
||||
builder.append(url.to_string());
|
||||
|
||||
|
@ -46,6 +46,14 @@ String FontSourceStyleValue::to_string(SerializationMode) const
|
|||
builder.append(")"sv);
|
||||
}
|
||||
|
||||
if (!m_tech.is_empty()) {
|
||||
builder.append(" tech("sv);
|
||||
serialize_a_comma_separated_list(builder, m_tech, [](auto& builder, FontTech const tech) {
|
||||
return builder.append(CSS::to_string(tech));
|
||||
});
|
||||
builder.append(")"sv);
|
||||
}
|
||||
|
||||
return builder.to_string_without_validation();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue