mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Get rid of the ForNewlyBoundElement mode.
MozReview-Commit-ID: 1IRn2iaPnVc
This commit is contained in:
parent
543bbb7b9c
commit
68c8808711
2 changed files with 12 additions and 11 deletions
|
@ -20,8 +20,6 @@ bitflags! {
|
|||
const UnstyledChildrenOnly = 1 << 2,
|
||||
/// FIXME(bholley): This will go away.
|
||||
const ForReconstruct = 1 << 3,
|
||||
/// FIXME(bholley): This will go away.
|
||||
const ForNewlyBoundElement = 1 << 4,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +47,6 @@ pub fn assert_traversal_flags_match() {
|
|||
ServoTraversalFlags_ForCSSRuleChanges => ForCSSRuleChanges,
|
||||
ServoTraversalFlags_UnstyledChildrenOnly => UnstyledChildrenOnly,
|
||||
ServoTraversalFlags_ForReconstruct => ForReconstruct,
|
||||
ServoTraversalFlags_ForNewlyBoundElement => ForNewlyBoundElement,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -291,14 +291,6 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed,
|
|||
traversal_flags,
|
||||
unsafe { &*snapshots });
|
||||
|
||||
if traversal_flags.contains(traversal_flags::ForNewlyBoundElement) {
|
||||
// In this mode, we only ever restyle new elements, so there is no
|
||||
// need for a post-traversal, and the borrow_data().unwrap() call below
|
||||
// could panic, so we don't bother computing whether a post-traversal
|
||||
// is required.
|
||||
return false;
|
||||
}
|
||||
|
||||
element.has_dirty_descendants() ||
|
||||
element.has_animation_only_dirty_descendants() ||
|
||||
element.borrow_data().unwrap().restyle.contains_restyle_data()
|
||||
|
@ -2816,6 +2808,18 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
|||
data.styles.primary().clone().into()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolveStyleAllowStale(element: RawGeckoElementBorrowed)
|
||||
-> ServoStyleContextStrong
|
||||
{
|
||||
let element = GeckoElement(element);
|
||||
debug!("Servo_ResolveStyleAllowStale: {:?}", element);
|
||||
let data =
|
||||
element.borrow_data().expect("Resolving style on unstyled element");
|
||||
assert!(data.has_styles(), "Resolving style on unstyled element");
|
||||
data.styles.primary().clone().into()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue