servo: Merge #17204 - style: always re-cascade in native anonymous subtrees (from heycam:recascade-nac); r=emilio
authorCameron McCormack <cam@mcc.id.au>
Wed, 07 Jun 2017 01:04:08 -0700
changeset 410910 72d59502362b52b49cfa141703d7e82d4180bff6
parent 410909 6175f32bed68450cf039f42399802243f0e4898d
child 410911 60afe5db03953126ca3f6a40e7a3aab81e425556
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #17204 - style: always re-cascade in native anonymous subtrees (from heycam:recascade-nac); r=emilio From https://bugzilla.mozilla.org/show_bug.cgi?id=1345699. Source-Repo: https://github.com/servo/servo Source-Revision: 644773d492909e4450832954d21970271655e798
servo/components/style/traversal.rs
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -685,16 +685,22 @@ pub fn recalc_style_at<E, D>(traversal: 
                 cascade_hint |= RECASCADE_SELF;
             }
             ChildCascadeRequirement::MustCascadeDescendants => {
                 cascade_hint |= RECASCADE_SELF | RECASCADE_DESCENDANTS;
             }
             ChildCascadeRequirement::CanSkipCascade => {}
         };
 
+        // We must always cascade native anonymous subtrees, since they inherit styles
+        // from their first non-NAC ancestor.
+        if element.is_native_anonymous() {
+            cascade_hint |= RECASCADE_SELF;
+        }
+
         // If we're restyling this element to display:none, throw away all style
         // data in the subtree, notify the caller to early-return.
         if data.styles().is_display_none() {
             debug!("{:?} style is display:none - clearing data from descendants.",
                    element);
             clear_descendant_data(element, &|e| unsafe { D::clear_element_data(&e) });
         }
     }