Create a new infrastructure for presentational hints.

This commit is contained in:
Ms2ger 2015-04-26 19:34:26 +02:00
parent 852d973a70
commit 582ee1c2b3
5 changed files with 41 additions and 3 deletions

View file

@ -68,8 +68,9 @@ use html5ever::serialize::SerializeOpts;
use html5ever::serialize::TraversalScope;
use html5ever::serialize::TraversalScope::{IncludeNode, ChildrenOnly};
use html5ever::tree_builder::{NoQuirks, LimitedQuirks, Quirks};
use selectors::matching::matches;
use selectors::matching::{matches, DeclarationBlock};
use selectors::parser::parse_author_origin_selector_list_from_str;
use selectors::smallvec::VecLike;
use string_cache::{Atom, Namespace, QualName};
use url::UrlParser;
@ -155,6 +156,9 @@ pub trait RawLayoutElementHelpers {
unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom) -> Option<Atom>;
unsafe fn has_class_for_layout(&self, name: &Atom) -> bool;
unsafe fn get_classes_for_layout(&self) -> Option<&'static [Atom]>;
unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>;
unsafe fn get_length_attribute_for_layout(&self, length_attribute: LengthAttribute)
-> LengthOrPercentageOrAuto;
unsafe fn get_integer_attribute_for_layout(&self, integer_attribute: IntegerAttribute)
@ -227,6 +231,11 @@ impl RawLayoutElementHelpers for Element {
})
}
unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, _: &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>
{
}
#[inline]
unsafe fn get_length_attribute_for_layout(&self, length_attribute: LengthAttribute)
-> LengthOrPercentageOrAuto {