mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09: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
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/tcl3
Commit: 1d825f17c0
Pull-request: https://github.com/SerenityOS/serenity/pull/23327
Reviewed-by: https://github.com/awesomekling
5 changed files with 57 additions and 4 deletions
|
@ -286,10 +286,10 @@ WebIDL::ExceptionOr<WebIDL::Long> CSSStyleSheet::add_rule(Optional<String> selec
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylesheet-removerule
|
||||
WebIDL::ExceptionOr<void> CSSStyleSheet::remove_rule(unsigned index)
|
||||
WebIDL::ExceptionOr<void> CSSStyleSheet::remove_rule(Optional<WebIDL::UnsignedLong> index)
|
||||
{
|
||||
// The removeRule(index) method must run the same steps as deleteRule().
|
||||
return delete_rule(index);
|
||||
return delete_rule(index.value_or(0));
|
||||
}
|
||||
|
||||
void CSSStyleSheet::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue