dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / layout / check_box.lucb
#==============================================================================================
#
# check_box - Layout::CheckBox: the box of <input type=checkbox>
#
# DESCRIPTION:
# Port of LibWeb/Layout/CheckBox.cpp (lines 1-28) and CheckBox.h: a 13x13 replaced box
# painted by CheckBoxPaintable.
#
# Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from Libraries/LibWeb/Layout/CheckBox.cpp:16 Web::Layout::CheckBox::CheckBox.
pub func layout_check_box_construct(this: LayoutCheckBox*, document: DomDocument*, element: HtmlInputElement*, style: CssComputedProperties*):
layout_replaced_box_construct(this.layout_replaced_box(), document, element.dom_element(), style)
## Ported from Libraries/LibWeb/Layout/CheckBox.h:23 Web::Layout::CheckBox::compute_auto_content_box_size (override).
pub func layout_check_box_compute_auto_content_box_size_impl(base: LayoutBox*) -> CssSizeWithAspectRatio:
_ = base
return CssSizeWithAspectRatio(width = gfx.CssPixels.from_int(13), height = gfx.CssPixels.from_int(13), aspect_ratio = none)
## Ported from Libraries/LibWeb/Layout/CheckBox.cpp:23 Web::Layout::CheckBox::create_paintable (override).
pub func layout_check_box_create_paintable_impl(base: LayoutNode*) -> PaintPaintable*?:
return paint_check_box_paintable_create((LayoutCheckBox*)base).paint_paintable()