mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb/CSS: Store @property initial value as a style value
For now, it's the "raw" UnresolvedStyleValue. Later, we'll need to try to parse it into a "real" style value using the property's syntax.
This commit is contained in:
Notes:
github-actions[bot]
2025-04-08 09:00:42 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/a80408fea68 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4265
@@ -65,13 +65,11 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue>> Parser::parse_descriptor_valu
|
||||
return parse_comma_separated_value_list(tokens, [this](auto& tokens) -> RefPtr<CSSStyleValue> {
|
||||
return parse_font_source_value(tokens);
|
||||
});
|
||||
case DescriptorMetadata::ValueType::OptionalDeclarationValue: {
|
||||
// FIXME: This is for an @property's initial value. Figure out what this should actually do once we need it.
|
||||
StringBuilder initial_value_sb;
|
||||
case DescriptorMetadata::ValueType::OptionalDeclarationValue:
|
||||
// `component_values` already has what we want. Just skip through its tokens so code below knows we consumed them.
|
||||
while (tokens.has_next_token())
|
||||
initial_value_sb.append(tokens.consume_a_token().to_string());
|
||||
return StringStyleValue::create(initial_value_sb.to_fly_string_without_validation());
|
||||
}
|
||||
tokens.discard_a_token();
|
||||
return UnresolvedStyleValue::create(move(component_values), false, {});
|
||||
case DescriptorMetadata::ValueType::PositivePercentage:
|
||||
if (auto percentage_value = parse_percentage_value(tokens)) {
|
||||
if (percentage_value->is_percentage()) {
|
||||
|
||||
Reference in New Issue
Block a user