mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 15:28:55 +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:
parent
f7cd5662ef
commit
f4f5ede10a
Notes:
sideshowbarker
2024-07-19 11:41:16 +09:00
Author: https://github.com/awesomekling
Commit: f4f5ede10a
13 changed files with 20 additions and 30 deletions
|
@ -60,13 +60,10 @@ int HTMLImageElement::preferred_height() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleResolver& resolver, const StyleProperties* parent_style) const
|
||||
RefPtr<LayoutNode> HTMLImageElement::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;
|
||||
return adopt(*new LayoutImage(*this, move(style)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue