mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
LibWeb: Return a dummy value from various SVG getters
Instead of crashing with a TODO() on half of the test cases generated by Domato, let's just return a zeroed-out SVGAnimatedLength or SVGAnimatedNumber from getters that return them. We'll eventually have to implement these correctly, but crashing is not productive since it blocks us from finding other issues.
This commit is contained in:
parent
35f359c51c
commit
9aefc5c927
Notes:
sideshowbarker
2024-07-17 12:02:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9aefc5c927 Pull-request: https://github.com/SerenityOS/serenity/pull/23549
@ -163,22 +163,26 @@ Optional<Gfx::PaintStyle const&> SVGLinearGradientElement::to_gfx_paint_style(SV
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGLinearGradientElement::x1() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGLinearGradientElement::y1() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGLinearGradientElement::x2() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGLinearGradientElement::y2() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -216,32 +216,38 @@ Optional<Gfx::PaintStyle const&> SVGRadialGradientElement::to_gfx_paint_style(SV
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::cx() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::cy() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::fx() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::fy() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::fr() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGRadialGradientElement::r() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,7 +62,8 @@ float SVGStopElement::stop_opacity() const
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedNumber> SVGStopElement::offset() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedNumber::create(realm(), 0, 0);
|
||||
}
|
||||
|
||||
void SVGStopElement::initialize(JS::Realm& realm)
|
||||
|
@ -163,12 +163,14 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGUseElement::y() const
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGUseElement::width() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedLength> SVGUseElement::height() const
|
||||
{
|
||||
TODO();
|
||||
// FIXME: Implement this properly.
|
||||
return SVGAnimatedLength::create(realm(), SVGLength::create(realm(), 0, 0), SVGLength::create(realm(), 0, 0));
|
||||
}
|
||||
|
||||
// https://svgwg.org/svg2-draft/struct.html#TermInstanceRoot
|
||||
|
Loading…
Reference in New Issue
Block a user