2021-04-03 10:07:45 -03:00
|
|
|
/*
|
2022-01-31 15:07:22 -03:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2021-04-03 10:07:45 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-03 10:07:45 -03:00
|
|
|
*/
|
|
|
|
|
|
2021-04-03 21:33:10 -03:00
|
|
|
#include <LibWeb/DOM/Document.h>
|
2024-09-23 12:13:14 -03:00
|
|
|
#include <LibWeb/HTML/HTMLInputElement.h>
|
|
|
|
|
#include <LibWeb/Layout/RadioButton.h>
|
2022-03-10 10:02:25 -03:00
|
|
|
#include <LibWeb/Painting/RadioButtonPaintable.h>
|
2021-04-03 10:07:45 -03:00
|
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DEFINE_ALLOCATOR(RadioButton);
|
2024-04-06 14:16:04 -03:00
|
|
|
|
2024-10-26 12:42:27 -03:00
|
|
|
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, CSS::StyleProperties style)
|
2022-03-14 20:05:55 -03:00
|
|
|
: FormAssociatedLabelableNode(document, element, move(style))
|
2021-04-03 10:07:45 -03:00
|
|
|
{
|
2023-06-08 11:56:28 -03:00
|
|
|
set_natural_width(12);
|
|
|
|
|
set_natural_height(12);
|
|
|
|
|
set_natural_aspect_ratio(1);
|
2021-04-03 10:07:45 -03:00
|
|
|
}
|
|
|
|
|
|
2022-03-14 16:21:51 -03:00
|
|
|
RadioButton::~RadioButton() = default;
|
2021-04-03 10:07:45 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ptr<Painting::Paintable> RadioButton::create_paintable() const
|
2022-03-10 10:02:25 -03:00
|
|
|
{
|
|
|
|
|
return Painting::RadioButtonPaintable::create(*this);
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-03 10:07:45 -03:00
|
|
|
}
|