mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Refactor RestyleHint to be a struct.
Later PRs will add additional data to it that is not so easy to represent using bitflags.
This commit is contained in:
parent
c13be5cd13
commit
a397590838
9 changed files with 294 additions and 111 deletions
|
@ -9,7 +9,7 @@ use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext};
|
|||
use data::{ElementData, ElementStyles, StoredRestyleHint};
|
||||
use dom::{DirtyDescendants, NodeInfo, OpaqueNode, TElement, TNode};
|
||||
use matching::{ChildCascadeRequirement, MatchMethods, StyleSharingBehavior};
|
||||
use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_SELF};
|
||||
use restyle_hints::RestyleHint;
|
||||
use selector_parser::RestyleDamage;
|
||||
#[cfg(feature = "servo")] use servo_config::opts;
|
||||
use std::borrow::BorrowMut;
|
||||
|
@ -232,7 +232,7 @@ pub trait DomTraversal<E: TElement> : Sync {
|
|||
if let Some(next) = root.next_sibling_element() {
|
||||
if let Some(mut next_data) = next.mutate_data() {
|
||||
let hint = StoredRestyleHint::subtree_and_later_siblings();
|
||||
next_data.ensure_restyle().hint.insert(&hint);
|
||||
next_data.ensure_restyle().hint.insert(hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -819,11 +819,11 @@ fn preprocess_children<E, D>(traversal: &D,
|
|||
|
||||
// Propagate the parent and sibling restyle hint.
|
||||
if !propagated_hint.is_empty() {
|
||||
restyle_data.hint.insert(&propagated_hint);
|
||||
restyle_data.hint.insert_from(&propagated_hint);
|
||||
}
|
||||
|
||||
if later_siblings {
|
||||
propagated_hint.insert(&(RESTYLE_SELF | RESTYLE_DESCENDANTS).into());
|
||||
propagated_hint.insert(RestyleHint::subtree().into());
|
||||
}
|
||||
|
||||
// Store the damage already handled by ancestors.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue