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

@ -70,11 +70,13 @@ use std::sync::mpsc::Sender;
use string_cache::{Atom, Namespace};
use style::computed_values::content::ContentItem;
use style::computed_values::{content, display, white_space};
use selectors::matching::DeclarationBlock;
use selectors::parser::{NamespaceConstraint, AttrSelector};
use selectors::smallvec::VecLike;
use style::legacy::{IntegerAttribute, LengthAttribute, SimpleColorAttribute};
use style::legacy::{UnsignedIntegerAttribute};
use style::node::{TElement, TElementAttributes, TNode};
use style::properties::PropertyDeclarationBlock;
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
use url::Url;
/// Allows some convenience methods on generic layout nodes.
@ -659,6 +661,14 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
}
impl<'le> TElementAttributes for LayoutElement<'le> {
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>
{
unsafe {
self.element.synthesize_presentational_hints_for_legacy_attributes(hints);
}
}
fn get_length_attribute(self, length_attribute: LengthAttribute) -> LengthOrPercentageOrAuto {
unsafe {
self.element.get_length_attribute_for_layout(length_attribute)