LibWeb: Add support for HTML input type=radio

This commit is contained in:
Timothy Flynn 2021-04-03 09:07:45 -04:00 committed by Andreas Kling
parent 274e94224d
commit b50de19cd3
Notes: sideshowbarker 2024-07-18 20:52:24 +09:00
5 changed files with 187 additions and 0 deletions

View file

@ -36,6 +36,7 @@
#include <LibWeb/Layout/BlockBox.h>
#include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/CheckBox.h>
#include <LibWeb/Layout/RadioButton.h>
#include <LibWeb/Page/Frame.h>
namespace Web::HTML {
@ -77,6 +78,9 @@ RefPtr<Layout::Node> HTMLInputElement::create_layout_node()
if (type() == "checkbox")
return adopt(*new Layout::CheckBox(document(), *this, move(style)));
if (type() == "radio")
return adopt(*new Layout::RadioButton(document(), *this, move(style)));
create_shadow_tree_if_needed();
auto layout_node = adopt(*new Layout::BlockBox(document(), this, move(style)));
layout_node->set_inline(true);