mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibHTML: Rename Document's invalidate_{style,layout}() to update_foo()
This commit is contained in:
parent
61ef17b87a
commit
667b31746a
Notes:
sideshowbarker
2024-07-19 11:41:52 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/667b31746ab
5 changed files with 13 additions and 13 deletions
|
@ -158,17 +158,17 @@ void Document::layout()
|
|||
m_layout_root->layout();
|
||||
}
|
||||
|
||||
void Document::invalidate_style()
|
||||
void Document::update_style()
|
||||
{
|
||||
m_layout_root = nullptr;
|
||||
invalidate_layout();
|
||||
update_layout();
|
||||
}
|
||||
|
||||
void Document::invalidate_layout()
|
||||
void Document::update_layout()
|
||||
{
|
||||
layout();
|
||||
if (on_invalidate_layout)
|
||||
on_invalidate_layout();
|
||||
if (on_layout_updated)
|
||||
on_layout_updated();
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const
|
||||
|
@ -202,6 +202,6 @@ void Document::set_hovered_node(Node* node)
|
|||
return;
|
||||
|
||||
m_hovered_node = node;
|
||||
invalidate_style();
|
||||
update_style();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,9 +67,9 @@ public:
|
|||
|
||||
void layout();
|
||||
|
||||
void invalidate_style();
|
||||
void invalidate_layout();
|
||||
Function<void()> on_invalidate_layout;
|
||||
void update_style();
|
||||
void update_layout();
|
||||
Function<void()> on_layout_updated;
|
||||
|
||||
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());
|
||||
document().invalidate_layout();
|
||||
document().update_layout();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void HTMLLinkElement::inserted_into(Node&)
|
|||
return;
|
||||
}
|
||||
document().add_sheet(*sheet);
|
||||
document().invalidate_style();
|
||||
document().update_style();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ void HtmlView::set_document(Document* document)
|
|||
return;
|
||||
|
||||
if (m_document)
|
||||
m_document->on_invalidate_layout = nullptr;
|
||||
m_document->on_layout_updated = nullptr;
|
||||
|
||||
m_document = document;
|
||||
|
||||
if (m_document) {
|
||||
m_document->on_invalidate_layout = [this] {
|
||||
m_document->on_layout_updated = [this] {
|
||||
layout_and_sync_size();
|
||||
update();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue