mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Don't traverse children if the root of the restyle is display:none.
If we append a child to a display:none element, and we use StyleNewChildren on that parent, we should skip restyling the children.
This commit is contained in:
parent
63988b9103
commit
5fa9a56247
1 changed files with 6 additions and 0 deletions
|
@ -149,6 +149,12 @@ pub trait DomTraversal<E: TElement> : Sync {
|
||||||
-> PreTraverseToken
|
-> PreTraverseToken
|
||||||
{
|
{
|
||||||
if traversal_flags.for_unstyled_children_only() {
|
if traversal_flags.for_unstyled_children_only() {
|
||||||
|
if root.borrow_data().map_or(true, |d| d.has_styles() && d.styles().is_display_none()) {
|
||||||
|
return PreTraverseToken {
|
||||||
|
traverse: false,
|
||||||
|
unstyled_children_only: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
return PreTraverseToken {
|
return PreTraverseToken {
|
||||||
traverse: true,
|
traverse: true,
|
||||||
unstyled_children_only: true,
|
unstyled_children_only: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue