mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
layout: Fix servo layout to take into account possibly unstyled child nodes in the display: none case.
This commit is contained in:
parent
544a117911
commit
17772d1618
1 changed files with 8 additions and 0 deletions
|
@ -1374,12 +1374,20 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
// We visit the kids first and reset their HAS_NEWLY_CONSTRUCTED_FLOW flags after checking
|
// We visit the kids first and reset their HAS_NEWLY_CONSTRUCTED_FLOW flags after checking
|
||||||
// them. NOTE: Make sure not to bail out early before resetting all the flags!
|
// them. NOTE: Make sure not to bail out early before resetting all the flags!
|
||||||
let mut need_to_reconstruct = false;
|
let mut need_to_reconstruct = false;
|
||||||
|
|
||||||
|
// If the node has display: none, it's possible that we haven't even
|
||||||
|
// styled the children once, so we need to bailout early here.
|
||||||
|
if node.style(self.style_context()).get_box().clone_display() == display::T::none {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for kid in node.children() {
|
for kid in node.children() {
|
||||||
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
|
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
|
||||||
kid.remove_flags(HAS_NEWLY_CONSTRUCTED_FLOW);
|
kid.remove_flags(HAS_NEWLY_CONSTRUCTED_FLOW);
|
||||||
need_to_reconstruct = true
|
need_to_reconstruct = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if need_to_reconstruct {
|
if need_to_reconstruct {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue