1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

LibWeb: Support legacy xlink:href attribute for linked gradients

...and rename the related functions to something more descriptive.
This commit is contained in:
MacDue 2023-07-30 13:50:16 +01:00 committed by Andreas Kling
parent cc8c4266f5
commit 439735fd35
6 changed files with 37 additions and 35 deletions

View file

@ -35,10 +35,10 @@ protected:
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
private:
JS::GCPtr<SVGRadialGradientElement const> radial_gradient_xlink_href() const
JS::GCPtr<SVGRadialGradientElement const> linked_radial_gradient() const
{
if (auto href = xlink_href(); href && is<SVGRadialGradientElement>(*href))
return &verify_cast<SVGRadialGradientElement>(*href);
if (auto gradient = linked_gradient(); gradient && is<SVGRadialGradientElement>(*gradient))
return &verify_cast<SVGRadialGradientElement>(*gradient);
return {};
}