mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
LibWeb/CSS: Treat counters() function with 1 argument as invalid
Fixes LadybirdBrowser/ladybird#887. (cherry picked from commit 5abe246385dc70e9b69426cd19302d28b7d869d0)
This commit is contained in:
parent
4838d6eebe
commit
39b3746306
3 changed files with 17 additions and 1 deletions
|
@ -0,0 +1,11 @@
|
|||
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 784x17 children: inline
|
||||
frag 0 from TextNode start: 0, length: 19, rect: [8,8 162.109375x17] baseline: 13.296875
|
||||
"PASS (didn't crash)"
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
TextPaintable (TextNode<#text>)
|
|
@ -0,0 +1,5 @@
|
|||
<style>
|
||||
html {
|
||||
content: counters(index);
|
||||
}
|
||||
</style>PASS (didn't crash)
|
|
@ -3089,7 +3089,7 @@ RefPtr<StyleValue> Parser::parse_counter_value(TokenStream<ComponentValue>& toke
|
|||
auto& function = token.function();
|
||||
TokenStream function_tokens { function.values() };
|
||||
auto function_values = parse_a_comma_separated_list_of_component_values(function_tokens);
|
||||
if (function_values.is_empty() || function_values.size() > 3)
|
||||
if (function_values.size() < 2 || function_values.size() > 3)
|
||||
return nullptr;
|
||||
|
||||
TokenStream name_tokens { function_values[0] };
|
||||
|
|
Loading…
Reference in a new issue