mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/CSS: Handle whitespace properly in column properties
This commit is contained in:
parent
ee13de8426
commit
941ad24abd
Notes:
github-actions[bot]
2025-11-03 11:28:18 +00:00
Author: https://github.com/AtkinsSJ
Commit: 941ad24abd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6646
Reviewed-by: https://github.com/tcl3
2 changed files with 10 additions and 10 deletions
|
|
@ -1957,28 +1957,33 @@ RefPtr<StyleValue const> Parser::parse_columns_value(TokenStream<ComponentValue>
|
|||
|
||||
Vector<PropertyID> remaining_longhands { PropertyID::ColumnCount, PropertyID::ColumnWidth };
|
||||
int found_autos = 0;
|
||||
int tokens_read = 0;
|
||||
int values_read = 0;
|
||||
|
||||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
while (tokens.has_next_token()) {
|
||||
if (tokens.next_token().is_delim('/')) {
|
||||
if (tokens_read == 0)
|
||||
if (values_read == 0)
|
||||
return nullptr;
|
||||
tokens.discard_a_token();
|
||||
tokens.discard_a_token(); // /
|
||||
tokens.discard_whitespace();
|
||||
|
||||
auto value = parse_css_value_for_property(PropertyID::ColumnHeight, tokens);
|
||||
if (!value)
|
||||
return nullptr;
|
||||
column_height = value.release_nonnull();
|
||||
|
||||
tokens.discard_whitespace();
|
||||
if (tokens.has_next_token())
|
||||
return nullptr;
|
||||
break;
|
||||
}
|
||||
if (tokens_read == 2)
|
||||
if (values_read == 2)
|
||||
return nullptr;
|
||||
tokens_read++;
|
||||
values_read++;
|
||||
|
||||
auto property_and_value = parse_css_value_for_properties(remaining_longhands, tokens);
|
||||
tokens.discard_whitespace();
|
||||
if (!property_and_value.has_value())
|
||||
return nullptr;
|
||||
auto& value = property_and_value->style_value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue