Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.1

0.6.1 / src / web / layout / svg_box.lucb

#==============================================================================================
#
#   svg_box - Layout::SVGBox: the box of an SVG element inside an <svg> root
#
#   DESCRIPTION:
#       Port of LibWeb/Layout/SVGBox.cpp (lines 1-18) and SVGBox.h: the constructor and the
#       element the box was made for.
#
#       Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Ported from Libraries/LibWeb/Layout/SVGBox.cpp:13 Web::Layout::SVGBox::SVGBox.
pub func layout_svg_box_construct(this: LayoutSvgBox*, document: DomDocument*, element: SvgElement*, style: CssComputedProperties*):
    layout_box_construct_css_computed_properties(this.layout_box(), document, element.dom_node(), style)

## Ported from Libraries/LibWeb/Layout/SVGBox.h:23 Web::Layout::SVGBox::dom_node.
pub func layout_svg_box_dom_node(this: LayoutSvgBox*) -> SvgElement*:
    return as_svg_element(layout_node_dom_node(this.layout_node()) else trap("VERIFY: an SVG box has a DOM node"))

## Ported from Libraries/LibWeb/Layout/SVGBox.h:24 Web::Layout::SVGBox::dom_node.
pub func layout_svg_box_dom_node_const(this: LayoutSvgBox*) -> SvgElement*:
    return layout_svg_box_dom_node(this)

## Ported from Libraries/LibWeb/Layout/SVGBox.h:27 Web::Layout::SVGBox::is_svg_box (override).
pub func layout_svg_box_is_svg_box_impl(base: LayoutNode*) -> bool:
    _ = base
    return true