mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Rename invalidate_layout() => invalidate_layout_tree()
I believe this is slightly less confusing, since what the function does is trigger a full layout tree *rebuild*, not just a relayout.
This commit is contained in:
parent
e205723b95
commit
aa8f17aea4
Notes:
github-actions[bot]
2024-09-19 08:13:42 +00:00
Author: https://github.com/awesomekling
Commit: aa8f17aea4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1437
9 changed files with 14 additions and 14 deletions
|
@ -1049,7 +1049,7 @@ void Document::set_needs_layout()
|
|||
schedule_layout_update();
|
||||
}
|
||||
|
||||
void Document::invalidate_layout()
|
||||
void Document::invalidate_layout_tree()
|
||||
{
|
||||
tear_down_layout_tree();
|
||||
schedule_layout_update();
|
||||
|
@ -1282,7 +1282,7 @@ void Document::update_style()
|
|||
invalidate_display_list();
|
||||
}
|
||||
if (invalidation.rebuild_layout_tree) {
|
||||
invalidate_layout();
|
||||
invalidate_layout_tree();
|
||||
} else {
|
||||
if (invalidation.relayout)
|
||||
set_needs_layout();
|
||||
|
@ -2739,7 +2739,7 @@ void Document::evaluate_media_rules()
|
|||
if (any_media_queries_changed_match_state) {
|
||||
style_computer().invalidate_rule_cache();
|
||||
invalidate_style(StyleInvalidationReason::MediaQueryChangedMatchState);
|
||||
invalidate_layout();
|
||||
invalidate_layout_tree();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ public:
|
|||
|
||||
void set_needs_layout();
|
||||
|
||||
void invalidate_layout();
|
||||
void invalidate_layout_tree();
|
||||
void invalidate_stacking_context_tree();
|
||||
|
||||
virtual bool is_child_allowed(Node const&) const override;
|
||||
|
|
|
@ -826,7 +826,7 @@ WebIDL::ExceptionOr<void> Element::set_inner_html(StringView value)
|
|||
|
||||
if (context->is_connected()) {
|
||||
// NOTE: Since the DOM has changed, we have to rebuild the layout tree.
|
||||
context->document().invalidate_layout();
|
||||
context->document().invalidate_layout_tree();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void Node::set_text_content(Optional<String> const& maybe_content)
|
|||
|
||||
if (is_connected()) {
|
||||
document().invalidate_style(StyleInvalidationReason::NodeSetTextContent);
|
||||
document().invalidate_layout();
|
||||
document().invalidate_layout_tree();
|
||||
}
|
||||
|
||||
document().bump_dom_tree_version();
|
||||
|
@ -656,7 +656,7 @@ void Node::insert_before(JS::NonnullGCPtr<Node> node, JS::GCPtr<Node> child, boo
|
|||
if (is_connected()) {
|
||||
// FIXME: This will need to become smarter when we implement the :has() selector.
|
||||
invalidate_style(StyleInvalidationReason::NodeInsertBefore);
|
||||
document().invalidate_layout();
|
||||
document().invalidate_layout_tree();
|
||||
}
|
||||
|
||||
document().bump_dom_tree_version();
|
||||
|
@ -855,7 +855,7 @@ void Node::remove(bool suppress_observers)
|
|||
// Since the tree structure has changed, we need to invalidate both style and layout.
|
||||
// In the future, we should find a way to only invalidate the parts that actually need it.
|
||||
document().invalidate_style(StyleInvalidationReason::NodeRemove);
|
||||
document().invalidate_layout();
|
||||
document().invalidate_layout_tree();
|
||||
}
|
||||
|
||||
document().bump_dom_tree_version();
|
||||
|
|
|
@ -88,7 +88,7 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_inner_html(StringView value)
|
|||
|
||||
if (this->is_connected()) {
|
||||
// NOTE: Since the DOM has changed, we have to rebuild the layout tree.
|
||||
this->document().invalidate_layout();
|
||||
this->document().invalidate_layout_tree();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue