mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Fix restyle hint conversion to handle eRestyle_ForceDescendants correcty.
This commit is contained in:
parent
dc244ad9e9
commit
8eef60ae1f
1 changed files with 11 additions and 1 deletions
|
@ -189,7 +189,8 @@ impl Default for RestyleHint {
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl From<nsRestyleHint> 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<nsRestyleHint> 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue