/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include #include #include namespace Web::SVG { GC_DEFINE_ALLOCATOR(SVGForeignObjectElement); SVGForeignObjectElement::SVGForeignObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, move(qualified_name)) { } SVGForeignObjectElement::~SVGForeignObjectElement() = default; void SVGForeignObjectElement::initialize(JS::Realm& realm) { WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGForeignObjectElement); Base::initialize(realm); // FIXME: These never actually get updated! m_x = fake_animated_length_fixme(); m_y = fake_animated_length_fixme(); m_width = fake_animated_length_fixme(); m_height = fake_animated_length_fixme(); } void SVGForeignObjectElement::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_x); visitor.visit(m_y); visitor.visit(m_width); visitor.visit(m_height); } GC::Ptr SVGForeignObjectElement::create_layout_node(GC::Ref style) { return heap().allocate(document(), *this, move(style)); } GC::Ref SVGForeignObjectElement::x() { return *m_x; } GC::Ref SVGForeignObjectElement::y() { return *m_y; } GC::Ref SVGForeignObjectElement::width() { return *m_width; } GC::Ref SVGForeignObjectElement::height() { return *m_height; } }