mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Don't assume grid-area parts are Tokens
This stops `grid-area: {}` from crashing.
This commit is contained in:
parent
ab9d39bf4a
commit
1a17b8a304
3 changed files with 16 additions and 4 deletions
|
@ -0,0 +1,12 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (8,8) content-size 784x0 children: not-inline
|
||||||
|
BlockContainer <div> at (8,8) content-size 784x0 children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (8,16) content-size 784x0 children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
|
||||||
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0] overflow: [8,16 784x0]
|
||||||
|
PaintableWithLines (BlockContainer<DIV>) [8,8 784x0]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [8,16 784x0]
|
|
@ -0,0 +1 @@
|
||||||
|
<div style="grid-area: {}"></div>
|
|
@ -5520,18 +5520,17 @@ RefPtr<StyleValue> Parser::parse_grid_track_size_list_shorthand_value(PropertyID
|
||||||
RefPtr<StyleValue> Parser::parse_grid_area_shorthand_value(Vector<ComponentValue> const& component_values)
|
RefPtr<StyleValue> Parser::parse_grid_area_shorthand_value(Vector<ComponentValue> const& component_values)
|
||||||
{
|
{
|
||||||
auto tokens = TokenStream { component_values };
|
auto tokens = TokenStream { component_values };
|
||||||
Token current_token;
|
|
||||||
|
|
||||||
auto parse_placement_tokens = [&](Vector<ComponentValue>& placement_tokens, bool check_for_delimiter = true) -> void {
|
auto parse_placement_tokens = [&](Vector<ComponentValue>& placement_tokens, bool check_for_delimiter = true) -> void {
|
||||||
current_token = tokens.next_token().token();
|
auto current_token = tokens.next_token();
|
||||||
while (true) {
|
while (true) {
|
||||||
if (check_for_delimiter && current_token.is(Token::Type::Delim) && current_token.delim() == "/"sv)
|
if (check_for_delimiter && current_token.is_delim('/'))
|
||||||
break;
|
break;
|
||||||
placement_tokens.append(current_token);
|
placement_tokens.append(current_token);
|
||||||
tokens.skip_whitespace();
|
tokens.skip_whitespace();
|
||||||
if (!tokens.has_next_token())
|
if (!tokens.has_next_token())
|
||||||
break;
|
break;
|
||||||
current_token = tokens.next_token().token();
|
current_token = tokens.next_token();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue