mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Move Attr::local_name() to AttrHelpers/AttrHelpersForLayout.
This commit is contained in:
parent
b73b06b9a8
commit
a4ec892dbc
2 changed files with 12 additions and 6 deletions
|
@ -110,10 +110,6 @@ impl Attr {
|
|||
let attr = Attr::new_inherited(local_name, value, name, namespace, prefix, owner);
|
||||
reflect_dom_object(box attr, &Window(*window), AttrBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn local_name<'a>(&'a self) -> &'a Atom {
|
||||
&self.local_name
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AttrMethods for JSRef<'a, Attr> {
|
||||
|
@ -151,6 +147,7 @@ impl<'a> AttrMethods for JSRef<'a, Attr> {
|
|||
pub trait AttrHelpers {
|
||||
fn set_value(&self, set_type: AttrSettingType, value: AttrValue);
|
||||
fn value<'a>(&'a self) -> Ref<'a, AttrValue>;
|
||||
fn local_name<'a>(&'a self) -> &'a Atom;
|
||||
}
|
||||
|
||||
impl<'a> AttrHelpers for JSRef<'a, Attr> {
|
||||
|
@ -182,11 +179,16 @@ impl<'a> AttrHelpers for JSRef<'a, Attr> {
|
|||
fn value<'a>(&'a self) -> Ref<'a, AttrValue> {
|
||||
self.value.deref().borrow()
|
||||
}
|
||||
|
||||
fn local_name<'a>(&'a self) -> &'a Atom {
|
||||
&self.local_name
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AttrHelpersForLayout {
|
||||
unsafe fn value_ref_forever(&self) -> &'static str;
|
||||
unsafe fn value_atom_forever(&self) -> Option<Atom>;
|
||||
unsafe fn local_name_atom_forever(&self) -> Atom;
|
||||
}
|
||||
|
||||
impl AttrHelpersForLayout for Attr {
|
||||
|
@ -204,4 +206,8 @@ impl AttrHelpersForLayout for Attr {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn local_name_atom_forever(&self) -> Atom {
|
||||
self.local_name.clone()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue