mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
LibHTML: Rename Document's invalidate_{style,layout}() to update_foo()
This commit is contained in:
parent
61ef17b87a
commit
667b31746a
5 changed files with 13 additions and 13 deletions
|
@ -158,17 +158,17 @@ void Document::layout()
|
||||||
m_layout_root->layout();
|
m_layout_root->layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::invalidate_style()
|
void Document::update_style()
|
||||||
{
|
{
|
||||||
m_layout_root = nullptr;
|
m_layout_root = nullptr;
|
||||||
invalidate_layout();
|
update_layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::invalidate_layout()
|
void Document::update_layout()
|
||||||
{
|
{
|
||||||
layout();
|
layout();
|
||||||
if (on_invalidate_layout)
|
if (on_layout_updated)
|
||||||
on_invalidate_layout();
|
on_layout_updated();
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const
|
RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const
|
||||||
|
@ -202,6 +202,6 @@ void Document::set_hovered_node(Node* node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_hovered_node = node;
|
m_hovered_node = node;
|
||||||
invalidate_style();
|
update_style();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,9 @@ public:
|
||||||
|
|
||||||
void layout();
|
void layout();
|
||||||
|
|
||||||
void invalidate_style();
|
void update_style();
|
||||||
void invalidate_layout();
|
void update_layout();
|
||||||
Function<void()> on_invalidate_layout;
|
Function<void()> on_layout_updated;
|
||||||
|
|
||||||
virtual bool is_child_allowed(const Node&) const override;
|
virtual bool is_child_allowed(const Node&) const override;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ void HTMLImageElement::load_image(const String& src)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bitmap = load_png_from_memory(data.data(), data.size());
|
m_bitmap = load_png_from_memory(data.data(), data.size());
|
||||||
document().invalidate_layout();
|
document().update_layout();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void HTMLLinkElement::inserted_into(Node&)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
document().add_sheet(*sheet);
|
document().add_sheet(*sheet);
|
||||||
document().invalidate_style();
|
document().update_style();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,12 @@ void HtmlView::set_document(Document* document)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_document)
|
if (m_document)
|
||||||
m_document->on_invalidate_layout = nullptr;
|
m_document->on_layout_updated = nullptr;
|
||||||
|
|
||||||
m_document = document;
|
m_document = document;
|
||||||
|
|
||||||
if (m_document) {
|
if (m_document) {
|
||||||
m_document->on_invalidate_layout = [this] {
|
m_document->on_layout_updated = [this] {
|
||||||
layout_and_sync_size();
|
layout_and_sync_size();
|
||||||
update();
|
update();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue