mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-23 03:22:54 +00: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:
parent
9292b769ef
commit
a80408fea6
Notes:
github-actions[bot]
2025-04-08 09:00:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: a80408fea6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4265
4 changed files with 24 additions and 19 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue