Stop using int and uint in style.

This commit is contained in:
Ms2ger 2015-04-05 19:13:01 +02:00
parent f22d920b4d
commit 9aa9a3b8fd
4 changed files with 9 additions and 10 deletions

View file

@ -147,7 +147,7 @@ impl PresentationalHintSynthesis for Stylist {
UnsignedIntegerAttribute::CellSpacing) { UnsignedIntegerAttribute::CellSpacing) {
None => {} None => {}
Some(length) => { Some(length) => {
let width_value = specified::Length::Absolute(Au::from_px(length as int)); let width_value = specified::Length::Absolute(Au::from_px(length as isize));
matching_rules_list.vec_push(from_declaration( matching_rules_list.vec_push(from_declaration(
PropertyDeclaration::BorderSpacing( PropertyDeclaration::BorderSpacing(
SpecifiedValue( SpecifiedValue(
@ -177,7 +177,7 @@ impl PresentationalHintSynthesis for Stylist {
Some("text") | Some("password") => { Some("text") | Some("password") => {
specified::Length::ServoCharacterWidth(specified::CharacterWidth(value)) specified::Length::ServoCharacterWidth(specified::CharacterWidth(value))
} }
_ => specified::Length::Absolute(Au::from_px(value as int)), _ => specified::Length::Absolute(Au::from_px(value as isize)),
}; };
matching_rules_list.vec_push(from_declaration( matching_rules_list.vec_push(from_declaration(
PropertyDeclaration::Width(SpecifiedValue( PropertyDeclaration::Width(SpecifiedValue(
@ -256,7 +256,7 @@ impl PresentationalHintSynthesis for Stylist {
match element.get_unsigned_integer_attribute(UnsignedIntegerAttribute::Border) { match element.get_unsigned_integer_attribute(UnsignedIntegerAttribute::Border) {
None => {} None => {}
Some(length) => { Some(length) => {
let width_value = specified::Length::Absolute(Au::from_px(length as int)); let width_value = specified::Length::Absolute(Au::from_px(length as isize));
matching_rules_list.vec_push(from_declaration( matching_rules_list.vec_push(from_declaration(
PropertyDeclaration::BorderTopWidth(SpecifiedValue( PropertyDeclaration::BorderTopWidth(SpecifiedValue(
longhands::border_top_width::SpecifiedValue(width_value))))); longhands::border_top_width::SpecifiedValue(width_value)))));

View file

@ -4,7 +4,6 @@
#![feature(alloc)] #![feature(alloc)]
#![feature(plugin)] #![feature(plugin)]
#![feature(int_uint)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(core)] #![feature(core)]
#![feature(collections)] #![feature(collections)]

View file

@ -1607,7 +1607,7 @@ pub mod longhands {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
% for weight in range(100, 901, 100): % for weight in range(100, 901, 100):
&T::Weight${weight} => write!(f, "{}", ${weight}i), &T::Weight${weight} => write!(f, "{}", ${weight}),
% endfor % endfor
} }
} }
@ -1682,7 +1682,7 @@ pub mod longhands {
use util::geometry::Au; use util::geometry::Au;
pub type T = Au; pub type T = Au;
} }
const MEDIUM_PX: int = 16; const MEDIUM_PX: isize = 16;
#[inline] pub fn get_initial_value() -> computed_value::T { #[inline] pub fn get_initial_value() -> computed_value::T {
Au::from_px(MEDIUM_PX) Au::from_px(MEDIUM_PX)
} }
@ -4359,11 +4359,11 @@ mod property_bit_field {
} }
#[inline] #[inline]
fn get(&self, bit: uint) -> bool { fn get(&self, bit: usize) -> bool {
(self.storage[bit / 32] & (1 << (bit % 32))) != 0 (self.storage[bit / 32] & (1 << (bit % 32))) != 0
} }
#[inline] #[inline]
fn set(&mut self, bit: uint) { fn set(&mut self, bit: usize) {
self.storage[bit / 32] |= 1 << (bit % 32) self.storage[bit / 32] |= 1 << (bit % 32)
} }
% for i, property in enumerate(LONGHANDS): % for i, property in enumerate(LONGHANDS):

View file

@ -38,7 +38,7 @@ pub struct Stylist {
element_map: PerPseudoElementSelectorMap, element_map: PerPseudoElementSelectorMap,
before_map: PerPseudoElementSelectorMap, before_map: PerPseudoElementSelectorMap,
after_map: PerPseudoElementSelectorMap, after_map: PerPseudoElementSelectorMap,
rules_source_order: uint, rules_source_order: usize,
} }
impl Stylist { impl Stylist {
@ -52,7 +52,7 @@ impl Stylist {
element_map: PerPseudoElementSelectorMap::new(), element_map: PerPseudoElementSelectorMap::new(),
before_map: PerPseudoElementSelectorMap::new(), before_map: PerPseudoElementSelectorMap::new(),
after_map: PerPseudoElementSelectorMap::new(), after_map: PerPseudoElementSelectorMap::new(),
rules_source_order: 0u, rules_source_order: 0,
}; };
// FIXME: Add iso-8859-9.css when the documents encoding is ISO-8859-8. // FIXME: Add iso-8859-9.css when the documents encoding is ISO-8859-8.
// FIXME: presentational-hints.css should be at author origin with zero specificity. // FIXME: presentational-hints.css should be at author origin with zero specificity.