mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Remove (mostly) unused has_current_styles.
MozReview-Commit-ID: DV9HfvbUjBY
This commit is contained in:
parent
55d9151dd3
commit
9d21f9e6ce
3 changed files with 2 additions and 21 deletions
|
@ -470,15 +470,6 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
|
|||
/// Flags this element as having handled already its snapshot.
|
||||
unsafe fn set_handled_snapshot(&self);
|
||||
|
||||
/// Returns whether the element's styles are up-to-date.
|
||||
fn has_current_styles(&self, data: &ElementData) -> bool {
|
||||
if self.has_snapshot() && !self.handled_snapshot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
data.has_styles() && !data.has_invalidations()
|
||||
}
|
||||
|
||||
/// Returns whether the element's styles are up-to-date for |traversal_flags|.
|
||||
fn has_current_styles_for_traversal(
|
||||
&self,
|
||||
|
|
|
@ -52,17 +52,7 @@ where
|
|||
{
|
||||
let parent_el = element.inheritance_parent();
|
||||
let parent_data = parent_el.as_ref().and_then(|e| e.borrow_data());
|
||||
let parent_style = parent_data.as_ref().map(|d| {
|
||||
// Sometimes Gecko eagerly styles things without processing
|
||||
// pending restyles first. In general we'd like to avoid this,
|
||||
// but there can be good reasons (for example, needing to
|
||||
// construct a frame for some small piece of newly-added
|
||||
// content in order to do something specific with that frame,
|
||||
// but not wanting to flush all of layout).
|
||||
debug_assert!(cfg!(feature = "gecko") ||
|
||||
parent_el.unwrap().has_current_styles(d));
|
||||
d.styles.primary()
|
||||
});
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary());
|
||||
|
||||
let mut layout_parent_el = parent_el.clone();
|
||||
let layout_parent_data;
|
||||
|
|
|
@ -376,7 +376,7 @@ pub trait DomTraversal<E: TElement> : Sync {
|
|||
) -> bool {
|
||||
// See the comment on `cascade_node` for why we allow this on Gecko.
|
||||
debug_assert!(cfg!(feature = "gecko") ||
|
||||
parent.has_current_styles(parent_data));
|
||||
parent.has_current_styles_for_traversal(parent_data, context.shared.traversal_flags));
|
||||
|
||||
// If the parent computed display:none, we don't style the subtree.
|
||||
if parent_data.styles.is_display_none() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue