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