LibWeb: Respect display:none on <input> elements

This commit is contained in:
Maciej Sobaczewski 2020-06-21 05:58:11 +02:00 committed by Andreas Kling
parent 4bbe01def1
commit a4fbc78f25
Notes: sideshowbarker 2024-07-19 05:30:30 +09:00

View file

@ -46,7 +46,7 @@ HTMLInputElement::~HTMLInputElement()
{
}
RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*) const
RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties* parent_style) const
{
ASSERT(document().frame());
auto& frame = *document().frame();
@ -55,6 +55,11 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*)
if (type() == "hidden")
return nullptr;
auto style = document().style_resolver().resolve_style(*this, parent_style);
auto display = style->string_or_fallback(CSS::PropertyID::Display, "inline");
if (display == "none")
return nullptr;
RefPtr<GUI::Widget> widget;
if (type() == "submit") {
auto& button = page_view.add<GUI::Button>(value());