1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07: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

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