aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/style/dom.rs9
-rw-r--r--components/style/style_resolver.rs12
-rw-r--r--components/style/traversal.rs2
3 files changed, 2 insertions, 21 deletions
diff --git a/components/style/dom.rs b/components/style/dom.rs
index bf62e0f532b..1dc01d8ee99 100644
--- a/components/style/dom.rs
+++ b/components/style/dom.rs
@@ -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,
diff --git a/components/style/style_resolver.rs b/components/style/style_resolver.rs
index 204f6021907..306aba45e19 100644
--- a/components/style/style_resolver.rs
+++ b/components/style/style_resolver.rs
@@ -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;
diff --git a/components/style/traversal.rs b/components/style/traversal.rs
index a3495fac924..42aba19c30a 100644
--- a/components/style/traversal.rs
+++ b/components/style/traversal.rs
@@ -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() {