mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
LibWeb: Implement CSSStyleSheet.replace()
This method asynchronously replaces the content of the given stylesheet with the content passed to it. An exception is thrown if this method is used by a stylesheet not created with the `CSSStyleSheet()` constructor.
This commit is contained in:
parent
d209d5a84f
commit
81c67d34eb
5 changed files with 118 additions and 3 deletions
7
Tests/LibWeb/Text/expected/css/CSSStyleSheet-replace.txt
Normal file
7
Tests/LibWeb/Text/expected/css/CSSStyleSheet-replace.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Exception thrown when calling replace() on non-constructed stylesheet: NotAllowedError
|
||||
Number of CSS rules after replace(): 2
|
||||
Rule: .test { font-size: 14px; }
|
||||
Rule: .test2 { font-size: 16px; }
|
||||
cssRules returns the same object before and after replace(): true
|
||||
@import rule should be not appear below:
|
||||
Rule: .test { padding: 100px; }
|
Loading…
Add table
Add a link
Reference in a new issue