aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2015-11-05 09:58:06 -0800
committerBobby Holley <bobbyholley@gmail.com>2015-11-10 11:57:24 -0800
commit7fa79366576751fa6d032091ea54698263783d5d (patch)
tree1eacd1b76fe400d33613afa5ff55e1d8cd0ae3ae /components/script/dom/attr.rs
parent47744d95add56352ab5d0631d3dd5e054aad3849 (diff)
downloadservo-7fa79366576751fa6d032091ea54698263783d5d.tar.gz
servo-7fa79366576751fa6d032091ea54698263783d5d.zip
Implement attribute restyle hints.
Fixes #6942.
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r--components/script/dom/attr.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs
index c5cd7c3d4ec..02ef5e4451e 100644
--- a/components/script/dom/attr.rs
+++ b/components/script/dom/attr.rs
@@ -148,6 +148,7 @@ impl AttrMethods for Attr {
impl Attr {
pub fn set_value(&self, mut value: AttrValue, owner: &Element) {
assert!(Some(owner) == self.owner().r());
+ owner.will_mutate_attr();
mem::swap(&mut *self.value.borrow_mut(), &mut value);
if self.identifier.namespace == ns!("") {
vtable_for(owner.upcast()).attribute_mutated(
@@ -155,6 +156,10 @@ impl Attr {
}
}
+ pub fn identifier(&self) -> &AttrIdentifier {
+ &self.identifier
+ }
+
pub fn value(&self) -> Ref<AttrValue> {
self.value.borrow()
}