LibWeb: Consolidate the attribute change handlers

We currently have 2 virtual methods to inform DOM::Element subclasses
when an attribute has changed, one of which is spec-compliant. This
patch removes the non-compliant variant.
This commit is contained in:
Timothy Flynn 2024-11-14 08:14:16 -05:00 committed by Andreas Kling
parent c2988a7dd5
commit d4f8b598cb
Notes: github-actions[bot] 2024-11-14 18:19:35 +00:00
83 changed files with 224 additions and 228 deletions

View file

@ -42,9 +42,10 @@ void SVGImageElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_resource_request);
}
void SVGImageElement::attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value)
void SVGImageElement::attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_)
{
SVGGraphicsElement::attribute_changed(name, old_value, value);
Base::attribute_changed(name, old_value, value, namespace_);
if (name == SVG::AttributeNames::x) {
auto parsed_value = AttributeParser::parse_coordinate(value.value_or(String {}));
MUST(x()->base_val()->set_value(parsed_value.value_or(0)));