mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Respect display:none on <input> elements
This commit is contained in:
parent
4bbe01def1
commit
a4fbc78f25
Notes:
sideshowbarker
2024-07-19 05:30:30 +09:00
Author: https://github.com/Sobak Commit: https://github.com/SerenityOS/serenity/commit/a4fbc78f255 Pull-request: https://github.com/SerenityOS/serenity/pull/2603
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());
|
||||
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());
|
||||
|
|
Loading…
Reference in a new issue