mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Respect display:none on <input> elements
This commit is contained in:
parent
4bbe01def1
commit
a4fbc78f25
1 changed files with 6 additions and 1 deletions
|
@ -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());
|
ASSERT(document().frame());
|
||||||
auto& frame = *document().frame();
|
auto& frame = *document().frame();
|
||||||
|
@ -55,6 +55,11 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*)
|
||||||
if (type() == "hidden")
|
if (type() == "hidden")
|
||||||
return nullptr;
|
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;
|
RefPtr<GUI::Widget> widget;
|
||||||
if (type() == "submit") {
|
if (type() == "submit") {
|
||||||
auto& button = page_view.add<GUI::Button>(value());
|
auto& button = page_view.add<GUI::Button>(value());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue