mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Privatize Attr
This commit is contained in:
parent
9a52bb8310
commit
78fef7eec5
4 changed files with 33 additions and 17 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue