aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <hikezoe@mozilla.com>2017-05-31 05:48:25 +0900
committerHiroyuki Ikezoe <hikezoe@mozilla.com>2017-05-31 05:48:27 +0900
commit636c47da291e7f08952d7c3787b1b7ddd109968c (patch)
tree888f389dedbf248c2fea3fa8f36ad2c50429e4ea
parent011a7adf56d9a58be9707cdeeeb824c4b70df84a (diff)
downloadservo-636c47da291e7f08952d7c3787b1b7ddd109968c.tar.gz
servo-636c47da291e7f08952d7c3787b1b7ddd109968c.zip
Set the dirty flag of DeclarationBlock when the DeclarationBlock is modified and clear the flag when it's resyled.
-rw-r--r--components/style/dom.rs5
-rw-r--r--components/style/gecko/wrapper.rs9
-rw-r--r--components/style/matching.rs2
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;
}