Bug 1349553: Add a bit of debugging information to the preprocess_children stage. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 22 Mar 2017 14:38:33 +0100
changeset 502962 b086b6db9307ee94c3f376b08fa2b2f4862b2b25
parent 502961 cbe8226fb365be3c5f8fa33f4446f744ad3eface
child 502963 d2b8bfbe1f7d3a20934570a1528d65864cb6b2c8
push id50427
push userbmo:emilio+bugs@crisal.io
push dateWed, 22 Mar 2017 14:00:40 +0000
bugs1349553
milestone55.0a1
Bug 1349553: Add a bit of debugging information to the preprocess_children stage. MozReview-Commit-ID: 7zv62MRX8dE
servo/components/style/traversal.rs
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -562,16 +562,17 @@ fn compute_style<E, D>(_traversal: &D,
 fn preprocess_children<E, D>(traversal: &D,
                              element: E,
                              mut propagated_hint: StoredRestyleHint,
                              damage_handled: RestyleDamage,
                              parent_inherited_style_changed: bool)
     where E: TElement,
           D: DomTraversal<E>
 {
+    debug!("preprocess_children: {:?}", element);
     // Loop over all the children.
     for child in element.as_node().children() {
         // FIXME(bholley): Add TElement::element_children instead of this.
         let child = match child.as_element() {
             Some(el) => el,
             None => continue,
         };
 
@@ -594,16 +595,18 @@ fn preprocess_children<E, D>(traversal: 
         // Propagate the parent and sibling restyle hint.
         if !propagated_hint.is_empty() {
             restyle_data.hint.insert(&propagated_hint);
         }
 
         // Handle element snapshots and sibling restyle hints.
         let stylist = &traversal.shared_context().stylist;
         let later_siblings = restyle_data.compute_final_hint(child, stylist);
+        debug!(" > {:?} -> {:?}, later_siblings: {:?}",
+               child, restyle_data.hint, later_siblings);
         if later_siblings {
             propagated_hint.insert(&(RESTYLE_SELF | RESTYLE_DESCENDANTS).into());
         }
 
         // Store the damage already handled by ancestors.
         restyle_data.set_damage_handled(damage_handled);
 
         // If properties that we inherited from the parent changed, we need to recascade.