Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / svg / svgfe_flood_element.lucb

#==============================================================================================
#
#   svgfe_flood_element - SVG::SVGFEFloodElement
#
#   DESCRIPTION:
#       Port of LibWeb/SVG/SVGFEFloodElement.cpp (lines 1-54) with the inline members of SVGFEFloodElement.h.
#       (https://drafts.fxtf.org/filter-effects/#feFloodElement): the flood color and opacity;
#       its layout node is an SVGBox.
#
#==============================================================================================

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:18 Web::SVG::SVGFEFloodElement::SVGFEFloodElement.
pub func svg_svgfe_flood_element_construct(this: SvgSvgfeFloodElement*, document: DomDocument*, qualified_name: DomQualifiedName):
    svg_element_construct(this.svg_element(), document, qualified_name)
    # The vptrs of the mixin bases move to SVGFEFloodElement's tables.
    let element = this.svg_element()
    element.element.slottable_mixin.vtable = &svg_svgfe_flood_element_slottable_mixin_vtable
    element.element.aria_mixin.vtable = &svg_svgfe_flood_element_aria_mixin_vtable
    element.element.animatable.vtable = &svg_svgfe_flood_element_animatable_vtable
    element.global_event_handlers.vtable = &svg_svgfe_flood_element_global_event_handlers_vtable

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:23 Web::SVG::SVGFEFloodElement::initialize (override).
pub func svg_svgfe_flood_element_initialize_impl(base: JsCell*, realm: Realm*):
    web_set_prototype_for_interface(base, realm, BindInterfaceName.svgfe_flood_element)
    svg_element_initialize_impl(base, realm)

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:29 Web::SVG::SVGFEFloodElement::visit_edges (override).
pub func svg_svgfe_flood_element_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
    let this = (SvgSvgfeFloodElement*)base
    svg_element_visit_edges_impl(base, visitor)
    svg_filter_primitive_standard_attributes_visit_edges(&this.svg_filter_primitive_standard_attributes, visitor)

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:35 Web::SVG::SVGFEFloodElement::create_layout_node (override).
pub func svg_svgfe_flood_element_create_layout_node_impl(base: DomElement*, style: CssComputedProperties*) -> LayoutNode*?:
    let this = (SvgSvgfeFloodElement*)base
    # heap().allocate<Layout::SVGBox>(...): a layout node's initialize is JS::Cell's, which does nothing.
    return realm_create_layout_svg_box(dom_element_realm(base), dom_node_document(base.dom_node()), this.svg_element(), style).layout_node()

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:41 Web::SVG::SVGFEFloodElement::flood_color.
# https://www.w3.org/TR/filter-effects-1/#FloodColorProperty
pub func svg_svgfe_flood_element_flood_color(this: SvgSvgfeFloodElement*) -> gfx.Color:
    return svg_element_computed_color(this.svg_element(), css_data.PropertyId.flood_color)

## Ported from Libraries/LibWeb/SVG/SVGFEFloodElement.cpp:48 Web::SVG::SVGFEFloodElement::flood_opacity.
# https://www.w3.org/TR/filter-effects-1/#FloodOpacityProperty
pub func svg_svgfe_flood_element_flood_opacity(this: SvgSvgfeFloodElement*) -> f32:
    let computed_properties = dom_element_computed_properties(this.dom_element()) else trap("VERIFY: computed_properties()")
    return css_computed_properties_flood_opacity(computed_properties)