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

@ -12,11 +12,15 @@ use util::str::LengthOrPercentageOrAuto;
use selectors::matching::DeclarationBlock;
pub use selectors::tree::{TNode, TElement};
use string_cache::{Atom, Namespace};
pub trait TElementAttributes : Copy {
pub trait TElementAttributes<'a> : Copy {
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>;
fn get_length_attribute(self, attribute: LengthAttribute) -> LengthOrPercentageOrAuto;
fn get_integer_attribute(self, attribute: IntegerAttribute) -> Option<i32>;
fn get_unsigned_integer_attribute(self, attribute: UnsignedIntegerAttribute) -> Option<u32>;
fn get_attr(self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
fn get_attrs(self, attr: &Atom) -> Vec<&'a str>;
}