mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibWeb: Don't inherit SVG color stops if current gradient has stops
The previous behaviour was incorrect, the template's stops should only be used if the current gradient does not have any stops.
This commit is contained in:
parent
9ecc5413de
commit
eda429111e
1 changed files with 6 additions and 2 deletions
|
@ -44,11 +44,15 @@ protected:
|
|||
template<VoidFunction<SVGStopElement> Callback>
|
||||
void for_each_color_stop(Callback const& callback) const
|
||||
{
|
||||
bool color_stops_found = false;
|
||||
for_each_child_of_type<SVG::SVGStopElement>([&](auto& stop) {
|
||||
color_stops_found = true;
|
||||
callback(stop);
|
||||
});
|
||||
if (auto href = xlink_href())
|
||||
href->for_each_color_stop(callback);
|
||||
if (!color_stops_found) {
|
||||
if (auto href = xlink_href())
|
||||
href->for_each_color_stop(callback);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue