diff --git a/components/style/invalidation/element/restyle_hints.rs b/components/style/invalidation/element/restyle_hints.rs index aac75ddea64..94bab930732 100644 --- a/components/style/invalidation/element/restyle_hints.rs +++ b/components/style/invalidation/element/restyle_hints.rs @@ -189,7 +189,8 @@ impl Default for RestyleHint { #[cfg(feature = "gecko")] impl From for RestyleHint { - fn from(raw: nsRestyleHint) -> Self { + fn from(mut raw: nsRestyleHint) -> Self { + use gecko_bindings::structs::nsRestyleHint_eRestyle_Force as eRestyle_Force; use gecko_bindings::structs::nsRestyleHint_eRestyle_ForceDescendants as eRestyle_ForceDescendants; use gecko_bindings::structs::nsRestyleHint_eRestyle_LaterSiblings as eRestyle_LaterSiblings; use gecko_bindings::structs::nsRestyleHint_eRestyle_Self as eRestyle_Self; @@ -202,14 +203,23 @@ impl From for RestyleHint { "Handle later siblings manually if necessary plz."); if (raw.0 & (eRestyle_Self.0 | eRestyle_Subtree.0)) != 0 { + raw.0 &= !eRestyle_Self.0; hint.insert(RESTYLE_SELF); } if (raw.0 & (eRestyle_Subtree.0 | eRestyle_SomeDescendants.0)) != 0 { + raw.0 &= !eRestyle_Subtree.0; + raw.0 &= !eRestyle_SomeDescendants.0; hint.insert(RESTYLE_DESCENDANTS); } + if (raw.0 & (eRestyle_ForceDescendants.0 | eRestyle_Force.0)) != 0 { + raw.0 &= !eRestyle_Force.0; + hint.insert(RECASCADE_SELF); + } + if (raw.0 & eRestyle_ForceDescendants.0) != 0 { + raw.0 &= !eRestyle_ForceDescendants.0; hint.insert(RECASCADE_DESCENDANTS); }