servo: Merge #12757 - stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally (from emilio:stylo); r=bholley,pcwalton
<!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @bholley Source-Repo: https://github.com/servo/servo Source-Revision: 1b2450339c40dbcb65e94a346ea434d45f0edf90
This commit is contained in:
@@ -1374,12 +1374,20 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
// 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!
|
||||
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() {
|
||||
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
|
||||
kid.remove_flags(HAS_NEWLY_CONSTRUCTED_FLOW);
|
||||
need_to_reconstruct = true
|
||||
}
|
||||
}
|
||||
|
||||
if need_to_reconstruct {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user