diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/style/dom.rs | 5 | ||||
-rw-r--r-- | components/style/gecko/wrapper.rs | 9 | ||||
-rw-r--r-- | components/style/matching.rs | 2 |
3 files changed, 16 insertions, 0 deletions
diff --git a/components/style/dom.rs b/components/style/dom.rs index 188cbb10d32..bb41785da69 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -329,6 +329,11 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + /// Get this element's style attribute. fn style_attribute(&self) -> Option<&Arc<Locked<PropertyDeclarationBlock>>>; + /// Unset the style attribute's dirty bit. + /// Servo doesn't need to manage ditry bit for style attribute. + fn unset_dirty_style_attribute(&self) { + } + /// Get this element's SMIL override declarations. fn get_smil_override(&self) -> Option<&Arc<Locked<PropertyDeclarationBlock>>> { None diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 24d83068c1e..80d77abd694 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -43,6 +43,7 @@ use gecko_bindings::bindings::Gecko_GetStyleAttrDeclarationBlock; use gecko_bindings::bindings::Gecko_GetStyleContext; use gecko_bindings::bindings::Gecko_IsSignificantChild; use gecko_bindings::bindings::Gecko_MatchStringArgPseudo; +use gecko_bindings::bindings::Gecko_UnsetDirtyStyleAttr; use gecko_bindings::bindings::Gecko_UpdateAnimations; use gecko_bindings::structs; use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode}; @@ -628,6 +629,14 @@ impl<'le> TElement for GeckoElement<'le> { declarations.map_or(None, |s| s.as_arc_opt()) } + fn unset_dirty_style_attribute(&self) { + if !self.may_have_style_attribute() { + return; + } + + unsafe { Gecko_UnsetDirtyStyleAttr(self.0) }; + } + fn get_smil_override(&self) -> Option<&Arc<Locked<PropertyDeclarationBlock>>> { let declarations = unsafe { Gecko_GetSMILOverrideDeclarationBlock(self.0) }; declarations.map(|s| s.as_arc_opt()).unwrap_or(None) diff --git a/components/style/matching.rs b/components/style/matching.rs index c811fef3afa..caef1c0c7ba 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -1019,6 +1019,7 @@ pub trait MatchMethods : TElement { &mut matching_context, &mut set_selector_flags); } + self.unset_dirty_style_attribute(); let primary_rule_node = stylist.rule_tree().compute_rule_node( &mut applicable_declarations, @@ -1301,6 +1302,7 @@ pub trait MatchMethods : TElement { result |= replace_rule_node(CascadeLevel::StyleAttributeImportant, style_attribute, primary_rules); + self.unset_dirty_style_attribute(); } return result; } |