LibWeb: Use invalidation sets for link-related pseudo classes

- :any-link
- :link
- :local-link
This commit is contained in:
Andreas Kling 2025-02-08 14:23:17 +01:00 committed by Alexander Kalenik
parent 719a2e448f
commit 39abd75d59
Notes: github-actions[bot] 2025-02-08 17:12:20 +00:00
3 changed files with 22 additions and 2 deletions

View file

@ -39,7 +39,14 @@ void SVGAElement::attribute_changed(FlyString const& name, Optional<String> cons
Base::attribute_changed(name, old_value, value, namespace_);
if (name == SVG::AttributeNames::href) {
invalidate_style(DOM::StyleInvalidationReason::HTMLHyperlinkElementHrefChange);
invalidate_style(
DOM::StyleInvalidationReason::HTMLHyperlinkElementHrefChange,
{
{ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::AnyLink },
{ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::Link },
{ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::LocalLink },
},
{});
}
if (name == HTML::AttributeNames::rel) {
if (m_rel_list)