mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/CSS: Invalidate layout tree for changes to counter definitions
A change to a counter "definition" propagates to all subsequent instances of this counter: descendents, siblings and their descendents (the "next tree slice"). Rebuilding the layout tree (from the parent node) covers at least the "next_tree_slice".
This commit is contained in:
parent
8145572180
commit
99c6eb0c35
Notes:
github-actions[bot]
2025-06-03 01:52:56 +00:00
Author: https://github.com/manuel-za
Commit: 99c6eb0c35
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4890
Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
* Copyright (c) 2025, Manuel Zahariev <manuel@duck.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -40,6 +41,11 @@ RequiredInvalidationAfterStyleChange compute_property_invalidation(CSS::Property
|
|||
return RequiredInvalidationAfterStyleChange::full();
|
||||
}
|
||||
|
||||
if (AK::first_is_one_of(property_id, CSS::PropertyID::CounterReset, CSS::PropertyID::CounterSet, CSS::PropertyID::CounterIncrement)) {
|
||||
invalidation.rebuild_layout_tree = property_value_changed;
|
||||
return invalidation;
|
||||
}
|
||||
|
||||
// OPTIMIZATION: Special handling for CSS `visibility`:
|
||||
if (property_id == CSS::PropertyID::Visibility) {
|
||||
// We don't need to relayout if the visibility changes from visible to hidden or vice versa. Only collapse requires relayout.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue