diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 4ac959679a7..af32ffad76b 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -41,7 +41,7 @@ use std::fmt; use std::slice::Items; use style::ComputedValues; use style::computed_values::border_style; -use style::computed_values::cursor::{AutoCursor, SpecifiedCursor}; +use style::computed_values::cursor; use sync::Arc; // It seems cleaner to have layout code not mention Azure directly, so let's just reexport this for @@ -629,8 +629,8 @@ impl DisplayItemMetadata { DisplayItemMetadata { node: node, cursor: match style.get_pointing().cursor { - AutoCursor => default_cursor, - SpecifiedCursor(cursor) => cursor, + cursor::T::AutoCursor => default_cursor, + cursor::T::SpecifiedCursor(cursor) => cursor, }, } } diff --git a/components/gfx/font.rs b/components/gfx/font.rs index a81c51b4bda..1e01e78a21f 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -194,8 +194,8 @@ impl Font { pub fn glyph_index(&self, codepoint: char) -> Option { let codepoint = match self.variant { - font_variant::small_caps => codepoint.to_uppercase(), - font_variant::normal => codepoint, + font_variant::T::small_caps => codepoint.to_uppercase(), + font_variant::T::normal => codepoint, }; self.handle.glyph_index(codepoint) } diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 5cc675086aa..a18a801b4e1 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -101,8 +101,8 @@ impl FontContext { // painting. We should also support true small-caps (where the // font supports it) in the future. let actual_pt_size = match variant { - font_variant::small_caps => pt_size.scale_by(SMALL_CAPS_SCALE_FACTOR), - font_variant::normal => pt_size, + font_variant::T::small_caps => pt_size.scale_by(SMALL_CAPS_SCALE_FACTOR), + font_variant::T::normal => pt_size, }; let handle: FontHandle = FontHandleMethods::new_from_template(&self.platform_handle, @@ -139,7 +139,7 @@ impl FontContext { // so they will never be released. Find out a good time to drop them. let desc = FontTemplateDescriptor::new(style.font_weight, - style.font_style == font_style::italic); + style.font_style == font_style::T::italic); let mut fonts = SmallVec8::new(); for family in style.font_family.iter() { diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 02b4635f29e..d106566aaef 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -176,8 +176,8 @@ impl<'a> PaintContext<'a> { }; match style_select { - border_style::none | border_style::hidden => {} - border_style::dotted => { + border_style::T::none | border_style::T::hidden => {} + border_style::T::dotted => { // FIXME(sammykim): This doesn't work well with dash_pattern and cap_style. self.draw_dashed_border_segment(direction, bounds, @@ -185,20 +185,20 @@ impl<'a> PaintContext<'a> { color_select, DashSize::DottedBorder); } - border_style::dashed => { + border_style::T::dashed => { self.draw_dashed_border_segment(direction, bounds, border, color_select, DashSize::DashedBorder); } - border_style::solid => { + border_style::T::solid => { self.draw_solid_border_segment(direction, bounds, border, radius, color_select); } - border_style::double => { + border_style::T::double => { self.draw_double_border_segment(direction, bounds, border, radius, color_select); } - border_style::groove | border_style::ridge => { + border_style::T::groove | border_style::T::ridge => { self.draw_groove_ridge_border_segment(direction, bounds, border, @@ -206,7 +206,7 @@ impl<'a> PaintContext<'a> { color_select, style_select); } - border_style::inset | border_style::outset => { + border_style::T::inset | border_style::T::outset => { self.draw_inset_outset_border_segment(direction, bounds, border, @@ -224,28 +224,28 @@ impl<'a> PaintContext<'a> { style: border_style::T) { let border = SideOffsets2D::new_all_same(bounds.size.width).to_float_px(); match style { - border_style::none | border_style::hidden => {} - border_style::dotted => { + border_style::T::none | border_style::T::hidden => {} + border_style::T::dotted => { self.draw_dashed_border_segment(Direction::Right, bounds, &border, color, DashSize::DottedBorder); } - border_style::dashed => { + border_style::T::dashed => { self.draw_dashed_border_segment(Direction::Right, bounds, &border, color, DashSize::DashedBorder); } - border_style::solid => { + border_style::T::solid => { self.draw_solid_border_segment(Direction::Right, bounds, &border, radius, color) } - border_style::double => { + border_style::T::double => { self.draw_double_border_segment(Direction::Right, bounds, &border, radius, color) } - border_style::groove | border_style::ridge => { + border_style::T::groove | border_style::T::ridge => { self.draw_groove_ridge_border_segment(Direction::Right, bounds, &border, @@ -253,7 +253,7 @@ impl<'a> PaintContext<'a> { color, style); } - border_style::inset | border_style::outset => { + border_style::T::inset | border_style::T::outset => { self.draw_inset_outset_border_segment(Direction::Right, bounds, &border, @@ -719,9 +719,9 @@ impl<'a> PaintContext<'a> { 0.5 * border.bottom, 0.5 * border.left); let is_groove = match style { - border_style::groove => true, - border_style::ridge => false, - _ => panic!("invalid border style") + border_style::T::groove => true, + border_style::T::ridge => false, + _ => panic!("invalid border style") }; let mut lighter_color; @@ -762,9 +762,9 @@ impl<'a> PaintContext<'a> { color: Color, style: border_style::T) { let is_inset = match style { - border_style::inset => true, - border_style::outset => false, - _ => panic!("invalid border style") + border_style::T::inset => true, + border_style::T::outset => false, + _ => panic!("invalid border style") }; // original bounds as a Rect let original_bounds = self.get_scaled_bounds(bounds, border, 0.0); diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index 109d4754637..a68e443183d 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -130,7 +130,7 @@ impl FontHandleMethods for FontHandle { unsafe { (*self.face).style_flags & FT_STYLE_FLAG_ITALIC != 0 } } fn boldness(&self) -> font_weight::T { - let default_weight = font_weight::Weight400; + let default_weight = font_weight::T::Weight400; if unsafe { (*self.face).style_flags & FT_STYLE_FLAG_BOLD == 0 } { default_weight } else { @@ -140,15 +140,15 @@ impl FontHandleMethods for FontHandle { if valid { let weight =(*os2).usWeightClass; match weight { - 1 | 100...199 => font_weight::Weight100, - 2 | 200...299 => font_weight::Weight200, - 3 | 300...399 => font_weight::Weight300, - 4 | 400...499 => font_weight::Weight400, - 5 | 500...599 => font_weight::Weight500, - 6 | 600...699 => font_weight::Weight600, - 7 | 700...799 => font_weight::Weight700, - 8 | 800...899 => font_weight::Weight800, - 9 | 900...999 => font_weight::Weight900, + 1 | 100...199 => font_weight::T::Weight100, + 2 | 200...299 => font_weight::T::Weight200, + 3 | 300...399 => font_weight::T::Weight300, + 4 | 400...499 => font_weight::T::Weight400, + 5 | 500...599 => font_weight::T::Weight500, + 6 | 600...699 => font_weight::T::Weight600, + 7 | 700...799 => font_weight::T::Weight700, + 8 | 800...899 => font_weight::T::Weight800, + 9 | 900...999 => font_weight::T::Weight900, _ => default_weight } } else {