mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Introduce support for legacy presentational attributes to selector
matching, and use it for `<input size>` and `<td width>`. This implements a general framework for legacy presentational attributes to the DOM and style calculation, so that adding more of them later will be straightforward.
This commit is contained in:
parent
8077edc062
commit
5f8d3f72d8
31 changed files with 570 additions and 214 deletions
|
@ -5,7 +5,9 @@
|
|||
//! Traits that nodes must implement. Breaks the otherwise-cyclic dependency between layout and
|
||||
//! style.
|
||||
|
||||
use legacy::{IntegerAttribute, LengthAttribute};
|
||||
use selectors::AttrSelector;
|
||||
use servo_util::str::LengthOrPercentageOrAuto;
|
||||
use string_cache::{Atom, Namespace};
|
||||
|
||||
pub trait TNode<'a, E: TElement<'a>> : Clone + Copy {
|
||||
|
@ -45,4 +47,8 @@ pub trait TElement<'a> : Copy {
|
|||
fn each_class(self, callback: |&Atom|);
|
||||
}
|
||||
|
||||
pub trait TElementAttributes : Copy {
|
||||
fn get_length_attribute(self, attribute: LengthAttribute) -> LengthOrPercentageOrAuto;
|
||||
fn get_integer_attribute(self, attribute: IntegerAttribute) -> Option<i32>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue