mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Move local_name and namespace to LayoutJS<Element>.
This commit is contained in:
parent
23c679d55a
commit
9cc1e017ee
2 changed files with 18 additions and 15 deletions
|
@ -402,17 +402,12 @@ impl<'le> ::selectors::Element for LayoutElement<'le> {
|
|||
|
||||
#[inline]
|
||||
fn get_local_name<'a>(&'a self) -> &'a Atom {
|
||||
unsafe {
|
||||
(*self.element.unsafe_get()).local_name()
|
||||
}
|
||||
self.element.local_name()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_namespace<'a>(&'a self) -> &'a Namespace {
|
||||
use script::dom::element::ElementHelpers;
|
||||
unsafe {
|
||||
(*self.element.unsafe_get()).namespace()
|
||||
}
|
||||
self.element.namespace()
|
||||
}
|
||||
|
||||
fn is_link(&self) -> bool {
|
||||
|
|
|
@ -181,8 +181,6 @@ pub trait RawLayoutElementHelpers {
|
|||
unsafe fn get_indeterminate_state_for_layout(&self) -> bool;
|
||||
unsafe fn get_unsigned_integer_attribute_for_layout(&self, attribute: UnsignedIntegerAttribute)
|
||||
-> Option<u32>;
|
||||
|
||||
fn local_name<'a>(&'a self) -> &'a Atom;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -498,12 +496,6 @@ impl RawLayoutElementHelpers for Element {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Getters used in components/layout/wrapper.rs
|
||||
|
||||
fn local_name<'a>(&'a self) -> &'a Atom {
|
||||
&self.local_name
|
||||
}
|
||||
}
|
||||
|
||||
pub trait LayoutElementHelpers {
|
||||
|
@ -512,6 +504,8 @@ pub trait LayoutElementHelpers {
|
|||
#[allow(unsafe_code)]
|
||||
unsafe fn has_attr_for_layout(&self, namespace: &Namespace, name: &Atom) -> bool;
|
||||
fn style_attribute(&self) -> *const Option<PropertyDeclarationBlock>;
|
||||
fn local_name<'a>(&'a self) -> &'a Atom;
|
||||
fn namespace<'a>(&'a self) -> &'a Namespace;
|
||||
}
|
||||
|
||||
impl LayoutElementHelpers for LayoutJS<Element> {
|
||||
|
@ -536,6 +530,20 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
(*self.unsafe_get()).style_attribute.borrow_for_layout()
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn local_name<'a>(&'a self) -> &'a Atom {
|
||||
unsafe {
|
||||
&(*self.unsafe_get()).local_name
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn namespace<'a>(&'a self) -> &'a Namespace {
|
||||
unsafe {
|
||||
&(*self.unsafe_get()).namespace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue