mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-20 09:21:55 +00:00
LibWeb: Note what's causing a style invalidation to happen
You can now build with STYLE_INVALIDATION_DEBUG and get a debug stream of reasons why style invalidations are happening and where. I've rewritten this code many times, so instead of throwing it away once again, I figured we should at least have it behind a flag.
This commit is contained in:
parent
1f5c49f40d
commit
ddbfac38b0
Notes:
github-actions[bot]
2024-09-08 07:46:37 +00:00
Author: https://github.com/awesomekling
Commit: ddbfac38b0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1276
20 changed files with 92 additions and 38 deletions
|
@ -1385,9 +1385,9 @@ void Document::set_hovered_node(Node* node)
|
|||
|
||||
auto* common_ancestor = find_common_ancestor(old_hovered_node, m_hovered_node);
|
||||
if (common_ancestor)
|
||||
common_ancestor->invalidate_style();
|
||||
common_ancestor->invalidate_style(StyleInvalidationReason::Hover);
|
||||
else
|
||||
invalidate_style();
|
||||
invalidate_style(StyleInvalidationReason::Hover);
|
||||
|
||||
// https://w3c.github.io/uievents/#mouseout
|
||||
if (old_hovered_node && old_hovered_node != m_hovered_node) {
|
||||
|
@ -2716,7 +2716,7 @@ void Document::evaluate_media_rules()
|
|||
|
||||
if (any_media_queries_changed_match_state) {
|
||||
style_computer().invalidate_rule_cache();
|
||||
invalidate_style();
|
||||
invalidate_style(StyleInvalidationReason::MediaQueryChangedMatchState);
|
||||
invalidate_layout();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue