From a552bda8d96d3c8a16f02dca5d1b37483dd5a634 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 9 Jul 2024 20:18:41 +0100 Subject: [PATCH] LibWeb: Pass the old attribute value to `Element::attribute_changed()` --- Userland/Libraries/LibWeb/DOM/Element.cpp | 4 +- Userland/Libraries/LibWeb/DOM/Element.h | 2 +- .../LibWeb/HTML/FormAssociatedElement.h | 54 +++++++++---------- .../LibWeb/HTML/HTMLAnchorElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLAnchorElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLAreaElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLAreaElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLBaseElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLBaseElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLBodyElement.h | 2 +- .../LibWeb/HTML/HTMLDetailsElement.cpp | 4 +- .../LibWeb/HTML/HTMLDetailsElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLElement.cpp | 4 +- Userland/Libraries/LibWeb/HTML/HTMLElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLFormElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLFormElement.h | 2 +- .../LibWeb/HTML/HTMLFrameSetElement.cpp | 4 +- .../LibWeb/HTML/HTMLFrameSetElement.h | 2 +- .../LibWeb/HTML/HTMLIFrameElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLIFrameElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLLinkElement.h | 2 +- .../LibWeb/HTML/HTMLMediaElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLMediaElement.h | 2 +- .../LibWeb/HTML/HTMLOptionElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLOptionElement.h | 2 +- .../LibWeb/HTML/HTMLScriptElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLScriptElement.h | 2 +- .../LibWeb/HTML/HTMLTableElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLTableElement.h | 2 +- .../LibWeb/HTML/HTMLTrackElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLTrackElement.h | 2 +- .../LibWeb/HTML/HTMLVideoElement.cpp | 4 +- .../Libraries/LibWeb/HTML/HTMLVideoElement.h | 2 +- .../LibWeb/SVG/SVGClipPathElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGClipPathElement.h | 2 +- Userland/Libraries/LibWeb/SVG/SVGElement.cpp | 4 +- Userland/Libraries/LibWeb/SVG/SVGElement.h | 2 +- .../LibWeb/SVG/SVGEllipseElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGEllipseElement.h | 2 +- .../LibWeb/SVG/SVGGradientElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGGradientElement.h | 2 +- .../LibWeb/SVG/SVGGraphicsElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGGraphicsElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGLineElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGLineElement.h | 2 +- .../LibWeb/SVG/SVGLinearGradientElement.cpp | 4 +- .../LibWeb/SVG/SVGLinearGradientElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGMaskElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGMaskElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGPathElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGPathElement.h | 2 +- .../LibWeb/SVG/SVGPolygonElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGPolygonElement.h | 2 +- .../LibWeb/SVG/SVGPolylineElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGPolylineElement.h | 2 +- .../LibWeb/SVG/SVGRadialGradientElement.cpp | 4 +- .../LibWeb/SVG/SVGRadialGradientElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGRectElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGRectElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGSVGElement.cpp | 4 +- Userland/Libraries/LibWeb/SVG/SVGSVGElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGStopElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGStopElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 4 +- .../Libraries/LibWeb/SVG/SVGSymbolElement.h | 2 +- .../LibWeb/SVG/SVGTextPositioningElement.cpp | 4 +- .../LibWeb/SVG/SVGTextPositioningElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGUseElement.cpp | 4 +- Userland/Libraries/LibWeb/SVG/SVGUseElement.h | 2 +- 71 files changed, 132 insertions(+), 132 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 7e84527ffd8..04a71889be2 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -445,13 +445,13 @@ void Element::run_attribute_change_steps(FlyString const& local_name, Optional const& value) +void Element::attribute_changed(FlyString const& name, Optional const&, Optional const& value) { auto value_or_empty = value.value_or(String {}); diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 0092d73184d..1d92498b83e 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -161,7 +161,7 @@ public: virtual void attribute_change_steps(FlyString const& local_name, Optional const& old_value, Optional const& value, Optional const& namespace_); void run_attribute_change_steps(FlyString const& local_name, Optional const& old_value, Optional const& value, Optional const& namespace_); - virtual void attribute_changed(FlyString const& name, Optional const& value); + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value); CSS::RequiredInvalidationAfterStyleChange recompute_style(); diff --git a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h index 47a33e765df..61dbb83cb61 100644 --- a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h +++ b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h @@ -19,33 +19,33 @@ namespace Web::HTML { // HTMLElement::inserted() -> Use form_associated_element_was_inserted() // HTMLElement::removed_from() -> Use form_associated_element_was_removed() // -#define FORM_ASSOCIATED_ELEMENT(ElementBaseClass, ElementClass) \ -private: \ - virtual HTMLElement& form_associated_element_to_html_element() override \ - { \ - static_assert(IsBaseOf); \ - return *this; \ - } \ - \ - virtual void inserted() override \ - { \ - ElementBaseClass::inserted(); \ - form_node_was_inserted(); \ - form_associated_element_was_inserted(); \ - } \ - \ - virtual void removed_from(DOM::Node* node) override \ - { \ - ElementBaseClass::removed_from(node); \ - form_node_was_removed(); \ - form_associated_element_was_removed(node); \ - } \ - \ - virtual void attribute_changed(FlyString const& name, Optional const& value) override \ - { \ - ElementBaseClass::attribute_changed(name, value); \ - form_node_attribute_changed(name, value); \ - form_associated_element_attribute_changed(name, value); \ +#define FORM_ASSOCIATED_ELEMENT(ElementBaseClass, ElementClass) \ +private: \ + virtual HTMLElement& form_associated_element_to_html_element() override \ + { \ + static_assert(IsBaseOf); \ + return *this; \ + } \ + \ + virtual void inserted() override \ + { \ + ElementBaseClass::inserted(); \ + form_node_was_inserted(); \ + form_associated_element_was_inserted(); \ + } \ + \ + virtual void removed_from(DOM::Node* node) override \ + { \ + ElementBaseClass::removed_from(node); \ + form_node_was_removed(); \ + form_associated_element_was_removed(node); \ + } \ + \ + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override \ + { \ + ElementBaseClass::attribute_changed(name, old_value, value); \ + form_node_attribute_changed(name, value); \ + form_associated_element_attribute_changed(name, value); \ } class FormAssociatedElement { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index e872d4c563e..fcf17b51dce 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -40,9 +40,9 @@ void HTMLAnchorElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_rel_list); } -void HTMLAnchorElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLAnchorElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::href) { set_the_url(); } else if (name == HTML::AttributeNames::rel) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h index c2b6e9934a8..74c3884c6dc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h @@ -45,7 +45,7 @@ private: virtual void activation_behavior(Web::DOM::Event const&) override; // ^DOM::Element - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index 96ceaf5a5b7..028dba9ffa5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -33,9 +33,9 @@ void HTMLAreaElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_rel_list); } -void HTMLAreaElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLAreaElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::href) { set_the_url(); } else if (name == HTML::AttributeNames::rel) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h index 9c25c096c94..62e5170729a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h @@ -29,7 +29,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; // ^DOM::Element - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index 6f1737e10e8..0484d270f68 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -46,9 +46,9 @@ void HTMLBaseElement::removed_from(Node* parent) document().update_base_element({}); } -void HTMLBaseElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLBaseElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); // The frozen base URL must be immediately set for an element whenever any of the following situations occur: // - The base element is the first base element in tree order with an href content attribute in its Document, and its href content attribute is changed. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h index e2a5c44315e..3dec1001418 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -24,7 +24,7 @@ public: virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; private: HTMLBaseElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index e558aaf6fc1..e359449d1ad 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -59,9 +59,9 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co }); } -void HTMLBodyElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLBodyElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); if (name.equals_ignoring_ascii_case("link"sv)) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-3 auto color = parse_legacy_color_value(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h index ba172b25053..946f0f1c6de 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h @@ -21,7 +21,7 @@ class HTMLBodyElement final public: virtual ~HTMLBodyElement() override; - virtual void attribute_changed(FlyString const&, Optional const&) override; + virtual void attribute_changed(FlyString const&, Optional const& old_value, Optional const&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-body diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 76b99bf9e5f..0d53390f273 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -53,9 +53,9 @@ void HTMLDetailsElement::removed_from(DOM::Node*) set_shadow_root(nullptr); } -void HTMLDetailsElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLDetailsElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); // https://html.spec.whatwg.org/multipage/interactive-elements.html#details-notification-task-steps if (name == HTML::AttributeNames::open) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h index 2c4fb68b392..b98feb8cef1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h @@ -34,7 +34,7 @@ private: virtual void inserted() override; virtual void removed_from(DOM::Node*) override; virtual void children_changed() override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; void queue_a_details_toggle_event_task(String old_state, String new_state); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index aa6cd12a513..04a281d6118 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -358,9 +358,9 @@ bool HTMLElement::cannot_navigate() const return !is(this) && !is_connected(); } -void HTMLElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Element::attribute_changed(name, value); + Element::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::contenteditable) { if (!value.has_value()) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h index 09b6989d35d..230c7d85ede 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h @@ -85,7 +85,7 @@ protected: virtual void initialize(JS::Realm&) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 997606e9937..ece05e94f2d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -622,9 +622,9 @@ WebIDL::ExceptionOr HTMLFormElement::set_action(String const& value) return set_attribute(AttributeNames::action, value); } -void HTMLFormElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLFormElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::rel) { if (m_rel_list) m_rel_list->associated_attribute_changed(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h index 7ab8b051000..e4a13b046ba 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h @@ -111,7 +111,7 @@ private: virtual Vector supported_property_names() const override; virtual bool is_supported_property_index(u32) const override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; ErrorOr pick_an_encoding() const; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index 23887fd015d..f3224131d44 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -26,9 +26,9 @@ void HTMLFrameSetElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFrameSetElement); } -void HTMLFrameSetElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLFrameSetElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); #undef __ENUMERATE #define __ENUMERATE(attribute_name, event_name) \ diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index 17d32c8ae7b..43b5d73ff92 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -25,7 +25,7 @@ private: HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; - virtual void attribute_changed(FlyString const&, Optional const&) override; + virtual void attribute_changed(FlyString const&, Optional const& old_value, Optional const&) override; // ^HTML::GlobalEventHandlers virtual JS::GCPtr global_event_handlers_to_event_target(FlyString const& event_name) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 1828a60b0bd..91237447166 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -37,9 +37,9 @@ JS::GCPtr HTMLIFrameElement::create_layout_node(NonnullRefPtr(document(), *this, move(style)); } -void HTMLIFrameElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLIFrameElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:process-the-iframe-attributes-2 // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:process-the-iframe-attributes-3 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 237e87e7fa1..e20ece0f72f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -40,7 +40,7 @@ private: // ^DOM::Element virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual i32 default_tab_index_value() const override; // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:dimension-attributes diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index 6f7de9d79c7..01bd90e93e7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -128,9 +128,9 @@ bool HTMLLinkElement::has_loaded_icon() const return m_relationship & Relationship::Icon && resource() && resource()->is_loaded() && resource()->has_encoded_data(); } -void HTMLLinkElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLLinkElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); // 4.6.7 Link types - https://html.spec.whatwg.org/multipage/links.html#linkTypes if (name == HTML::AttributeNames::rel) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h index 276ad28d641..4f572d12265 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h @@ -47,7 +47,7 @@ private: HTMLLinkElement(DOM::Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; - virtual void attribute_changed(FlyString const&, Optional const&) override; + virtual void attribute_changed(FlyString const&, Optional const& old_value, Optional const&) override; // ^ResourceClient virtual void resource_did_fail() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index a5c7a2a556f..6e7700e20de 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -98,9 +98,9 @@ void HTMLMediaElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_pending_play_promises); } -void HTMLMediaElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLMediaElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::src) { load_element().release_value_but_fixme_should_propagate_errors(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h index 353d57beff0..d193a223b7d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h @@ -139,7 +139,7 @@ protected: virtual void finalize() override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual void removed_from(DOM::Node*) override; virtual void children_changed() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index bb1169b533d..b7e738c00e8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -34,9 +34,9 @@ void HTMLOptionElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOptionElement); } -void HTMLOptionElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLOptionElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::selected) { if (!value.has_value()) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h index 32adc64acc3..c24791ce633 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h @@ -43,7 +43,7 @@ private: virtual void initialize(JS::Realm&) override; - void attribute_changed(FlyString const& name, Optional const& value) override; + void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; void ask_for_a_reset(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index cfd6df6125e..4d27860f2c2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -50,9 +50,9 @@ void HTMLScriptElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_preparation_time_document); } -void HTMLScriptElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLScriptElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::crossorigin) { m_crossorigin = cors_setting_attribute_from_keyword(value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h index 537c94d0677..44c20f975eb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -70,7 +70,7 @@ private: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; // https://html.spec.whatwg.org/multipage/scripting.html#prepare-the-script-element void prepare_script(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 81be995ff9b..8fe9468e318 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -102,9 +102,9 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c }); } -void HTMLTableElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLTableElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::cellpadding) { if (value.has_value()) m_padding = max(0, parse_integer(value.value()).value_or(0)); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h index 04e935228b3..b60be03ab96 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -59,7 +59,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; JS::GCPtr mutable m_rows; JS::GCPtr mutable m_t_bodies; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp index 64af6ffe381..f2ed55bfae7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp @@ -35,9 +35,9 @@ void HTMLTrackElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_track); } -void HTMLTrackElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLTrackElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - HTMLElement::attribute_changed(name, value); + HTMLElement::attribute_changed(name, old_value, value); // https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly, as per the definitions above. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h index d70606e6c0a..ae501e0b68d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h @@ -28,7 +28,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; // ^DOM::Element - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; JS::GCPtr m_track; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index bd1b463f5b2..fb9bcd753bb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -53,9 +53,9 @@ void HTMLVideoElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_fetch_controller); } -void HTMLVideoElement::attribute_changed(FlyString const& name, Optional const& value) +void HTMLVideoElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); if (name == HTML::AttributeNames::poster) { determine_element_poster_frame(value).release_value_but_fixme_should_propagate_errors(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h index 720a78e0a04..f6d1ac9d42b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h @@ -49,7 +49,7 @@ private: virtual void finalize() override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; // https://html.spec.whatwg.org/multipage/media.html#the-video-element:dimension-attributes virtual bool supports_dimension_attributes() const override { return true; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index 07e84b30d3e..d1720d07e84 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -28,9 +28,9 @@ void SVGClipPathElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGClipPathElement); } -void SVGClipPathElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGClipPathElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGElement::attribute_changed(name, value); + SVGElement::attribute_changed(name, old_value, value); if (name == AttributeNames::clipPathUnits) m_clip_path_units = AttributeParser::parse_units(value.value_or(String {})); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h index e8782128940..41b5b51aad1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h @@ -33,7 +33,7 @@ public: return PreserveAspectRatio { PreserveAspectRatio::Align::None, {} }; } - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; ClipPathUnits clip_path_units() const { diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index de2d513ba3d..158c2db357c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -41,9 +41,9 @@ JS::NonnullGCPtr SVGElement::dataset() return *m_dataset; } -void SVGElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); update_use_elements_that_reference_this(); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGElement.h index 8ae313fe2cb..3771a49ccc0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.h @@ -17,7 +17,7 @@ class SVGElement : public DOM::Element { public: virtual bool requires_svg_container() const override { return true; } - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual void children_changed() override; virtual void inserted() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index 34d49a24f70..3ea426c3df5 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -25,9 +25,9 @@ void SVGEllipseElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGEllipseElement); } -void SVGEllipseElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGEllipseElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::cx) { m_center_x = AttributeParser::parse_coordinate(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h index a2ad882604d..60adb01cdb0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h @@ -18,7 +18,7 @@ class SVGEllipseElement final : public SVGGeometryElement { public: virtual ~SVGEllipseElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp index 612cd9c7c9d..ebdfc1a458d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp @@ -19,9 +19,9 @@ SVGGradientElement::SVGGradientElement(DOM::Document& document, DOM::QualifiedNa { } -void SVGGradientElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGGradientElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGElement::attribute_changed(name, value); + SVGElement::attribute_changed(name, old_value, value); if (name == AttributeNames::gradientUnits) { m_gradient_units = AttributeParser::parse_units(value.value_or(String {})); } else if (name == AttributeNames::spreadMethod) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h index f2beddcf8ce..99f37fb81e6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h @@ -41,7 +41,7 @@ class SVGGradientElement : public SVGElement { public: virtual ~SVGGradientElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const = 0; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 110d085dcc8..59a4fa3b234 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -37,9 +37,9 @@ void SVGGraphicsElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGraphicsElement); } -void SVGGraphicsElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGGraphicsElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGElement::attribute_changed(name, value); + SVGElement::attribute_changed(name, old_value, value); if (name == "transform"sv) { auto transform_list = AttributeParser::parse_transform(value.value_or(String {})); if (transform_list.has_value()) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h index 95fb35eb511..bbd75eb8acc 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h @@ -32,7 +32,7 @@ class SVGGraphicsElement : public SVGElement { public: virtual void apply_presentational_hints(CSS::StyleProperties&) const override; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; Optional fill_color() const; Optional stroke_color() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 125d88a647f..55e76d80ea2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -25,9 +25,9 @@ void SVGLineElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGLineElement); } -void SVGLineElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGLineElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::x1) { m_x1 = AttributeParser::parse_coordinate(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h index 62087b3bb63..4deef429ccc 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h @@ -18,7 +18,7 @@ class SVGLineElement final : public SVGGeometryElement { public: virtual ~SVGLineElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp index 4ee3deae913..34be130cb2f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp @@ -28,9 +28,9 @@ void SVGLinearGradientElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGLinearGradientElement); } -void SVGLinearGradientElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGLinearGradientElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGradientElement::attribute_changed(name, value); + SVGGradientElement::attribute_changed(name, old_value, value); // FIXME: Should allow for ` | ` for x1, x2, y1, y2 if (name == SVG::AttributeNames::x1) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h index fb31ff54751..eabf7cee6d3 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h @@ -19,7 +19,7 @@ class SVGLinearGradientElement : public SVGGradientElement { public: virtual ~SVGLinearGradientElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp index 0104c0726ae..19eecef696a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp @@ -33,9 +33,9 @@ JS::GCPtr SVGMaskElement::create_layout_node(NonnullRefPtr const& value) +void SVGMaskElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGraphicsElement::attribute_changed(name, value); + SVGGraphicsElement::attribute_changed(name, old_value, value); if (name == AttributeNames::maskUnits) { m_mask_units = AttributeParser::parse_units(value.value_or(String {})); } else if (name == AttributeNames::maskContentUnits) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h index 40a11eaa355..e2a61f36d07 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h @@ -36,7 +36,7 @@ public: return PreserveAspectRatio { PreserveAspectRatio::Align::None, {} }; } - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index a65ba8a38d8..44ef4746bf7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -96,9 +96,9 @@ void SVGPathElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPathElement); } -void SVGPathElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGPathElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == "d") m_instructions = AttributeParser::parse_path_data(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h index 286b236903b..88e0d053b62 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h @@ -20,7 +20,7 @@ class SVGPathElement final : public SVGGeometryElement { public: virtual ~SVGPathElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index b667ecd4311..2c266d78ac8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -25,9 +25,9 @@ void SVGPolygonElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPolygonElement); } -void SVGPolygonElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGPolygonElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::points) m_points = AttributeParser::parse_points(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h index 5433f84c1ac..33844082469 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h @@ -17,7 +17,7 @@ class SVGPolygonElement final : public SVGGeometryElement { public: virtual ~SVGPolygonElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index 4c600d48bee..3fab6d433c1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -25,9 +25,9 @@ void SVGPolylineElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPolylineElement); } -void SVGPolylineElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGPolylineElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::points) m_points = AttributeParser::parse_points(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h index 7c91dc16254..8bdd610a6d1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h @@ -17,7 +17,7 @@ class SVGPolylineElement final : public SVGGeometryElement { public: virtual ~SVGPolylineElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp index 28b2209c134..a365bb86531 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp @@ -25,9 +25,9 @@ void SVGRadialGradientElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGRadialGradientElement); } -void SVGRadialGradientElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGRadialGradientElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGradientElement::attribute_changed(name, value); + SVGGradientElement::attribute_changed(name, old_value, value); // FIXME: These are or in the spec, but all examples seem to allow percentages // and unitless values. diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h index c0d43a5b4e1..8d48cbe42ef 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h @@ -19,7 +19,7 @@ class SVGRadialGradientElement : public SVGGradientElement { public: virtual ~SVGRadialGradientElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index f488e6d154e..e4a06f952f8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -27,9 +27,9 @@ void SVGRectElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGRectElement); } -void SVGRectElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGRectElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGeometryElement::attribute_changed(name, value); + SVGGeometryElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::x) { m_x = AttributeParser::parse_coordinate(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h index f6bc9ddfe2b..9f67ff46b6b 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h @@ -18,7 +18,7 @@ class SVGRectElement final : public SVGGeometryElement { public: virtual ~SVGRectElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 3ec2d37ec7d..3515ee0f416 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -84,9 +84,9 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons } } -void SVGSVGElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGSVGElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGraphicsElement::attribute_changed(name, value); + SVGGraphicsElement::attribute_changed(name, old_value, value); if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox)) { if (!value.has_value()) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h index 9324f043889..c3b53e9b336 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -88,7 +88,7 @@ private: virtual bool is_svg_svg_element() const override { return true; } - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; void update_fallback_view_box_for_svg_as_image(); diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp index 7f73ea1f42d..845ea1e6cc6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp @@ -21,9 +21,9 @@ SVGStopElement::SVGStopElement(DOM::Document& document, DOM::QualifiedName quali { } -void SVGStopElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGStopElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGElement::attribute_changed(name, value); + SVGElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::offset) { m_offset = AttributeParser::parse_number_percentage(value.value_or(String {})); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h index be36634e243..11fd7510a97 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h @@ -20,7 +20,7 @@ class SVGStopElement final : public SVGElement { public: virtual ~SVGStopElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; JS::NonnullGCPtr offset() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index 7805361df1d..d6aa65039a8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -42,9 +42,9 @@ void SVGSymbolElement::apply_presentational_hints(CSS::StyleProperties& style) c } } -void SVGSymbolElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGSymbolElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox)) m_view_box = try_parse_view_box(value.value_or(String {})); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h index 74b2de1e5a9..30b29802d96 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h @@ -37,7 +37,7 @@ private: bool is_direct_child_of_use_shadow_tree() const; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; Optional m_view_box; }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp index f8e0fb2d894..eecc53929fb 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp @@ -29,9 +29,9 @@ void SVGTextPositioningElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextPositioningElement); } -void SVGTextPositioningElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGTextPositioningElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - SVGGraphicsElement::attribute_changed(name, value); + SVGGraphicsElement::attribute_changed(name, old_value, value); if (name == SVG::AttributeNames::x) { m_x = AttributeParser::parse_coordinate(value.value_or(String {})).value_or(m_x); diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h index f6b3788ed2d..61e86d00224 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h @@ -16,7 +16,7 @@ class SVGTextPositioningElement : public SVGTextContentElement { WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement); public: - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; Gfx::FloatPoint get_offset() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index 4ae7ff95cd0..7b3fffebb92 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -50,9 +50,9 @@ void SVGUseElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_document_observer); } -void SVGUseElement::attribute_changed(FlyString const& name, Optional const& value) +void SVGUseElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) { - Base::attribute_changed(name, value); + Base::attribute_changed(name, old_value, value); // https://svgwg.org/svg2-draft/struct.html#UseLayout if (name == SVG::AttributeNames::x) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h index 60371f07462..11df4d32772 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h @@ -24,7 +24,7 @@ class SVGUseElement final public: virtual ~SVGUseElement() override = default; - virtual void attribute_changed(FlyString const& name, Optional const& value) override; + virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value) override; virtual void inserted() override;