diff options
author | Tim Taubert <tim@timtaubert.de> | 2014-10-11 23:25:42 +0200 |
---|---|---|
committer | Tim Taubert <tim@timtaubert.de> | 2014-10-13 13:18:57 +0200 |
commit | 78fef7eec5b6f29396f6ffdcb08826173a3742f8 (patch) | |
tree | 4fd7b005fb3e207e6dd366af01d97134c75901ea /components/script/dom/attr.rs | |
parent | 9a52bb8310eb9d479a5211b0048bb682da0ac123 (diff) | |
download | servo-78fef7eec5b6f29396f6ffdcb08826173a3742f8.tar.gz servo-78fef7eec5b6f29396f6ffdcb08826173a3742f8.zip |
Privatize Attr
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r-- | components/script/dom/attr.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 0a3bacc856f..d54be57b8e0 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -72,13 +72,14 @@ impl Str for AttrValue { #[jstraceable] #[must_root] +#[privatize] pub struct Attr { reflector_: Reflector, local_name: Atom, value: RefCell<AttrValue>, - pub name: Atom, - pub namespace: Namespace, - pub prefix: Option<DOMString>, + name: Atom, + namespace: Namespace, + prefix: Option<DOMString>, /// the element that owns this attribute. owner: JS<Element>, @@ -111,6 +112,21 @@ impl Attr { reflect_dom_object(box Attr::new_inherited(local_name, value, name, namespace, prefix, owner), &global::Window(window), AttrBinding::Wrap) } + + #[inline] + pub fn name<'a>(&'a self) -> &'a Atom { + &self.name + } + + #[inline] + pub fn namespace<'a>(&'a self) -> &'a Namespace { + &self.namespace + } + + #[inline] + pub fn prefix<'a>(&'a self) -> &'a Option<DOMString> { + &self.prefix + } } impl<'a> AttrMethods for JSRef<'a, Attr> { |