Merge pull request #3124 from brunoabinader/attr-changes

Attr, AttrValue changes; r=Ms2ger
This commit is contained in:
Ms2ger 2014-08-22 14:11:29 +02:00
commit 664b1a7d1f

View file

@ -56,7 +56,10 @@ impl AttrValue {
AtomAttrValue(value) AtomAttrValue(value)
} }
pub fn as_slice<'a>(&'a self) -> &'a str { }
impl Str for AttrValue {
fn as_slice<'a>(&'a self) -> &'a str {
match *self { match *self {
StringAttrValue(ref value) | StringAttrValue(ref value) |
TokenListAttrValue(ref value, _) | TokenListAttrValue(ref value, _) |
@ -117,7 +120,7 @@ impl Attr {
if namespace_is_null { if namespace_is_null {
vtable_for(node).before_remove_attr( vtable_for(node).before_remove_attr(
self.local_name(), self.local_name(),
self.value.deref().borrow().as_slice().to_string()); self.value().as_slice().to_string())
} }
} }
FirstSetAttr => {} FirstSetAttr => {}
@ -128,7 +131,7 @@ impl Attr {
if namespace_is_null { if namespace_is_null {
vtable_for(node).after_set_attr( vtable_for(node).after_set_attr(
self.local_name(), self.local_name(),
self.value.deref().borrow().as_slice().to_string()); self.value().as_slice().to_string())
} }
} }
@ -147,7 +150,7 @@ impl<'a> AttrMethods for JSRef<'a, Attr> {
} }
fn Value(&self) -> DOMString { fn Value(&self) -> DOMString {
self.value.deref().borrow().as_slice().to_string() self.value().as_slice().to_string()
} }
fn SetValue(&self, value: DOMString) { fn SetValue(&self, value: DOMString) {