dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / layout / inline_node.lucb
#==============================================================================================
#
# inline_node - Layout::InlineNode: an inline-level box that lays out as line fragments
#
# DESCRIPTION:
# Port of LibWeb/Layout/InlineNode.cpp (lines 1-39) and InlineNode.h: the constructor and
# the PaintableWithLines of each line the node spans.
#
# Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from Libraries/LibWeb/Layout/InlineNode.cpp:19 Web::Layout::InlineNode::InlineNode.
pub func layout_inline_node_construct(this: LayoutInlineNode*, document: DomDocument*, element: DomElement*?, style: CssComputedProperties*):
layout_node_with_style_and_box_model_metrics_construct_css_computed_properties(this.layout_node_with_style_and_box_model_metrics(), document, (DomNode*?)element, style)
## Ported from Libraries/LibWeb/Layout/InlineNode.cpp:26 Web::Layout::InlineNode::create_paintable_for_line_with_index.
pub func layout_inline_node_create_paintable_for_line_with_index(this: LayoutInlineNode*, line_index: usize) -> PaintPaintableWithLines*?:
for paintable in ak.intrusive_list_begin(layout_node_paintables(this.layout_node())):
if let paintable_with_lines = as_if_paint_paintable_with_lines(paintable):
if paint_paintable_with_lines_line_index(paintable_with_lines) == line_index:
return paintable_with_lines
return paint_paintable_with_lines_create_layout_inline_node(this, line_index)
## Ported from Libraries/LibWeb/Layout/InlineNode.h:24 Web::Layout::InlineNode::is_inline_node (override).
pub func layout_inline_node_is_inline_node_impl(base: LayoutNode*) -> bool:
_ = base
return true