mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 19:35:09 +00:00
LibHTML: Non-element (Text) Nodes should get style from their parent
Text nodes don't have style of their own, so just inherit all the style from the parent element.
This commit is contained in:
parent
8d822ff82b
commit
ed39e0f6f7
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,12 @@ RefPtr<LayoutNode> Node::create_layout_node(const StyleResolver& resolver, const
|
|||
if (is_document())
|
||||
return adopt(*new LayoutDocument(static_cast<const Document&>(*this), {}));
|
||||
|
||||
auto style_properties = resolver.resolve_style(static_cast<const Element&>(*this), parent_properties);
|
||||
StyleProperties style_properties;
|
||||
if (is_element())
|
||||
style_properties = resolver.resolve_style(static_cast<const Element&>(*this), parent_properties);
|
||||
else
|
||||
style_properties = *parent_properties;
|
||||
|
||||
auto display_property = style_properties.property("display");
|
||||
String display = display_property.has_value() ? display_property.release_value()->to_string() : "inline";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue