mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibHTML: Simplify Node::create_layout_node()
There's no need to pass the StyleResolver to this function. Nodes that need it can just get it from the document.
This commit is contained in:
@@ -71,12 +71,10 @@ bool Element::has_class(const StringView& class_name) const
|
||||
return false;
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> Element::create_layout_node(const StyleResolver& resolver, const StyleProperties* parent_style) const
|
||||
RefPtr<LayoutNode> Element::create_layout_node(const StyleProperties* parent_style) const
|
||||
{
|
||||
auto style = resolver.resolve_style(*this, parent_style);
|
||||
|
||||
auto display_property = style->property(CSS::PropertyID::Display);
|
||||
String display = display_property.has_value() ? display_property.release_value()->to_string() : "inline";
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user