mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03: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
@ -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…
Reference in New Issue
Block a user