aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-08-05 13:27:23 -0700
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-08-10 18:26:22 -0700
commit17772d1618f2716cad59ec747910fa50f20de2be (patch)
tree40af7bf2c89b53b5ad366836e7a0c6742c008351 /components/layout/construct.rs
parent544a117911c7283a3dbfc2cf089c6481d287508f (diff)
downloadservo-17772d1618f2716cad59ec747910fa50f20de2be.tar.gz
servo-17772d1618f2716cad59ec747910fa50f20de2be.zip
layout: Fix servo layout to take into account possibly unstyled child nodes in the display: none case.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 809ecaa406a..33b88f6b8c0 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -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
}