mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +00:00
LibWeb: Remove first rule if no argument is given for remove_rule()
While this isn't explicitly mentioned in the specification, there is a WPT test that checks for this behavior.
This commit is contained in:
parent
3ea318ca8b
commit
1d825f17c0
5 changed files with 57 additions and 4 deletions
12
Tests/LibWeb/Text/expected/css/CSSStyleSheet-removeRule.txt
Normal file
12
Tests/LibWeb/Text/expected/css/CSSStyleSheet-removeRule.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
Exception thrown when removeRule() called on empty sheet: IndexSizeError
|
||||
Rule count after adding 3 rules: 3
|
||||
Rule text: .test { padding: 10px; }
|
||||
Rule text: .test { margin: 5px; }
|
||||
Rule text: .test { font-size: 14px; }
|
||||
Rule count after calling removeRule with no arguments: 2
|
||||
Rule text: .test { margin: 5px; }
|
||||
Rule text: .test { font-size: 14px; }
|
||||
Rule count after calling removeRule with explicit index: 1
|
||||
Rule text: .test { margin: 5px; }
|
||||
Exception thrown when given a negative index: IndexSizeError
|
||||
Exception thrown when index out of range: IndexSizeError
|
Loading…
Add table
Add a link
Reference in a new issue