mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:27:34 +00:00
LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs. Work towards #20405
This commit is contained in:
parent
fde26c53f0
commit
18c54d8d40
804 changed files with 1330 additions and 2171 deletions
|
@ -25,12 +25,10 @@ SVGAnimatedLength::SVGAnimatedLength(JS::Realm& realm, JS::NonnullGCPtr<SVGLengt
|
|||
|
||||
SVGAnimatedLength::~SVGAnimatedLength() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGAnimatedLength::initialize(JS::Realm& realm)
|
||||
void SVGAnimatedLength::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGAnimatedLengthPrototype>(realm, "SVGAnimatedLength"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGAnimatedLength::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
private:
|
||||
SVGAnimatedLength(JS::Realm&, JS::NonnullGCPtr<SVGLength> base_val, JS::NonnullGCPtr<SVGLength> anim_val);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<SVGLength> m_base_val;
|
||||
|
|
|
@ -23,12 +23,10 @@ SVGAnimatedNumber::SVGAnimatedNumber(JS::Realm& realm, float base_val, float ani
|
|||
|
||||
SVGAnimatedNumber::~SVGAnimatedNumber() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGAnimatedNumber::initialize(JS::Realm& realm)
|
||||
void SVGAnimatedNumber::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGAnimatedNumberPrototype>(realm, "SVGAnimatedNumber"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
private:
|
||||
SVGAnimatedNumber(JS::Realm&, float base_val, float anim_val);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
float m_base_val;
|
||||
float m_anim_val;
|
||||
|
|
|
@ -16,12 +16,10 @@ SVGCircleElement::SVGCircleElement(DOM::Document& document, DOM::QualifiedName q
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGCircleElement::initialize(JS::Realm& realm)
|
||||
void SVGCircleElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGCircleElementPrototype>(realm, "SVGCircleElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGCircleElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
private:
|
||||
SVGCircleElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
||||
|
|
|
@ -18,12 +18,10 @@ SVGClipPathElement::~SVGClipPathElement()
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGClipPathElement::initialize(JS::Realm& realm)
|
||||
void SVGClipPathElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGClipPathElementPrototype>(realm, "SVGClipPathElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGClipPathElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties>)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
private:
|
||||
SVGClipPathElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -18,12 +18,10 @@ SVGDefsElement::~SVGDefsElement()
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGDefsElement::initialize(JS::Realm& realm)
|
||||
void SVGDefsElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGDefsElementPrototype>(realm, "SVGDefsElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGDefsElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties>)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
private:
|
||||
SVGDefsElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -20,16 +20,12 @@ SVGElement::SVGElement(DOM::Document& document, DOM::QualifiedName qualified_nam
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGElement::initialize(JS::Realm& realm)
|
||||
void SVGElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGElementPrototype>(realm, "SVGElement"));
|
||||
|
||||
m_dataset = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() {
|
||||
return HTML::DOMStringMap::create(*this);
|
||||
}));
|
||||
|
||||
return {};
|
||||
m_dataset = MUST(HTML::DOMStringMap::create(*this));
|
||||
}
|
||||
|
||||
void SVGElement::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
protected:
|
||||
SVGElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
void update_use_elements_that_reference_this();
|
||||
|
|
|
@ -16,12 +16,10 @@ SVGEllipseElement::SVGEllipseElement(DOM::Document& document, DOM::QualifiedName
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGEllipseElement::initialize(JS::Realm& realm)
|
||||
void SVGEllipseElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGEllipseElementPrototype>(realm, "SVGEllipseElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGEllipseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
private:
|
||||
SVGEllipseElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
||||
|
|
|
@ -22,28 +22,16 @@ SVGForeignObjectElement::SVGForeignObjectElement(DOM::Document& document, DOM::Q
|
|||
|
||||
SVGForeignObjectElement::~SVGForeignObjectElement() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGForeignObjectElement::initialize(JS::Realm& realm)
|
||||
void SVGForeignObjectElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
auto& vm = realm.vm();
|
||||
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGForeignObjectElementPrototype>(realm, "SVGForeignObjectElement"));
|
||||
|
||||
// FIXME: These never actually get updated!
|
||||
m_x = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
|
||||
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
|
||||
}));
|
||||
m_y = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
|
||||
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
|
||||
}));
|
||||
m_width = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
|
||||
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
|
||||
}));
|
||||
m_height = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
|
||||
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
|
||||
}));
|
||||
|
||||
return {};
|
||||
m_x = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0))));
|
||||
m_y = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0))));
|
||||
m_width = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0))));
|
||||
m_height = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0))));
|
||||
}
|
||||
|
||||
void SVGForeignObjectElement::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
private:
|
||||
SVGForeignObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
|
|
|
@ -15,12 +15,10 @@ SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedNa
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGGeometryElement::initialize(JS::Realm& realm)
|
||||
void SVGGeometryElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGeometryElementPrototype>(realm, "SVGGeometryElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
protected:
|
||||
SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -99,11 +99,10 @@ JS::GCPtr<SVGGradientElement const> SVGGradientElement::linked_gradient() const
|
|||
return {};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGGradientElement::initialize(JS::Realm& realm)
|
||||
void SVGGradientElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGradientElementPrototype>(realm, "SVGGradientElement"));
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
protected:
|
||||
SVGGradientElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
JS::GCPtr<SVGGradientElement const> linked_gradient() const;
|
||||
|
||||
|
|
|
@ -25,12 +25,10 @@ SVGGraphicsElement::SVGGraphicsElement(DOM::Document& document, DOM::QualifiedNa
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGGraphicsElement::initialize(JS::Realm& realm)
|
||||
void SVGGraphicsElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGraphicsElementPrototype>(realm, "SVGGraphicsElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGGraphicsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
protected:
|
||||
SVGGraphicsElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::PaintStyle const&> svg_paint_computed_value_to_gfx_paint_style(SVGPaintContext const& paint_context, Optional<CSS::SVGPaint> const& paint_value) const;
|
||||
|
||||
|
|
|
@ -21,12 +21,10 @@ SVGLength::SVGLength(JS::Realm& realm, u8 unit_type, float value)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGLength::initialize(JS::Realm& realm)
|
||||
void SVGLength::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLengthPrototype>(realm, "SVGLength"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
SVGLength::~SVGLength() = default;
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
private:
|
||||
SVGLength(JS::Realm&, u8 unit_type, float value);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
u8 m_unit_type { 0 };
|
||||
float m_value { 0 };
|
||||
|
|
|
@ -16,12 +16,10 @@ SVGLineElement::SVGLineElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGLineElement::initialize(JS::Realm& realm)
|
||||
void SVGLineElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLineElementPrototype>(realm, "SVGLineElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGLineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
private:
|
||||
SVGLineElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
||||
|
|
|
@ -18,12 +18,10 @@ SVGLinearGradientElement::SVGLinearGradientElement(DOM::Document& document, DOM:
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGLinearGradientElement::initialize(JS::Realm& realm)
|
||||
void SVGLinearGradientElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLinearGradientElementPrototype>(realm, "SVGLinearGradientElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGLinearGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
protected:
|
||||
SVGLinearGradientElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
JS::GCPtr<SVGLinearGradientElement const> linked_linear_gradient() const
|
||||
|
|
|
@ -89,12 +89,10 @@ SVGPathElement::SVGPathElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGPathElement::initialize(JS::Realm& realm)
|
||||
void SVGPathElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPathElementPrototype>(realm, "SVGPathElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGPathElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
private:
|
||||
SVGPathElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Vector<PathInstruction> m_instructions;
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
|
|
@ -16,12 +16,10 @@ SVGPolygonElement::SVGPolygonElement(DOM::Document& document, DOM::QualifiedName
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGPolygonElement::initialize(JS::Realm& realm)
|
||||
void SVGPolygonElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolygonElementPrototype>(realm, "SVGPolygonElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGPolygonElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
SVGPolygonElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
||||
|
|
|
@ -16,12 +16,10 @@ SVGPolylineElement::SVGPolylineElement(DOM::Document& document, DOM::QualifiedNa
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGPolylineElement::initialize(JS::Realm& realm)
|
||||
void SVGPolylineElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolylineElementPrototype>(realm, "SVGPolylineElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGPolylineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
SVGPolylineElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<Gfx::Path> m_path;
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@ SVGRadialGradientElement::SVGRadialGradientElement(DOM::Document& document, DOM:
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGRadialGradientElement::initialize(JS::Realm& realm)
|
||||
void SVGRadialGradientElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRadialGradientElementPrototype>(realm, "SVGRadialGradientElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGRadialGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
protected:
|
||||
SVGRadialGradientElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
JS::GCPtr<SVGRadialGradientElement const> linked_radial_gradient() const
|
||||
|
|
|
@ -18,12 +18,10 @@ SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGRectElement::initialize(JS::Realm& realm)
|
||||
void SVGRectElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRectElementPrototype>(realm, "SVGRectElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGRectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
private:
|
||||
SVGRectElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Gfx::FloatSize calculate_used_corner_radius_values() const;
|
||||
|
||||
|
|
|
@ -23,12 +23,10 @@ SVGSVGElement::SVGSVGElement(DOM::Document& document, DOM::QualifiedName qualifi
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGSVGElement::initialize(JS::Realm& realm)
|
||||
void SVGSVGElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGSVGElementPrototype>(realm, "SVGSVGElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGSVGElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
private:
|
||||
SVGSVGElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual bool is_svg_svg_element() const override { return true; }
|
||||
|
||||
|
|
|
@ -63,12 +63,10 @@ JS::NonnullGCPtr<SVGAnimatedNumber> SVGStopElement::offset() const
|
|||
TODO();
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGStopElement::initialize(JS::Realm& realm)
|
||||
void SVGStopElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGStopElementPrototype>(realm, "SVGStopElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
private:
|
||||
SVGStopElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Optional<NumberPercentage> m_offset;
|
||||
Optional<Gfx::Color> m_color;
|
||||
|
|
|
@ -15,12 +15,10 @@ SVGStyleElement::SVGStyleElement(DOM::Document& document, DOM::QualifiedName qua
|
|||
|
||||
SVGStyleElement::~SVGStyleElement() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGStyleElement::initialize(JS::Realm& realm)
|
||||
void SVGStyleElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGStyleElementPrototype>(realm, "SVGStyleElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGStyleElement::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
private:
|
||||
SVGStyleElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// The semantics and processing of a ‘style’ and its attributes must be the same as is defined for the HTML ‘style’ element.
|
||||
|
|
|
@ -21,12 +21,10 @@ SVGSymbolElement::SVGSymbolElement(DOM::Document& document, DOM::QualifiedName q
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGSymbolElement::initialize(JS::Realm& realm)
|
||||
void SVGSymbolElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGSymbolElementPrototype>(realm, "SVGSymbolElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://svgwg.org/svg2-draft/struct.html#SymbolNotes
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
SVGSymbolElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
bool is_direct_child_of_use_shadow_tree() const;
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@ SVGTSpanElement::SVGTSpanElement(DOM::Document& document, DOM::QualifiedName qua
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGTSpanElement::initialize(JS::Realm& realm)
|
||||
void SVGTSpanElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTSpanElementPrototype>(realm, "SVGTSpanElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGTSpanElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
protected:
|
||||
SVGTSpanElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -23,12 +23,10 @@ SVGTextContentElement::SVGTextContentElement(DOM::Document& document, DOM::Quali
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGTextContentElement::initialize(JS::Realm& realm)
|
||||
void SVGTextContentElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextContentElementPrototype>(realm, "SVGTextContentElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<TextAnchor> SVGTextContentElement::text_anchor() const
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
protected:
|
||||
SVGTextContentElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,12 +14,10 @@ SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGTextElement::initialize(JS::Realm& realm)
|
||||
void SVGTextElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextElementPrototype>(realm, "SVGTextElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGTextElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
protected:
|
||||
SVGTextElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -22,12 +22,10 @@ SVGTextPositioningElement::SVGTextPositioningElement(DOM::Document& document, DO
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGTextPositioningElement::initialize(JS::Realm& realm)
|
||||
void SVGTextPositioningElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextPositioningElementPrototype>(realm, "SVGTextPositioningElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGTextPositioningElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
protected:
|
||||
SVGTextPositioningElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
float m_x { 0 };
|
||||
|
|
|
@ -15,12 +15,10 @@ SVGTitleElement::SVGTitleElement(DOM::Document& document, DOM::QualifiedName qua
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGTitleElement::initialize(JS::Realm& realm)
|
||||
void SVGTitleElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTitleElementPrototype>(realm, "SVGTitleElement"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGTitleElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties>)
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGTitleElement final : public SVGElement {
|
|||
private:
|
||||
SVGTitleElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
||||
virtual void children_changed() override;
|
||||
|
|
|
@ -21,23 +21,21 @@ SVGUseElement::SVGUseElement(DOM::Document& document, DOM::QualifiedName qualifi
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> SVGUseElement::initialize(JS::Realm& realm)
|
||||
void SVGUseElement::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGUseElementPrototype>(realm, "SVGUseElement"));
|
||||
|
||||
// The shadow tree is open (inspectable by script), but read-only.
|
||||
auto shadow_root = TRY(heap().allocate<DOM::ShadowRoot>(realm, document(), *this, Bindings::ShadowRootMode::Open));
|
||||
auto shadow_root = MUST(heap().allocate<DOM::ShadowRoot>(realm, document(), *this, Bindings::ShadowRootMode::Open));
|
||||
|
||||
// The user agent must create a use-element shadow tree whose host is the ‘use’ element itself
|
||||
set_shadow_root(shadow_root);
|
||||
|
||||
m_document_observer = TRY(realm.heap().allocate<DOM::DocumentObserver>(realm, realm, document()));
|
||||
m_document_observer = MUST(realm.heap().allocate<DOM::DocumentObserver>(realm, realm, document()));
|
||||
m_document_observer->document_completely_loaded = [this]() {
|
||||
clone_element_tree_as_our_shadow_tree(referenced_element());
|
||||
};
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void SVGUseElement::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
private:
|
||||
SVGUseElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual bool is_svg_use_element() const override { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue