LibWeb: Return error on modification of a computed CSS style declaration

Previously, calling `setProperty` or `removeProperty` from JS on a
CSSStyleDeclaration returned from `getComputedStyle()` would return
null. We now return a NoModificationAllowedError instead, which aligns
our implementation with the specification.

(cherry picked from commit ea68bdef26260762dec02413cce0d79caef6f4a4)
This commit is contained in:
Tim Ledbetter
2024-08-04 22:12:31 +01:00
committed by Nico Weber
parent ef20e0bd73
commit adebc2a214
5 changed files with 51 additions and 4 deletions

View File

@@ -25,7 +25,9 @@ public:
virtual Optional<StyleProperty> property(PropertyID) const override;
virtual WebIDL::ExceptionOr<void> set_property(PropertyID, StringView css_text, StringView priority) override;
virtual WebIDL::ExceptionOr<void> set_property(StringView property_name, StringView css_text, StringView priority) override;
virtual WebIDL::ExceptionOr<String> remove_property(PropertyID) override;
virtual WebIDL::ExceptionOr<String> remove_property(StringView property_name) override;
virtual String serialized() const override;
virtual WebIDL::ExceptionOr<void> set_css_text(StringView) override;