Move input size to the new infrastructure.

This commit is contained in:
Ms2ger 2015-04-28 14:26:03 +02:00
parent 83f4b077eb
commit 0c8e55bff1
2 changed files with 27 additions and 28 deletions

View file

@ -30,8 +30,6 @@ pub enum LengthAttribute {
/// Legacy presentational attributes that take an integer as defined in HTML5 § 2.4.4.2.
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum IntegerAttribute {
/// `<input size>`
Size,
Cols,
Rows,
}
@ -122,25 +120,6 @@ impl PresentationalHintSynthesis for Stylist {
matching_rules_list,
shareable);
}
name if *name == atom!("input") => {
// FIXME(pcwalton): More use of atoms, please!
match element.get_attr(&ns!(""), &atom!("type")) {
Some("text") | Some("password") => {
match element.get_integer_attribute(IntegerAttribute::Size) {
Some(value) if value != 0 => {
let value = specified::Length::ServoCharacterWidth(
specified::CharacterWidth(value));
matching_rules_list.push(from_declaration(
PropertyDeclaration::Width(SpecifiedValue(
specified::LengthOrPercentageOrAuto::Length(value)))));
*shareable = false
}
Some(_) | None => {}
}
}
_ => {}
};
}
name if *name == atom!("textarea") => {
match element.get_integer_attribute(IntegerAttribute::Cols) {
Some(value) if value != 0 => {