2020-09-11 19:17:39 +03:00
|
|
|
/*
|
2022-03-10 16:02:25 +03:00
|
|
|
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
|
2020-09-11 19:17:39 +03:00
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-09-11 19:17:39 +03:00
|
|
|
*/
|
|
|
|
|
2022-04-09 10:28:38 +03:00
|
|
|
#include <LibGfx/Font/Font.h>
|
2021-11-18 17:01:28 +03:00
|
|
|
#include <LibWeb/HTML/BrowsingContext.h>
|
2022-02-15 21:16:57 +03:00
|
|
|
#include <LibWeb/HTML/HTMLInputElement.h>
|
2020-11-22 17:53:01 +03:00
|
|
|
#include <LibWeb/Layout/CheckBox.h>
|
2021-04-04 18:51:36 +03:00
|
|
|
#include <LibWeb/Layout/Label.h>
|
2022-03-10 16:02:25 +03:00
|
|
|
#include <LibWeb/Painting/CheckBoxPaintable.h>
|
2020-09-11 19:17:39 +03:00
|
|
|
|
2020-11-22 17:53:01 +03:00
|
|
|
namespace Web::Layout {
|
2020-09-11 19:17:39 +03:00
|
|
|
|
2020-11-22 17:53:01 +03:00
|
|
|
CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
2022-03-15 02:05:55 +03:00
|
|
|
: FormAssociatedLabelableNode(document, element, move(style))
|
2020-09-11 19:17:39 +03:00
|
|
|
{
|
|
|
|
set_intrinsic_width(13);
|
|
|
|
set_intrinsic_height(13);
|
2020-11-22 15:38:18 +03:00
|
|
|
}
|
|
|
|
|
2022-03-14 22:21:51 +03:00
|
|
|
CheckBox::~CheckBox() = default;
|
2020-09-11 19:17:39 +03:00
|
|
|
|
2022-03-11 00:38:08 +03:00
|
|
|
RefPtr<Painting::Paintable> CheckBox::create_paintable() const
|
2022-03-10 16:02:25 +03:00
|
|
|
{
|
|
|
|
return Painting::CheckBoxPaintable::create(*this);
|
|
|
|
}
|
|
|
|
|
2020-09-11 19:17:39 +03:00
|
|
|
}
|