aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2015-09-17 08:36:27 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2015-09-17 10:50:47 -0700
commit040c09fbc51ac282b7224799851d62cd3a60ee7f (patch)
treec6fedcb372a8ee8cb4efc04df5b4672590830c0b /components/layout/construct.rs
parent4e69f301e19e6f1d9a1b4f231e5a445888b03370 (diff)
downloadservo-040c09fbc51ac282b7224799851d62cd3a60ee7f.tar.gz
servo-040c09fbc51ac282b7224799851d62cd3a60ee7f.zip
Always reset HAS_NEWLY_CONSTRUCTED_FLOW during flow construction
This extra reflows when the HAS_NEWLY_CONSTRUCTED_FLOW flag remained set during a later reflow. This masked other incremental layout bugs, including the one tested by the reftest in the commit following this one.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index dd1d58a6acc..d7e1628dd38 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -1296,10 +1296,9 @@ impl<'a> FlowConstructor<'a> {
pub fn repair_if_possible(&mut self, node: &ThreadSafeLayoutNode) -> bool {
// We can skip reconstructing the flow if we don't have to reconstruct and none of our kids
// did either.
- if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
- return false
- }
-
+ //
+ // 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;
for kid in node.children() {
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
@@ -1311,6 +1310,11 @@ impl<'a> FlowConstructor<'a> {
return false
}
+ if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
+ return false
+ }
+
+
let mut style = node.style().clone();
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");