dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / svg / svg_foreign_object_element.lucb
#==============================================================================================
#
# svg_foreign_object_element - SVG::SVGForeignObjectElement: <foreignObject>
#
# DESCRIPTION:
# Port of LibWeb/SVG/SVGForeignObjectElement.cpp (lines 1-78) with the inline members of
# SVGForeignObjectElement.h: an SVGGraphicsElement laid out by an SVGForeignObjectBox,
# whose x/y/width/height SVGAnimatedLengths are placeholders (FIXME in the donor).
#
#==============================================================================================
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:22 Web::SVG::SVGForeignObjectElement::SVGForeignObjectElement.
pub func svg_foreign_object_element_construct(this: SvgForeignObjectElement*, document: DomDocument*, qualified_name: DomQualifiedName):
svg_graphics_element_construct(this.svg_graphics_element(), document, qualified_name)
# The vptrs of the mixin bases move to SVGForeignObjectElement's tables.
let element = this.svg_element()
element.element.slottable_mixin.vtable = &svg_foreign_object_element_slottable_mixin_vtable
element.element.aria_mixin.vtable = &svg_foreign_object_element_aria_mixin_vtable
element.element.animatable.vtable = &svg_foreign_object_element_animatable_vtable
element.global_event_handlers.vtable = &svg_foreign_object_element_global_event_handlers_vtable
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:29 Web::SVG::SVGForeignObjectElement::initialize (override).
pub func svg_foreign_object_element_initialize_impl(base: JsCell*, realm: Realm*):
let this = (SvgForeignObjectElement*)base
web_set_prototype_for_interface(base, realm, BindInterfaceName.svg_foreign_object_element)
svg_graphics_element_initialize_impl(base, realm)
# FIXME: These never actually get updated!
this.m_x = svg_element_fake_animated_length_fixme(this.svg_element())
this.m_y = svg_element_fake_animated_length_fixme(this.svg_element())
this.m_width = svg_element_fake_animated_length_fixme(this.svg_element())
this.m_height = svg_element_fake_animated_length_fixme(this.svg_element())
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:41 Web::SVG::SVGForeignObjectElement::visit_edges (override).
pub func svg_foreign_object_element_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
let this = (SvgForeignObjectElement*)base
svg_element_visit_edges_impl(base, visitor)
gc.cell_visitor_visit_t(visitor, this.m_x)
gc.cell_visitor_visit_t(visitor, this.m_y)
gc.cell_visitor_visit_t(visitor, this.m_width)
gc.cell_visitor_visit_t(visitor, this.m_height)
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:50 Web::SVG::SVGForeignObjectElement::create_layout_node (override).
pub func svg_foreign_object_element_create_layout_node_impl(base: DomElement*, style: CssComputedProperties*) -> LayoutNode*?:
let this = (SvgForeignObjectElement*)base
# heap().allocate<Layout::SVGForeignObjectBox>(...): a layout node's initialize is JS::Cell's, which does nothing.
return realm_create_layout_svg_foreign_object_box(dom_element_realm(base), dom_node_document(base.dom_node()), this, style).layout_node()
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:55 Web::SVG::SVGForeignObjectElement::x.
pub func svg_foreign_object_element_x(this: SvgForeignObjectElement*) -> SvgAnimatedLength*:
return this.m_x else trap("VERIFY: m_x")
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:60 Web::SVG::SVGForeignObjectElement::y.
pub func svg_foreign_object_element_y(this: SvgForeignObjectElement*) -> SvgAnimatedLength*:
return this.m_y else trap("VERIFY: m_y")
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:65 Web::SVG::SVGForeignObjectElement::width.
pub func svg_foreign_object_element_width(this: SvgForeignObjectElement*) -> SvgAnimatedLength*:
return this.m_width else trap("VERIFY: m_width")
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp:70 Web::SVG::SVGForeignObjectElement::height.
pub func svg_foreign_object_element_height(this: SvgForeignObjectElement*) -> SvgAnimatedLength*:
return this.m_height else trap("VERIFY: m_height")
## Ported from Libraries/LibWeb/SVG/SVGForeignObjectElement.h:31 Web::SVG::SVGForeignObjectElement::is_svg_foreign_object_element (override).
pub func svg_foreign_object_element_is_svg_foreign_object_element_impl(base: DomNode*) -> bool:
return true