Move get_attr and get_attrs into TElementAttributes.

These methods are only called on LayoutElement.
This commit is contained in:
Ms2ger 2015-05-10 13:05:54 +02:00
parent 2ff18b6b95
commit 34e35df986
9 changed files with 36 additions and 45 deletions

View file

@ -536,18 +536,6 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
self.element.namespace()
}
#[inline]
fn get_attr(self, namespace: &Namespace, name: &Atom) -> Option<&'le str> {
unsafe { self.element.get_attr_val_for_layout(namespace, name) }
}
#[inline]
fn get_attrs(self, name: &Atom) -> Vec<&'le str> {
unsafe {
self.element.get_attr_vals_for_layout(name)
}
}
fn get_link(self) -> Option<&'le str> {
// FIXME: This is HTML only.
let node: &Node = NodeCast::from_actual(self.element);
@ -650,7 +638,7 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
}
}
impl<'le> TElementAttributes for LayoutElement<'le> {
impl<'le> TElementAttributes<'le> for LayoutElement<'le> {
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>
{
@ -676,6 +664,18 @@ impl<'le> TElementAttributes for LayoutElement<'le> {
self.element.get_unsigned_integer_attribute_for_layout(attribute)
}
}
#[inline]
fn get_attr(self, namespace: &Namespace, name: &Atom) -> Option<&'le str> {
unsafe { self.element.get_attr_val_for_layout(namespace, name) }
}
#[inline]
fn get_attrs(self, name: &Atom) -> Vec<&'le str> {
unsafe {
self.element.get_attr_vals_for_layout(name)
}
}
}
fn get_content(content_list: &content::T) -> Vec<ContentItem> {