/src/serenity/Userland/Libraries/LibWeb/Layout/CheckBox.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibWeb/DOM/Document.h> |
8 | | #include <LibWeb/HTML/HTMLInputElement.h> |
9 | | #include <LibWeb/Layout/CheckBox.h> |
10 | | #include <LibWeb/Painting/CheckBoxPaintable.h> |
11 | | |
12 | | namespace Web::Layout { |
13 | | |
14 | | JS_DEFINE_ALLOCATOR(CheckBox); |
15 | | |
16 | | CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style) |
17 | 0 | : FormAssociatedLabelableNode(document, element, move(style)) |
18 | 0 | { |
19 | 0 | set_natural_width(13); |
20 | 0 | set_natural_height(13); |
21 | 0 | } |
22 | | |
23 | 0 | CheckBox::~CheckBox() = default; |
24 | | |
25 | | JS::GCPtr<Painting::Paintable> CheckBox::create_paintable() const |
26 | 0 | { |
27 | 0 | return Painting::CheckBoxPaintable::create(*this); |
28 | 0 | } |
29 | | |
30 | | } |