mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibHTML: Rename "style_properties" to "style" everywhere
This commit is contained in:
parent
de49714f36
commit
15f3e64862
12 changed files with 53 additions and 53 deletions
|
@ -68,7 +68,7 @@ public:
|
|||
Function<void()> on_invalidate_layout;
|
||||
|
||||
private:
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const override;
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const override;
|
||||
|
||||
OwnPtr<StyleResolver> m_style_resolver;
|
||||
NonnullRefPtrVector<StyleSheet> m_sheets;
|
||||
|
|
|
@ -69,19 +69,19 @@ bool Element::has_class(const StringView& class_name) const
|
|||
return false;
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> Element::create_layout_node(const StyleResolver& resolver, const StyleProperties* parent_properties) const
|
||||
RefPtr<LayoutNode> Element::create_layout_node(const StyleResolver& resolver, const StyleProperties* parent_style) const
|
||||
{
|
||||
auto style_properties = resolver.resolve_style(*this, parent_properties);
|
||||
auto style = resolver.resolve_style(*this, parent_style);
|
||||
|
||||
auto display_property = style_properties->property("display");
|
||||
auto display_property = style->property("display");
|
||||
String display = display_property.has_value() ? display_property.release_value()->to_string() : "inline";
|
||||
|
||||
if (display == "none")
|
||||
return nullptr;
|
||||
if (display == "block" || display == "list-item")
|
||||
return adopt(*new LayoutBlock(this, move(style_properties)));
|
||||
return adopt(*new LayoutBlock(this, move(style)));
|
||||
if (display == "inline")
|
||||
return adopt(*new LayoutInline(*this, move(style_properties)));
|
||||
return adopt(*new LayoutInline(*this, move(style)));
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
virtual void parse_attribute(const String& name, const String& value);
|
||||
|
||||
private:
|
||||
RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const override;
|
||||
RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const override;
|
||||
|
||||
Attribute* find_attribute(const String& name);
|
||||
const Attribute* find_attribute(const String& name) const;
|
||||
|
|
|
@ -19,9 +19,9 @@ Node::~Node()
|
|||
{
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> Node::create_layout_tree(const StyleResolver& resolver, const StyleProperties* parent_properties) const
|
||||
RefPtr<LayoutNode> Node::create_layout_tree(const StyleResolver& resolver, const StyleProperties* parent_style) const
|
||||
{
|
||||
auto layout_node = create_layout_node(resolver, parent_properties);
|
||||
auto layout_node = create_layout_node(resolver, parent_style);
|
||||
if (!layout_node)
|
||||
return nullptr;
|
||||
|
||||
|
@ -45,7 +45,7 @@ RefPtr<LayoutNode> Node::create_layout_tree(const StyleResolver& resolver, const
|
|||
|
||||
for (auto layout_child : layout_children)
|
||||
if (have_block_children && have_inline_children && !layout_child->is_block()) {
|
||||
if (layout_child->is_text() && static_cast<const LayoutText&>(*layout_child).text_for_style(*parent_properties) == " ")
|
||||
if (layout_child->is_text() && static_cast<const LayoutText&>(*layout_child).text_for_style(*parent_style) == " ")
|
||||
continue;
|
||||
layout_node->inline_wrapper().append_child(*layout_child);
|
||||
} else {
|
||||
|
|
|
@ -32,8 +32,8 @@ public:
|
|||
bool is_document() const { return type() == NodeType::DOCUMENT_NODE; }
|
||||
bool is_parent_node() const { return is_element() || is_document(); }
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const = 0;
|
||||
RefPtr<LayoutNode> create_layout_tree(const StyleResolver&, const StyleProperties* parent_properties) const;
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const = 0;
|
||||
RefPtr<LayoutNode> create_layout_tree(const StyleResolver&, const StyleProperties* parent_style) const;
|
||||
|
||||
virtual String tag_name() const = 0;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
virtual String text_content() const override { return m_data; }
|
||||
|
||||
private:
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const override;
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const override;
|
||||
|
||||
String m_data;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue