diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-15 19:15:11 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-15 23:24:41 +0100 |
commit | bdf0254b1679ed2d041fccdf6b3d7fb1313e0405 (patch) | |
tree | cb09bc77f393a224fb8c9c91bbafeff5bf5869dc | |
parent | e91b2c57c197604943bf2c59aea2c5a843243c29 (diff) | |
download | serenity-bdf0254b1679ed2d041fccdf6b3d7fb1313e0405.zip |
LibWeb: Add Element::did_remove_attribute() virtual
This allows subclasses to react to DOM attributes being removed.
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Element.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Element.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 3725aa9818..9f42142c2d 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -161,6 +161,8 @@ void Element::remove_attribute(const FlyString& name) { m_attributes->remove_attribute(name); + did_remove_attribute(name); + // FIXME: Invalidate less. document().invalidate_style(); } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 4242c6d5eb..03a6fecff1 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -83,6 +83,7 @@ public: virtual void apply_presentational_hints(CSS::StyleProperties&) const { } virtual void parse_attribute(const FlyString& name, const String& value); + virtual void did_remove_attribute(FlyString const&) { } void recompute_style(); |