diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-11-01 11:50:25 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-11-10 17:47:28 +0100 |
commit | e1fcffb336d763d851f14fae5cda464209552bb2 (patch) | |
tree | 8a798343e33bdbf6bc26e07d9c3047bbfa3d8217 | |
parent | ede79a6a5db4beacfbf5b2989a4ba9b565f507c1 (diff) | |
download | servo-e1fcffb336d763d851f14fae5cda464209552bb2.tar.gz servo-e1fcffb336d763d851f14fae5cda464209552bb2.zip |
Use 2018-style paths in code generated by Mako
26 files changed, 598 insertions, 597 deletions
diff --git a/components/style/gecko/pseudo_element_definition.mako.rs b/components/style/gecko/pseudo_element_definition.mako.rs index 7c45ee8bfb7..8144732d08a 100644 --- a/components/style/gecko/pseudo_element_definition.mako.rs +++ b/components/style/gecko/pseudo_element_definition.mako.rs @@ -156,7 +156,7 @@ impl PseudoElement { /// Construct a `CSSPseudoElementType` from a pseudo-element #[inline] fn pseudo_type(&self) -> CSSPseudoElementType { - use gecko_bindings::structs::CSSPseudoElementType_InheritingAnonBox; + use crate::gecko_bindings::structs::CSSPseudoElementType_InheritingAnonBox; match *self { % for pseudo in PSEUDOS: diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 5b07f9c326a..38fb9b71c6d 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -270,12 +270,12 @@ class Longhand(object): def base_type(self): if self.predefined_type and not self.is_vector: - return "::values::specified::{}".format(self.predefined_type) + return "crate::values::specified::{}".format(self.predefined_type) return "longhands::{}::SpecifiedValue".format(self.ident) def specified_type(self): if self.predefined_type and not self.is_vector: - ty = "::values::specified::{}".format(self.predefined_type) + ty = "crate::values::specified::{}".format(self.predefined_type) else: ty = "longhands::{}::SpecifiedValue".format(self.ident) if self.boxed: diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 7fe1cd4d5c7..b41e84a3be8 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -10,63 +10,63 @@ %> <%namespace name="helpers" file="/helpers.mako.rs" /> -use Atom; +use crate::Atom; use app_units::Au; -use custom_properties::CustomPropertiesMap; -use gecko_bindings::bindings; +use crate::custom_properties::CustomPropertiesMap; +use crate::gecko_bindings::bindings; % for style_struct in data.style_structs: -use gecko_bindings::structs::${style_struct.gecko_ffi_name}; -use gecko_bindings::bindings::Gecko_Construct_Default_${style_struct.gecko_ffi_name}; -use gecko_bindings::bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name}; -use gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; +use crate::gecko_bindings::structs::${style_struct.gecko_ffi_name}; +use crate::gecko_bindings::bindings::Gecko_Construct_Default_${style_struct.gecko_ffi_name}; +use crate::gecko_bindings::bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name}; +use crate::gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; % endfor -use gecko_bindings::bindings::Gecko_CopyCounterStyle; -use gecko_bindings::bindings::Gecko_CopyCursorArrayFrom; -use gecko_bindings::bindings::Gecko_CopyFontFamilyFrom; -use gecko_bindings::bindings::Gecko_CopyImageValueFrom; -use gecko_bindings::bindings::Gecko_CopyListStyleImageFrom; -use gecko_bindings::bindings::Gecko_EnsureImageLayersLength; -use gecko_bindings::bindings::Gecko_SetCursorArrayLength; -use gecko_bindings::bindings::Gecko_SetCursorImageValue; -use gecko_bindings::bindings::Gecko_NewCSSShadowArray; -use gecko_bindings::bindings::Gecko_nsStyleFont_SetLang; -use gecko_bindings::bindings::Gecko_nsStyleFont_CopyLangFrom; -use gecko_bindings::bindings::Gecko_SetListStyleImageNone; -use gecko_bindings::bindings::Gecko_SetListStyleImageImageValue; -use gecko_bindings::bindings::Gecko_SetNullImageValue; -use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom}; -use gecko_bindings::bindings::RawGeckoPresContextBorrowed; -use gecko_bindings::structs; -use gecko_bindings::structs::nsCSSPropertyID; -use gecko_bindings::structs::mozilla::CSSPseudoElementType; -use gecko_bindings::structs::mozilla::CSSPseudoElementType_InheritingAnonBox; -use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut}; -use gecko_bindings::sugar::refptr::RefPtr; -use gecko::values::convert_nscolor_to_rgba; -use gecko::values::convert_rgba_to_nscolor; -use gecko::values::GeckoStyleCoordConvertible; -use gecko::values::round_border_to_device_pixels; -use logical_geometry::WritingMode; -use media_queries::Device; -use properties::computed_value_flags::*; -use properties::longhands; -use rule_tree::StrongRuleNode; -use selector_parser::PseudoElement; +use crate::gecko_bindings::bindings::Gecko_CopyCounterStyle; +use crate::gecko_bindings::bindings::Gecko_CopyCursorArrayFrom; +use crate::gecko_bindings::bindings::Gecko_CopyFontFamilyFrom; +use crate::gecko_bindings::bindings::Gecko_CopyImageValueFrom; +use crate::gecko_bindings::bindings::Gecko_CopyListStyleImageFrom; +use crate::gecko_bindings::bindings::Gecko_EnsureImageLayersLength; +use crate::gecko_bindings::bindings::Gecko_SetCursorArrayLength; +use crate::gecko_bindings::bindings::Gecko_SetCursorImageValue; +use crate::gecko_bindings::bindings::Gecko_NewCSSShadowArray; +use crate::gecko_bindings::bindings::Gecko_nsStyleFont_SetLang; +use crate::gecko_bindings::bindings::Gecko_nsStyleFont_CopyLangFrom; +use crate::gecko_bindings::bindings::Gecko_SetListStyleImageNone; +use crate::gecko_bindings::bindings::Gecko_SetListStyleImageImageValue; +use crate::gecko_bindings::bindings::Gecko_SetNullImageValue; +use crate::gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom}; +use crate::gecko_bindings::bindings::RawGeckoPresContextBorrowed; +use crate::gecko_bindings::structs; +use crate::gecko_bindings::structs::nsCSSPropertyID; +use crate::gecko_bindings::structs::mozilla::CSSPseudoElementType; +use crate::gecko_bindings::structs::mozilla::CSSPseudoElementType_InheritingAnonBox; +use crate::gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut}; +use crate::gecko_bindings::sugar::refptr::RefPtr; +use crate::gecko::values::convert_nscolor_to_rgba; +use crate::gecko::values::convert_rgba_to_nscolor; +use crate::gecko::values::GeckoStyleCoordConvertible; +use crate::gecko::values::round_border_to_device_pixels; +use crate::logical_geometry::WritingMode; +use crate::media_queries::Device; +use crate::properties::computed_value_flags::*; +use crate::properties::longhands; +use crate::rule_tree::StrongRuleNode; +use crate::selector_parser::PseudoElement; use servo_arc::{Arc, RawOffsetArc}; use std::marker::PhantomData; use std::mem::{forget, uninitialized, transmute, zeroed}; use std::{cmp, ops, ptr}; -use values::{self, CustomIdent, Either, KeyframesName, None_}; -use values::computed::{NonNegativeLength, Percentage, TransitionProperty}; -use values::computed::font::FontSize; -use values::computed::effects::{BoxShadow, Filter, SimpleShadow}; -use values::computed::outline::OutlineStyle; -use values::generics::column::ColumnCount; -use values::generics::position::ZIndex; -use values::generics::text::MozTabSize; -use values::generics::transform::TransformStyle; -use values::generics::url::UrlOrNone; -use computed_values::border_style; +use crate::values::{self, CustomIdent, Either, KeyframesName, None_}; +use crate::values::computed::{NonNegativeLength, Percentage, TransitionProperty}; +use crate::values::computed::font::FontSize; +use crate::values::computed::effects::{BoxShadow, Filter, SimpleShadow}; +use crate::values::computed::outline::OutlineStyle; +use crate::values::generics::column::ColumnCount; +use crate::values::generics::position::ZIndex; +use crate::values::generics::text::MozTabSize; +use crate::values::generics::transform::TransformStyle; +use crate::values::generics::url::UrlOrNone; +use crate::computed_values::border_style; pub mod style_structs { % for style_struct in data.style_structs: @@ -75,10 +75,10 @@ pub mod style_structs { } /// FIXME(emilio): This is completely duplicated with the other properties code. -pub type ComputedValuesInner = ::gecko_bindings::structs::ServoComputedData; +pub type ComputedValuesInner = crate::gecko_bindings::structs::ServoComputedData; #[repr(C)] -pub struct ComputedValues(::gecko_bindings::structs::mozilla::ComputedStyle); +pub struct ComputedValues(crate::gecko_bindings::structs::mozilla::ComputedStyle); impl ComputedValues { pub fn new( @@ -148,7 +148,7 @@ impl ComputedValues { &self, old_values: Option<<&ComputedValues> ) -> bool { - use properties::longhands::display::computed_value::T as Display; + use crate::properties::longhands::display::computed_value::T as Display; old_values.map_or(false, |old| { let old_display_style = old.get_box().clone_display(); @@ -308,7 +308,7 @@ impl ComputedValuesInner { } <%def name="declare_style_struct(style_struct)"> -pub use ::gecko_bindings::structs::mozilla::Gecko${style_struct.gecko_name} as ${style_struct.gecko_struct_name}; +pub use crate::gecko_bindings::structs::mozilla::Gecko${style_struct.gecko_name} as ${style_struct.gecko_struct_name}; impl ${style_struct.gecko_struct_name} { pub fn gecko(&self) -> &${style_struct.gecko_ffi_name} { &self.gecko @@ -371,7 +371,7 @@ def set_gecko_property(ffi_name, expr): <%def name="impl_keyword_setter(ident, gecko_ffi_name, keyword, cast_type='u8', on_set=None)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { - use properties::longhands::${ident}::computed_value::T as Keyword; + use crate::properties::longhands::${ident}::computed_value::T as Keyword; // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts let result = match v { % for value in keyword.values_for('gecko'): @@ -392,7 +392,7 @@ def set_gecko_property(ffi_name, expr): // We should remove this after fix bug 1371809. #[allow(non_snake_case, non_upper_case_globals)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use properties::longhands::${ident}::computed_value::T as Keyword; + use crate::properties::longhands::${ident}::computed_value::T as Keyword; // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts // Some constant macros in the gecko are defined as negative integer(e.g. font-stretch). @@ -518,8 +518,8 @@ def set_gecko_property(ffi_name, expr): // set on mContextFlags, and the length field is set to the initial value. pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { - use values::generics::svg::{SVGLength, SvgLengthOrPercentageOrNumber}; - use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + use crate::values::generics::svg::{SVGLength, SvgLengthOrPercentageOrNumber}; + use crate::gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; let length = match v { SVGLength::Length(length) => { self.gecko.mContextFlags &= !CONTEXT_VALUE; @@ -542,7 +542,7 @@ def set_gecko_property(ffi_name, expr): } pub fn copy_${ident}_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + use crate::gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; self.gecko.${gecko_ffi_name}.copy_from(&other.gecko.${gecko_ffi_name}); self.gecko.mContextFlags = (self.gecko.mContextFlags & !CONTEXT_VALUE) | @@ -554,9 +554,9 @@ def set_gecko_property(ffi_name, expr): } pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::generics::svg::{SVGLength, SvgLengthOrPercentageOrNumber}; - use values::computed::LengthOrPercentage; - use gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; + use crate::values::generics::svg::{SVGLength, SvgLengthOrPercentageOrNumber}; + use crate::values::computed::LengthOrPercentage; + use crate::gecko_bindings::structs::nsStyleSVG_${ident.upper()}_CONTEXT as CONTEXT_VALUE; if (self.gecko.mContextFlags & CONTEXT_VALUE) != 0 { return SVGLength::ContextValue; } @@ -589,10 +589,10 @@ def set_gecko_property(ffi_name, expr): <% source_prefix = ident.split("_")[0].upper() + "_OPACITY_SOURCE" %> pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { - use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; - use gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; - use gecko_bindings::structs::nsStyleSVGOpacitySource::*; - use values::generics::svg::SVGOpacity; + use crate::gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + use crate::gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; + use crate::gecko_bindings::structs::nsStyleSVGOpacitySource::*; + use crate::values::generics::svg::SVGOpacity; self.gecko.mContextFlags &= !MASK; match v { SVGOpacity::Opacity(opacity) => { @@ -614,7 +614,7 @@ def set_gecko_property(ffi_name, expr): } pub fn copy_${ident}_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + use crate::gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; self.gecko.${gecko_ffi_name} = other.gecko.${gecko_ffi_name}; self.gecko.mContextFlags = (self.gecko.mContextFlags & !MASK) | @@ -626,10 +626,10 @@ def set_gecko_property(ffi_name, expr): } pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; - use gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; - use gecko_bindings::structs::nsStyleSVGOpacitySource::*; - use values::generics::svg::SVGOpacity; + use crate::gecko_bindings::structs::nsStyleSVG_${source_prefix}_MASK as MASK; + use crate::gecko_bindings::structs::nsStyleSVG_${source_prefix}_SHIFT as SHIFT; + use crate::gecko_bindings::structs::nsStyleSVGOpacitySource::*; + use crate::values::generics::svg::SVGOpacity; let source = (self.gecko.mContextFlags & MASK) >> SHIFT; if source == eStyleSVGOpacitySource_Normal as u8 { @@ -649,7 +649,7 @@ def set_gecko_property(ffi_name, expr): <%def name="impl_svg_paint(ident, gecko_ffi_name)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, mut v: longhands::${ident}::computed_value::T) { - use values::generics::svg::SVGPaintKind; + use crate::values::generics::svg::SVGPaintKind; use self::structs::nsStyleSVGPaintType; use self::structs::nsStyleSVGFallbackType; @@ -711,8 +711,8 @@ def set_gecko_property(ffi_name, expr): #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::computed::url::ComputedUrl; - use values::generics::svg::{SVGPaint, SVGPaintKind}; + use crate::values::computed::url::ComputedUrl; + use crate::values::generics::svg::{SVGPaint, SVGPaintKind}; use self::structs::nsStyleSVGPaintType; use self::structs::nsStyleSVGFallbackType; let ref paint = ${get_gecko_property(gecko_ffi_name)}; @@ -813,7 +813,7 @@ def set_gecko_property(ffi_name, expr): #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use properties::longhands::${ident}::computed_value::T; + use crate::properties::longhands::${ident}::computed_value::T; T::from_gecko_style_coord(&self.gecko.${gecko_ffi_name}.data_at(${index})) .expect("clone for ${ident} failed") } @@ -835,7 +835,7 @@ def set_gecko_property(ffi_name, expr): #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use properties::longhands::${ident}::computed_value::T; + use crate::properties::longhands::${ident}::computed_value::T; T::from_gecko_style_coord(&self.gecko.${gecko_ffi_name}) .expect("clone for ${ident} failed") } @@ -895,7 +895,7 @@ def set_gecko_property(ffi_name, expr): #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::computed::border::BorderCornerRadius; + use crate::values::computed::border::BorderCornerRadius; let width = GeckoStyleCoordConvertible::from_gecko_style_coord( &self.gecko.${gecko_ffi_name}.data_at(${x_index})) .expect("Failed to clone ${ident}"); @@ -933,7 +933,7 @@ def set_gecko_property(ffi_name, expr): #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::computed::url::ComputedUrl; + use crate::values::computed::url::ComputedUrl; if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() { return UrlOrNone::none() @@ -1012,7 +1012,7 @@ transform_functions = [ "list" : "%s.set_shared_list(%s.0.iter().map(&convert_to_ns_css_value));", } %> - ::values::generics::transform::TransformOperation::${name}${pattern} => { + crate::values::generics::transform::TransformOperation::${name}${pattern} => { % if has_optional: let optional_present = ${items[-1] + str(len(items))}.is_some(); let len = if optional_present { @@ -1082,7 +1082,7 @@ transform_functions = [ %> structs::nsCSSKeyword::eCSSKeyword_${keyword} => { - ::values::generics::transform::TransformOperation::${name}${pre_symbols} + crate::values::generics::transform::TransformOperation::${name}${pre_symbols} % for index, item in enumerate(items): % if keyword == "matrix3d": m${index / 4 + 1}${index % 4 + 1}: @@ -1115,8 +1115,8 @@ fn set_single_transform_function( servo_value: &values::computed::TransformOperation, gecko_value: &mut structs::nsCSSValue /* output */ ) { - use values::computed::TransformOperation; - use values::generics::transform::{Matrix, Matrix3D}; + use crate::values::computed::TransformOperation; + use crate::values::generics::transform::{Matrix, Matrix3D}; let convert_to_ns_css_value = |item: &TransformOperation| -> structs::nsCSSValue { let mut value = structs::nsCSSValue::null(); @@ -1137,7 +1137,7 @@ pub fn convert_transform( input: &[values::computed::TransformOperation], output: &mut structs::root::RefPtr<structs::root::nsCSSValueSharedList> ) { - use gecko_bindings::sugar::refptr::RefPtr; + use crate::gecko_bindings::sugar::refptr::RefPtr; unsafe { output.clear() }; @@ -1156,9 +1156,9 @@ pub fn convert_transform( fn clone_single_transform_function( gecko_value: &structs::nsCSSValue ) -> values::computed::TransformOperation { - use values::computed::{Length, Percentage, TransformOperation}; - use values::generics::transform::{Matrix, Matrix3D}; - use values::generics::transform::Transform; + use crate::values::computed::{Length, Percentage, TransformOperation}; + use crate::values::generics::transform::{Matrix, Matrix3D}; + use crate::values::generics::transform::Transform; let convert_shared_list_to_operations = |value: &structs::nsCSSValue| -> Vec<TransformOperation> { @@ -1190,7 +1190,7 @@ fn clone_single_transform_function( pub fn clone_transform_from_list( list: Option< &structs::root::nsCSSValueList> ) -> values::computed::Transform { - use values::generics::transform::Transform; + use crate::values::generics::transform::Transform; let result = match list { Some(list) => { @@ -1213,7 +1213,7 @@ pub fn clone_transform_from_list( <%def name="impl_transform(ident, gecko_ffi_name)"> #[allow(non_snake_case)] pub fn set_${ident}(&mut self, other: values::computed::Transform) { - use gecko_properties::convert_transform; + use crate::gecko_properties::convert_transform; if other.0.is_empty() { unsafe { self.gecko.${gecko_ffi_name}.clear(); @@ -1235,8 +1235,8 @@ pub fn clone_transform_from_list( #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> values::computed::Transform { - use gecko_properties::clone_transform_from_list; - use values::generics::transform::Transform; + use crate::gecko_properties::clone_transform_from_list; + use crate::values::generics::transform::Transform; if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() { return Transform(vec!()); @@ -1279,7 +1279,7 @@ pub fn clone_transform_from_list( #[allow(non_snake_case)] pub fn clone_${ident}(&self) -> values::computed::TransformOrigin { - use values::computed::{Length, LengthOrPercentage, TransformOrigin}; + use crate::values::computed::{Length, LengthOrPercentage, TransformOrigin}; TransformOrigin { horizontal: LengthOrPercentage::from_gecko_style_coord(&self.gecko.${gecko_ffi_name}[0]) .expect("clone for LengthOrPercentage failed"), @@ -1375,7 +1375,7 @@ impl Clone for ${style_struct.gecko_struct_name} { } pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use values::generics::font::{FontSettings, FontTag, ${tag_type}}; + use crate::values::generics::font::{FontSettings, FontTag, ${tag_type}}; FontSettings( self.gecko.mFont.${gecko_ffi_name}.iter().map(|gecko_font_setting| { @@ -1601,7 +1601,7 @@ fn static_assert() { } pub fn clone_border_image_source(&self) -> longhands::border_image_source::computed_value::T { - use values::None_; + use crate::values::None_; match unsafe { self.gecko.mBorderImageSource.into_image() } { Some(image) => Either::Second(image), @@ -1616,8 +1616,8 @@ fn static_assert() { %> pub fn set_border_image_repeat(&mut self, v: longhands::border_image_repeat::computed_value::T) { - use values::specified::border::BorderImageRepeatKeyword; - use gecko_bindings::structs::StyleBorderImageRepeat; + use crate::values::specified::border::BorderImageRepeatKeyword; + use crate::gecko_bindings::structs::StyleBorderImageRepeat; % for i, side in enumerate(["H", "V"]): self.gecko.mBorderImageRepeat${side} = match v.${i} { @@ -1638,8 +1638,8 @@ fn static_assert() { } pub fn clone_border_image_repeat(&self) -> longhands::border_image_repeat::computed_value::T { - use values::specified::border::BorderImageRepeatKeyword; - use gecko_bindings::structs::StyleBorderImageRepeat; + use crate::values::specified::border::BorderImageRepeatKeyword; + use crate::gecko_bindings::structs::StyleBorderImageRepeat; % for side in ["H", "V"]: let servo_${side.lower()} = match self.gecko.mBorderImageRepeat${side} { @@ -1654,7 +1654,7 @@ fn static_assert() { <% impl_style_sides("border_image_width") %> pub fn set_border_image_slice(&mut self, v: longhands::border_image_slice::computed_value::T) { - use gecko_bindings::structs::{NS_STYLE_BORDER_IMAGE_SLICE_NOFILL, NS_STYLE_BORDER_IMAGE_SLICE_FILL}; + use crate::gecko_bindings::structs::{NS_STYLE_BORDER_IMAGE_SLICE_NOFILL, NS_STYLE_BORDER_IMAGE_SLICE_FILL}; v.offsets.to_gecko_rect(&mut self.gecko.mBorderImageSlice); @@ -1671,9 +1671,9 @@ fn static_assert() { </%self:copy_sides_style_coord> pub fn clone_border_image_slice(&self) -> longhands::border_image_slice::computed_value::T { - use gecko_bindings::structs::NS_STYLE_BORDER_IMAGE_SLICE_FILL; - use values::computed::{BorderImageSlice, NumberOrPercentage}; - type NumberOrPercentageRect = ::values::generics::rect::Rect<NumberOrPercentage>; + use crate::gecko_bindings::structs::NS_STYLE_BORDER_IMAGE_SLICE_FILL; + use crate::values::computed::{BorderImageSlice, NumberOrPercentage}; + type NumberOrPercentageRect = crate::values::generics::rect::Rect<NumberOrPercentage>; BorderImageSlice { offsets: @@ -1726,7 +1726,7 @@ fn static_assert() { } pub fn copy_z_index_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleUnit; + use crate::gecko_bindings::structs::nsStyleUnit; // z-index is never a calc(). If it were, we'd be leaking here, so // assert that it isn't. debug_assert_ne!(self.gecko.mZIndex.unit(), nsStyleUnit::eStyleUnit_Calc); @@ -1762,7 +1762,7 @@ fn static_assert() { } pub fn set_computed_justify_items(&mut self, v: values::specified::JustifyItems) { - debug_assert_ne!(v.0, ::values::specified::align::AlignFlags::LEGACY); + debug_assert_ne!(v.0, crate::values::specified::align::AlignFlags::LEGACY); self.gecko.mJustifyItems = v.into(); } @@ -1795,7 +1795,7 @@ fn static_assert() { % for value in GRID_LINES: pub fn set_${value.name}(&mut self, v: longhands::${value.name}::computed_value::T) { - use gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine}; + use crate::gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine}; let ident = v.ident.as_ref().map_or(&[] as &[_], |ident| ident.0.as_slice()); self.gecko.${value.gecko}.mLineName.assign(ident); @@ -1818,7 +1818,7 @@ fn static_assert() { } pub fn clone_${value.name}(&self) -> longhands::${value.name}::computed_value::T { - use gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine}; + use crate::gecko_bindings::structs::{nsStyleGridLine_kMinLine, nsStyleGridLine_kMaxLine}; longhands::${value.name}::computed_value::T { is_span: self.gecko.${value.gecko}.mHasSpan, @@ -1858,18 +1858,18 @@ fn static_assert() { } pub fn clone_grid_auto_${kind}(&self) -> longhands::grid_auto_${kind}::computed_value::T { - ::values::generics::grid::TrackSize::from_gecko_style_coords(&self.gecko.mGridAuto${kind.title()}Min, + crate::values::generics::grid::TrackSize::from_gecko_style_coords(&self.gecko.mGridAuto${kind.title()}Min, &self.gecko.mGridAuto${kind.title()}Max) } pub fn set_grid_template_${kind}(&mut self, v: longhands::grid_template_${kind}::computed_value::T) { <% self_grid = "self.gecko.mGridTemplate%s" % kind.title() %> - use gecko_bindings::structs::{nsTArray, nsStyleGridLine_kMaxLine}; + use crate::gecko_bindings::structs::{nsTArray, nsStyleGridLine_kMaxLine}; use nsstring::nsStringRepr; use std::usize; - use values::CustomIdent; - use values::generics::grid::TrackListType::Auto; - use values::generics::grid::{GridTemplateComponent, RepeatCount}; + use crate::values::CustomIdent; + use crate::values::generics::grid::TrackListType::Auto; + use crate::values::generics::grid::{GridTemplateComponent, RepeatCount}; #[inline] fn set_line_names(servo_names: &[CustomIdent], gecko_names: &mut nsTArray<nsStringRepr>) { @@ -1991,11 +1991,11 @@ fn static_assert() { pub fn clone_grid_template_${kind}(&self) -> longhands::grid_template_${kind}::computed_value::T { <% self_grid = "self.gecko.mGridTemplate%s" % kind.title() %> - use gecko_bindings::structs::nsTArray; + use crate::gecko_bindings::structs::nsTArray; use nsstring::nsStringRepr; - use values::CustomIdent; - use values::generics::grid::{GridTemplateComponent, LineNameList, RepeatCount}; - use values::generics::grid::{TrackList, TrackListType, TrackListValue, TrackRepeat, TrackSize}; + use crate::values::CustomIdent; + use crate::values::generics::grid::{GridTemplateComponent, LineNameList, RepeatCount}; + use crate::values::generics::grid::{TrackList, TrackListType, TrackListValue, TrackRepeat, TrackSize}; let value = match unsafe { ${self_grid}.mPtr.as_ref() } { None => return GridTemplateComponent::None, @@ -2077,8 +2077,8 @@ fn static_assert() { ${impl_simple_type_with_conversion("grid_auto_flow")} pub fn set_grid_template_areas(&mut self, v: values::computed::position::GridTemplateAreas) { - use gecko_bindings::bindings::Gecko_NewGridTemplateAreasValue; - use gecko_bindings::sugar::refptr::UniqueRefPtr; + use crate::gecko_bindings::bindings::Gecko_NewGridTemplateAreasValue; + use crate::gecko_bindings::sugar::refptr::UniqueRefPtr; let v = match v { Either::First(areas) => areas, @@ -2118,8 +2118,8 @@ fn static_assert() { pub fn clone_grid_template_areas(&self) -> values::computed::position::GridTemplateAreas { use std::ops::Range; - use values::None_; - use values::specified::position::{NamedArea, TemplateAreas, TemplateAreasArc}; + use crate::values::None_; + use crate::values::specified::position::{NamedArea, TemplateAreas, TemplateAreasArc}; if self.gecko.mGridTemplateAreas.mRawPtr.is_null() { return Either::Second(None_); @@ -2276,8 +2276,8 @@ fn static_assert() { } pub fn clone_font_family(&self) -> longhands::font_family::computed_value::T { - use gecko_bindings::structs::FontFamilyType; - use values::computed::font::{FontFamily, SingleFontFamily, FontFamilyList}; + use crate::gecko_bindings::structs::FontFamilyType; + use crate::values::computed::font::{FontFamily, SingleFontFamily, FontFamilyList}; let fontlist = &self.gecko.mFont.fontlist; let shared_fontlist = unsafe { fontlist.mFontlist.mBasePtr.to_safe() }; @@ -2316,7 +2316,7 @@ fn static_assert() { } pub fn set_font_size(&mut self, v: FontSize) { - use values::generics::font::KeywordSize; + use crate::values::generics::font::KeywordSize; self.gecko.mSize = v.size().0; self.gecko.mScriptUnconstrainedSize = v.size().0; if let Some(info) = v.keyword_info { @@ -2530,7 +2530,7 @@ fn static_assert() { } pub fn clone_font_size(&self) -> FontSize { - use values::generics::font::{KeywordInfo, KeywordSize}; + use crate::values::generics::font::{KeywordInfo, KeywordSize}; let size = Au(self.gecko.mSize).into(); let kw = match self.gecko.mFontSizeKeyword as u32 { structs::NS_STYLE_FONT_SIZE_XXSMALL => KeywordSize::XXSmall, @@ -2581,9 +2581,9 @@ fn static_assert() { } ${impl_simple_copy('font_stretch', 'mFont.stretch')} pub fn clone_font_stretch(&self) -> longhands::font_stretch::computed_value::T { - use values::computed::font::FontStretch; - use values::computed::Percentage; - use values::generics::NonNegative; + use crate::values::computed::font::FontStretch; + use crate::values::computed::Percentage; + use crate::values::generics::NonNegative; let stretch = unsafe { bindings::Gecko_FontStretch_ToFloat(self.gecko.mFont.stretch) }; @@ -2593,7 +2593,7 @@ fn static_assert() { } pub fn set_font_style(&mut self, v: longhands::font_style::computed_value::T) { - use values::generics::font::FontStyle; + use crate::values::generics::font::FontStyle; let s = &mut self.gecko.mFont.style; unsafe { match v { @@ -2607,14 +2607,14 @@ fn static_assert() { } ${impl_simple_copy('font_style', 'mFont.style')} pub fn clone_font_style(&self) -> longhands::font_style::computed_value::T { - use values::computed::font::FontStyle; + use crate::values::computed::font::FontStyle; FontStyle::from_gecko(self.gecko.mFont.style) } ${impl_simple_type_with_conversion("font_synthesis", "mFont.synthesis")} pub fn set_font_size_adjust(&mut self, v: longhands::font_size_adjust::computed_value::T) { - use properties::longhands::font_size_adjust::computed_value::T; + use crate::properties::longhands::font_size_adjust::computed_value::T; match v { T::None => self.gecko.mFont.sizeAdjust = -1.0 as f32, T::Number(n) => self.gecko.mFont.sizeAdjust = n, @@ -2630,7 +2630,7 @@ fn static_assert() { } pub fn clone_font_size_adjust(&self) -> longhands::font_size_adjust::computed_value::T { - use properties::longhands::font_size_adjust::computed_value::T; + use crate::properties::longhands::font_size_adjust::computed_value::T; T::from_gecko_adjust(self.gecko.mFont.sizeAdjust) } @@ -2688,13 +2688,13 @@ fn static_assert() { pub fn set_font_variant_alternates(&mut self, v: values::computed::font::FontVariantAlternates, device: &Device) { - use gecko_bindings::bindings::{Gecko_ClearAlternateValues, Gecko_AppendAlternateValues}; - use gecko_bindings::bindings::Gecko_nsFont_ResetFontFeatureValuesLookup; - use gecko_bindings::bindings::Gecko_nsFont_SetFontFeatureValuesLookup; + use crate::gecko_bindings::bindings::{Gecko_ClearAlternateValues, Gecko_AppendAlternateValues}; + use crate::gecko_bindings::bindings::Gecko_nsFont_ResetFontFeatureValuesLookup; + use crate::gecko_bindings::bindings::Gecko_nsFont_SetFontFeatureValuesLookup; % for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split(): - use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()}; + use crate::gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()}; % endfor - use values::specified::font::VariantAlternates; + use crate::values::specified::font::VariantAlternates; unsafe { Gecko_ClearAlternateValues(&mut self.gecko.mFont, v.len()); @@ -2743,7 +2743,7 @@ fn static_assert() { #[allow(non_snake_case)] pub fn copy_font_variant_alternates_from(&mut self, other: &Self) { - use gecko_bindings::bindings::Gecko_CopyAlternateValuesFrom; + use crate::gecko_bindings::bindings::Gecko_CopyAlternateValuesFrom; self.gecko.mFont.variantAlternates = other.gecko.mFont.variantAlternates; unsafe { @@ -2757,11 +2757,11 @@ fn static_assert() { pub fn clone_font_variant_alternates(&self) -> values::computed::font::FontVariantAlternates { % for value in "normal swash stylistic ornaments annotation styleset character_variant historical".split(): - use gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()}; + use crate::gecko_bindings::structs::NS_FONT_VARIANT_ALTERNATES_${value.upper()}; % endfor - use values::specified::font::VariantAlternates; - use values::specified::font::VariantAlternatesList; - use values::CustomIdent; + use crate::values::specified::font::VariantAlternates; + use crate::values::specified::font::VariantAlternatesList; + use crate::values::CustomIdent; if self.gecko.mFont.variantAlternates == NS_FONT_VARIANT_ALTERNATES_NORMAL as u16 { return VariantAlternatesList(vec![].into_boxed_slice()); @@ -2888,7 +2888,7 @@ fn static_assert() { #[allow(non_snake_case)] pub fn ${type}_${ident}_at(&self, index: usize) -> longhands::${type}_${ident}::computed_value::SingleComputedValue { - use values::computed::Time; + use crate::values::computed::Time; Time::from_seconds(self.gecko.m${type.capitalize()}s[index].m${gecko_ffi_name} / 1000.) } ${impl_animation_or_transition_count(type, ident, gecko_ffi_name)} @@ -2952,7 +2952,7 @@ fn static_assert() { where I: IntoIterator<Item = longhands::animation_${ident}::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator + Clone { - use properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword; + use crate::properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword; let v = v.into_iter(); @@ -2975,7 +2975,7 @@ fn static_assert() { #[allow(non_snake_case)] pub fn animation_${ident}_at(&self, index: usize) -> longhands::animation_${ident}::computed_value::SingleComputedValue { - use properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword; + use crate::properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword; match self.gecko.mAnimations[index].m${gecko_ffi_name} ${keyword.maybe_cast("u32")} { % for value in keyword.gecko_values(): structs::${keyword.gecko_constant(value)} => Keyword::${to_camel_case(value)}, @@ -3007,7 +3007,7 @@ fn static_assert() { } pub fn clone_${ident}(&self) -> values::computed::${type} { - use values::generics::transform::${type}; + use crate::values::generics::transform::${type}; if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() { return ${type}::None; @@ -3086,7 +3086,7 @@ fn static_assert() { <% overflow_x = data.longhands_by_name["overflow-x"] %> pub fn set_overflow_y(&mut self, v: longhands::overflow_y::computed_value::T) { - use properties::longhands::overflow_x::computed_value::T as BaseType; + use crate::properties::longhands::overflow_x::computed_value::T as BaseType; // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts self.gecko.mOverflowY = match v { % for value in overflow_x.keyword.values_for('gecko'): @@ -3096,7 +3096,7 @@ fn static_assert() { } ${impl_simple_copy('overflow_y', 'mOverflowY')} pub fn clone_overflow_y(&self) -> longhands::overflow_y::computed_value::T { - use properties::longhands::overflow_x::computed_value::T as BaseType; + use crate::properties::longhands::overflow_x::computed_value::T as BaseType; // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts match self.gecko.mOverflowY as u32 { % for value in overflow_x.keyword.values_for('gecko'): @@ -3107,7 +3107,7 @@ fn static_assert() { } pub fn set_vertical_align(&mut self, v: longhands::vertical_align::computed_value::T) { - use values::generics::box_::VerticalAlign; + use crate::values::generics::box_::VerticalAlign; let value = match v { VerticalAlign::Baseline => structs::NS_STYLE_VERTICAL_ALIGN_BASELINE, VerticalAlign::Sub => structs::NS_STYLE_VERTICAL_ALIGN_SUB, @@ -3129,8 +3129,8 @@ fn static_assert() { } pub fn clone_vertical_align(&self) -> longhands::vertical_align::computed_value::T { - use values::computed::LengthOrPercentage; - use values::generics::box_::VerticalAlign; + use crate::values::computed::LengthOrPercentage; + use crate::values::generics::box_::VerticalAlign; let gecko = &self.gecko.mVerticalAlign; match gecko.as_value() { @@ -3153,7 +3153,7 @@ fn static_assert() { // "A conforming user agent may interpret the values 'left' and 'right' // as 'always'." - CSS2.1, section 13.3.1 pub fn set_page_break_${kind}(&mut self, v: longhands::page_break_${kind}::computed_value::T) { - use computed_values::page_break_${kind}::T; + use crate::computed_values::page_break_${kind}::T; let result = match v { T::Auto => false, @@ -3170,7 +3170,7 @@ fn static_assert() { // Temp fix for Bugzilla bug 24000. // See set_page_break_before/after for detail. pub fn clone_page_break_${kind}(&self) -> longhands::page_break_${kind}::computed_value::T { - use computed_values::page_break_${kind}::T; + use crate::computed_values::page_break_${kind}::T; if self.gecko.mBreak${kind.title()} { T::Always } else { T::Auto } } @@ -3220,9 +3220,9 @@ fn static_assert() { where I: IntoIterator<Item = longhands::transition_property::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator { - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties; - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; - use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; let v = v.into_iter(); @@ -3253,7 +3253,7 @@ fn static_assert() { /// Returns whether there are any transitions specified. pub fn specifies_transitions(&self) -> bool { - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_all_properties; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_all_properties; if self.gecko.mTransitionPropertyCount == 1 && self.gecko.mTransitions[0].mProperty == eCSSPropertyExtra_all_properties && self.transition_combined_duration_at(0) <= 0.0f32 { @@ -3265,9 +3265,9 @@ fn static_assert() { pub fn transition_property_at(&self, index: usize) -> longhands::transition_property::computed_value::SingleComputedValue { - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties; - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; - use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; let property = self.gecko.mTransitions[index].mProperty; if property == eCSSProperty_UNKNOWN { @@ -3299,8 +3299,8 @@ fn static_assert() { } pub fn copy_transition_property_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; - use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; + use crate::gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; self.gecko.mTransitions.ensure_len(other.gecko.mTransitions.len()); let count = other.gecko.mTransitionPropertyCount; @@ -3374,7 +3374,7 @@ fn static_assert() { } pub fn animation_name_at(&self, index: usize) -> longhands::animation_name::computed_value::SingleComputedValue { - use properties::longhands::animation_name::single_value::SpecifiedValue as AnimationName; + use crate::properties::longhands::animation_name::single_value::SpecifiedValue as AnimationName; let atom = self.gecko.mAnimations[index].mName.mRawPtr; if atom == atom!("").as_ptr() { @@ -3409,7 +3409,7 @@ fn static_assert() { I::IntoIter: ExactSizeIterator + Clone { use std::f32; - use values::generics::box_::AnimationIterationCount; + use crate::values::generics::box_::AnimationIterationCount; let v = v.into_iter(); @@ -3430,7 +3430,7 @@ fn static_assert() { &self, index: usize, ) -> values::computed::AnimationIterationCount { - use values::generics::box_::AnimationIterationCount; + use crate::values::generics::box_::AnimationIterationCount; if self.gecko.mAnimations[index].mIterationCount.is_infinite() { AnimationIterationCount::Infinite @@ -3472,8 +3472,8 @@ fn static_assert() { } pub fn clone_perspective_origin(&self) -> longhands::perspective_origin::computed_value::T { - use properties::longhands::perspective_origin::computed_value::T; - use values::computed::LengthOrPercentage; + use crate::properties::longhands::perspective_origin::computed_value::T; + use crate::values::computed::LengthOrPercentage; T { horizontal: LengthOrPercentage::from_gecko_style_coord(&self.gecko.mPerspectiveOrigin[0]) .expect("Expected length or percentage for horizontal value of perspective-origin"), @@ -3487,8 +3487,8 @@ fn static_assert() { ${impl_individual_transform('scale', 'Scale', 'mSpecifiedScale')} pub fn set_will_change(&mut self, v: longhands::will_change::computed_value::T) { - use gecko_bindings::bindings::{Gecko_AppendWillChange, Gecko_ClearWillChange}; - use properties::longhands::will_change::computed_value::T; + use crate::gecko_bindings::bindings::{Gecko_AppendWillChange, Gecko_ClearWillChange}; + use crate::properties::longhands::will_change::computed_value::T; match v { T::AnimateableFeatures { features, bits } => { @@ -3514,7 +3514,7 @@ fn static_assert() { } pub fn copy_will_change_from(&mut self, other: &Self) { - use gecko_bindings::bindings::Gecko_CopyWillChangeFrom; + use crate::gecko_bindings::bindings::Gecko_CopyWillChangeFrom; self.gecko.mWillChangeBitField = other.gecko.mWillChangeBitField; unsafe { @@ -3527,10 +3527,10 @@ fn static_assert() { } pub fn clone_will_change(&self) -> longhands::will_change::computed_value::T { - use properties::longhands::will_change::computed_value::T; - use gecko_bindings::structs::nsAtom; - use values::CustomIdent; - use values::specified::box_::WillChangeBits; + use crate::properties::longhands::will_change::computed_value::T; + use crate::gecko_bindings::structs::nsAtom; + use crate::values::CustomIdent; + use crate::values::specified::box_::WillChangeBits; if self.gecko.mWillChange.len() == 0 { return T::Auto @@ -3551,16 +3551,16 @@ fn static_assert() { <% impl_shape_source("shape_outside", "mShapeOutside") %> pub fn set_contain(&mut self, v: longhands::contain::computed_value::T) { - use gecko_bindings::structs::NS_STYLE_CONTAIN_NONE; - use gecko_bindings::structs::NS_STYLE_CONTAIN_STRICT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; - use gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE; - use gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; - use gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; - use properties::longhands::contain::SpecifiedValue; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_NONE; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STRICT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; + use crate::properties::longhands::contain::SpecifiedValue; if v.is_empty() { self.gecko.mContain = NS_STYLE_CONTAIN_NONE as u8; @@ -3594,15 +3594,15 @@ fn static_assert() { } pub fn clone_contain(&self) -> longhands::contain::computed_value::T { - use gecko_bindings::structs::NS_STYLE_CONTAIN_STRICT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; - use gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE; - use gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; - use gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; - use gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; - use properties::longhands::contain::{self, SpecifiedValue}; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STRICT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; + use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; + use crate::properties::longhands::contain::{self, SpecifiedValue}; let mut servo_flags = contain::computed_value::T::empty(); let gecko_flags = self.gecko.mContain; @@ -3646,10 +3646,10 @@ fn static_assert() { ${impl_simple_type_with_conversion("touch_action")} pub fn set_offset_path(&mut self, v: longhands::offset_path::computed_value::T) { - use gecko_bindings::bindings::{Gecko_NewStyleMotion, Gecko_SetStyleMotion}; - use gecko_bindings::structs::StyleShapeSourceType; - use values::generics::basic_shape::FillRule; - use values::specified::OffsetPath; + use crate::gecko_bindings::bindings::{Gecko_NewStyleMotion, Gecko_SetStyleMotion}; + use crate::gecko_bindings::structs::StyleShapeSourceType; + use crate::values::generics::basic_shape::FillRule; + use crate::values::specified::OffsetPath; let motion = unsafe { Gecko_NewStyleMotion().as_mut().unwrap() }; match v { @@ -3662,7 +3662,7 @@ fn static_assert() { } pub fn clone_offset_path(&self) -> longhands::offset_path::computed_value::T { - use values::specified::OffsetPath; + use crate::values::specified::OffsetPath; match unsafe { self.gecko.mMotion.mPtr.as_ref() } { None => OffsetPath::none(), Some(v) => (&v.mOffsetPath).into() @@ -3670,7 +3670,7 @@ fn static_assert() { } pub fn copy_offset_path_from(&mut self, other: &Self) { - use gecko_bindings::bindings::Gecko_CopyStyleMotions; + use crate::gecko_bindings::bindings::Gecko_CopyStyleMotions; unsafe { Gecko_CopyStyleMotions(&mut self.gecko.mMotion, other.gecko.mMotion.mPtr) }; } @@ -3690,7 +3690,7 @@ fn static_assert() { where I: IntoIterator<Item=longhands::${shorthand}_${name}::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let v = v.into_iter(); unsafe { @@ -3709,7 +3709,7 @@ fn static_assert() { <%def name="copy_simple_image_array_property(name, shorthand, layers_field_name, field_name)"> pub fn copy_${shorthand}_${name}_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let count = other.gecko.${layers_field_name}.${field_name}Count; unsafe { @@ -3746,8 +3746,8 @@ fn static_assert() { I: IntoIterator<Item=longhands::${ident}::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator, { - use properties::longhands::${ident}::single_value::computed_value::T as Keyword; - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::properties::longhands::${ident}::single_value::computed_value::T as Keyword; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let v = v.into_iter(); @@ -3770,7 +3770,7 @@ fn static_assert() { } pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { - use properties::longhands::${ident}::single_value::computed_value::T as Keyword; + use crate::properties::longhands::${ident}::single_value::computed_value::T as Keyword; % if keyword.needs_cast(): % for value in keyword.values_for('gecko'): @@ -3812,9 +3812,9 @@ fn static_assert() { %> <%self:simple_image_array_property name="repeat" shorthand="${shorthand}" field_name="mRepeat"> - use values::specified::background::BackgroundRepeatKeyword; - use gecko_bindings::structs::nsStyleImageLayers_Repeat; - use gecko_bindings::structs::StyleImageLayerRepeat; + use crate::values::specified::background::BackgroundRepeatKeyword; + use crate::gecko_bindings::structs::nsStyleImageLayers_Repeat; + use crate::gecko_bindings::structs::StyleImageLayerRepeat; fn to_ns(repeat: BackgroundRepeatKeyword) -> StyleImageLayerRepeat { match repeat { @@ -3834,9 +3834,9 @@ fn static_assert() { </%self:simple_image_array_property> pub fn clone_${shorthand}_repeat(&self) -> longhands::${shorthand}_repeat::computed_value::T { - use properties::longhands::${shorthand}_repeat::single_value::computed_value::T; - use values::specified::background::BackgroundRepeatKeyword; - use gecko_bindings::structs::StyleImageLayerRepeat; + use crate::properties::longhands::${shorthand}_repeat::single_value::computed_value::T; + use crate::values::specified::background::BackgroundRepeatKeyword; + use crate::gecko_bindings::structs::StyleImageLayerRepeat; fn to_servo(repeat: StyleImageLayerRepeat) -> BackgroundRepeatKeyword { match repeat { @@ -3862,7 +3862,7 @@ fn static_assert() { % for orientation in ["x", "y"]: pub fn copy_${shorthand}_position_${orientation}_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let count = other.gecko.${image_layers_field}.mPosition${orientation.upper()}Count; @@ -3901,7 +3901,7 @@ fn static_assert() { ::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let v = v.into_iter(); @@ -3919,10 +3919,10 @@ fn static_assert() { % endfor <%self:simple_image_array_property name="size" shorthand="${shorthand}" field_name="mSize"> - use gecko_bindings::structs::nsStyleImageLayers_Size_Dimension; - use gecko_bindings::structs::nsStyleImageLayers_Size_DimensionType; - use gecko_bindings::structs::{nsStyleCoord_CalcValue, nsStyleImageLayers_Size}; - use values::generics::background::BackgroundSize; + use crate::gecko_bindings::structs::nsStyleImageLayers_Size_Dimension; + use crate::gecko_bindings::structs::nsStyleImageLayers_Size_DimensionType; + use crate::gecko_bindings::structs::{nsStyleCoord_CalcValue, nsStyleImageLayers_Size}; + use crate::values::generics::background::BackgroundSize; let mut width = nsStyleCoord_CalcValue::new(); let mut height = nsStyleCoord_CalcValue::new(); @@ -3964,10 +3964,10 @@ fn static_assert() { </%self:simple_image_array_property> pub fn clone_${shorthand}_size(&self) -> longhands::${shorthand}_size::computed_value::T { - use gecko_bindings::structs::nsStyleCoord_CalcValue as CalcValue; - use gecko_bindings::structs::nsStyleImageLayers_Size_DimensionType as DimensionType; - use values::computed::NonNegativeLengthOrPercentageOrAuto; - use values::generics::background::BackgroundSize; + use crate::gecko_bindings::structs::nsStyleCoord_CalcValue as CalcValue; + use crate::gecko_bindings::structs::nsStyleImageLayers_Size_DimensionType as DimensionType; + use crate::values::computed::NonNegativeLengthOrPercentageOrAuto; + use crate::values::generics::background::BackgroundSize; fn to_servo(value: CalcValue, ty: u8) -> NonNegativeLengthOrPercentageOrAuto { if ty == DimensionType::eAuto as u8 { @@ -3997,7 +3997,7 @@ fn static_assert() { } pub fn copy_${shorthand}_image_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; unsafe { let count = other.gecko.${image_layers_field}.mImageCount; Gecko_EnsureImageLayersLength(&mut self.gecko.${image_layers_field}, @@ -4022,7 +4022,7 @@ fn static_assert() { where I: IntoIterator<Item = longhands::${shorthand}_image::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator { - use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; + use crate::gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType; let images = images.into_iter(); @@ -4047,7 +4047,7 @@ fn static_assert() { } pub fn clone_${shorthand}_image(&self) -> longhands::${shorthand}_image::computed_value::T { - use values::None_; + use crate::values::None_; longhands::${shorthand}_image::computed_value::List( self.gecko.${image_layers_field}.mLayers.iter() @@ -4070,7 +4070,7 @@ fn static_assert() { fill_fields += " mMaskMode mComposite" %> pub fn fill_arrays(&mut self) { - use gecko_bindings::bindings::Gecko_FillAllImageLayers; + use crate::gecko_bindings::bindings::Gecko_FillAllImageLayers; use std::cmp; let mut max_len = 1; % for member in fill_fields.split(): @@ -4132,7 +4132,7 @@ fn static_assert() { } pub fn clone_list_style_image(&self) -> longhands::list_style_image::computed_value::T { - use values::computed::url::ComputedImageUrl; + use crate::values::computed::url::ComputedImageUrl; if self.gecko.mListStyleImage.mRawPtr.is_null() { return UrlOrNone::None; @@ -4145,7 +4145,7 @@ fn static_assert() { } pub fn set_list_style_type(&mut self, v: longhands::list_style_type::computed_value::T, device: &Device) { - use gecko_bindings::bindings::Gecko_SetCounterStyleToString; + use crate::gecko_bindings::bindings::Gecko_SetCounterStyleToString; use nsstring::{nsACString, nsCStr}; use self::longhands::list_style_type::computed_value::T; match v { @@ -4169,8 +4169,8 @@ fn static_assert() { pub fn clone_list_style_type(&self) -> longhands::list_style_type::computed_value::T { use self::longhands::list_style_type::computed_value::T; - use values::Either; - use values::generics::CounterStyleOrNone; + use crate::values::Either; + use crate::values::generics::CounterStyleOrNone; let result = CounterStyleOrNone::from_gecko_value(&self.gecko.mCounterStyle); match result { @@ -4203,7 +4203,7 @@ fn static_assert() { #[allow(non_snake_case)] pub fn set__moz_image_region(&mut self, v: longhands::_moz_image_region::computed_value::T) { - use values::Either; + use crate::values::Either; match v { Either::Second(_auto) => { @@ -4229,8 +4229,8 @@ fn static_assert() { #[allow(non_snake_case)] pub fn clone__moz_image_region(&self) -> longhands::_moz_image_region::computed_value::T { - use values::{Auto, Either}; - use values::computed::ClipRect; + use crate::values::{Auto, Either}; + use crate::values::computed::ClipRect; // There is no ideal way to detect auto type for structs::nsRect and its components, so // if all components are zero, we use Auto. @@ -4296,13 +4296,13 @@ fn static_assert() { } pub fn set_clip(&mut self, v: longhands::clip::computed_value::T) { - use gecko_bindings::structs::NS_STYLE_CLIP_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_RECT; - use gecko_bindings::structs::NS_STYLE_CLIP_LEFT_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_TOP_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_RIGHT_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_BOTTOM_AUTO; - use values::Either; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_RECT; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_LEFT_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_TOP_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_RIGHT_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_BOTTOM_AUTO; + use crate::values::Either; match v { Either::First(rect) => { @@ -4355,13 +4355,13 @@ fn static_assert() { } pub fn clone_clip(&self) -> longhands::clip::computed_value::T { - use gecko_bindings::structs::NS_STYLE_CLIP_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_BOTTOM_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_LEFT_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_RIGHT_AUTO; - use gecko_bindings::structs::NS_STYLE_CLIP_TOP_AUTO; - use values::computed::{ClipRect, ClipRectOrAuto}; - use values::Either; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_BOTTOM_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_LEFT_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_RIGHT_AUTO; + use crate::gecko_bindings::structs::NS_STYLE_CLIP_TOP_AUTO; + use crate::values::computed::{ClipRect, ClipRectOrAuto}; + use crate::values::Either; if self.gecko.mClipFlags == NS_STYLE_CLIP_AUTO as u8 { ClipRectOrAuto::auto() @@ -4412,19 +4412,19 @@ fn static_assert() { I: IntoIterator<Item = Filter>, I::IntoIter: ExactSizeIterator, { - use values::generics::effects::Filter::*; - use gecko_bindings::structs::nsCSSShadowArray; - use gecko_bindings::structs::nsStyleFilter; - use gecko_bindings::structs::NS_STYLE_FILTER_BLUR; - use gecko_bindings::structs::NS_STYLE_FILTER_BRIGHTNESS; - use gecko_bindings::structs::NS_STYLE_FILTER_CONTRAST; - use gecko_bindings::structs::NS_STYLE_FILTER_GRAYSCALE; - use gecko_bindings::structs::NS_STYLE_FILTER_INVERT; - use gecko_bindings::structs::NS_STYLE_FILTER_OPACITY; - use gecko_bindings::structs::NS_STYLE_FILTER_SATURATE; - use gecko_bindings::structs::NS_STYLE_FILTER_SEPIA; - use gecko_bindings::structs::NS_STYLE_FILTER_HUE_ROTATE; - use gecko_bindings::structs::NS_STYLE_FILTER_DROP_SHADOW; + use crate::values::generics::effects::Filter::*; + use crate::gecko_bindings::structs::nsCSSShadowArray; + use crate::gecko_bindings::structs::nsStyleFilter; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_BLUR; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_BRIGHTNESS; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_CONTRAST; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_GRAYSCALE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_INVERT; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_OPACITY; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_SATURATE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_SEPIA; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_HUE_ROTATE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_DROP_SHADOW; fn fill_filter(m_type: u32, value: CoordDataValue, gecko_filter: &mut nsStyleFilter){ gecko_filter.mType = m_type; @@ -4488,19 +4488,19 @@ fn static_assert() { } pub fn clone_filter(&self) -> longhands::filter::computed_value::T { - use values::generics::effects::Filter; - use values::computed::url::ComputedUrl; - use gecko_bindings::structs::NS_STYLE_FILTER_BLUR; - use gecko_bindings::structs::NS_STYLE_FILTER_BRIGHTNESS; - use gecko_bindings::structs::NS_STYLE_FILTER_CONTRAST; - use gecko_bindings::structs::NS_STYLE_FILTER_GRAYSCALE; - use gecko_bindings::structs::NS_STYLE_FILTER_INVERT; - use gecko_bindings::structs::NS_STYLE_FILTER_OPACITY; - use gecko_bindings::structs::NS_STYLE_FILTER_SATURATE; - use gecko_bindings::structs::NS_STYLE_FILTER_SEPIA; - use gecko_bindings::structs::NS_STYLE_FILTER_HUE_ROTATE; - use gecko_bindings::structs::NS_STYLE_FILTER_DROP_SHADOW; - use gecko_bindings::structs::NS_STYLE_FILTER_URL; + use crate::values::generics::effects::Filter; + use crate::values::computed::url::ComputedUrl; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_BLUR; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_BRIGHTNESS; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_CONTRAST; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_GRAYSCALE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_INVERT; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_OPACITY; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_SATURATE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_SEPIA; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_HUE_ROTATE; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_DROP_SHADOW; + use crate::gecko_bindings::structs::NS_STYLE_FILTER_URL; let mut filters = Vec::new(); for filter in self.gecko.mFilters.iter(){ @@ -4605,7 +4605,7 @@ fn static_assert() { } pub fn set_line_height(&mut self, v: longhands::line_height::computed_value::T) { - use values::generics::text::LineHeight; + use crate::values::generics::text::LineHeight; // FIXME: Align binary representations and ditch |match| for cast + static_asserts let en = match v { LineHeight::Normal => CoordDataValue::Normal, @@ -4618,7 +4618,7 @@ fn static_assert() { } pub fn clone_line_height(&self) -> longhands::line_height::computed_value::T { - use values::generics::text::LineHeight; + use crate::values::generics::text::LineHeight; return match self.gecko.mLineHeight.as_value() { CoordDataValue::Normal => LineHeight::Normal, CoordDataValue::Coord(coord) => LineHeight::Length(Au(coord).into()), @@ -4632,7 +4632,7 @@ fn static_assert() { <%call expr="impl_coord_copy('line_height', 'mLineHeight')"></%call> pub fn set_letter_spacing(&mut self, v: longhands::letter_spacing::computed_value::T) { - use values::generics::text::Spacing; + use crate::values::generics::text::Spacing; match v { Spacing::Value(value) => self.gecko.mLetterSpacing.set(value), Spacing::Normal => self.gecko.mLetterSpacing.set_value(CoordDataValue::Normal) @@ -4640,8 +4640,8 @@ fn static_assert() { } pub fn clone_letter_spacing(&self) -> longhands::letter_spacing::computed_value::T { - use values::computed::Length; - use values::generics::text::Spacing; + use crate::values::computed::Length; + use crate::values::generics::text::Spacing; debug_assert!( matches!(self.gecko.mLetterSpacing.as_value(), CoordDataValue::Normal | @@ -4653,7 +4653,7 @@ fn static_assert() { <%call expr="impl_coord_copy('letter_spacing', 'mLetterSpacing')"></%call> pub fn set_word_spacing(&mut self, v: longhands::word_spacing::computed_value::T) { - use values::generics::text::Spacing; + use crate::values::generics::text::Spacing; match v { Spacing::Value(lop) => self.gecko.mWordSpacing.set(lop), // https://drafts.csswg.org/css-text-3/#valdef-word-spacing-normal @@ -4662,8 +4662,8 @@ fn static_assert() { } pub fn clone_word_spacing(&self) -> longhands::word_spacing::computed_value::T { - use values::computed::LengthOrPercentage; - use values::generics::text::Spacing; + use crate::values::computed::LengthOrPercentage; + use crate::values::generics::text::Spacing; debug_assert!( matches!(self.gecko.mWordSpacing.as_value(), CoordDataValue::Normal | @@ -4686,8 +4686,8 @@ fn static_assert() { ${impl_simple_type_with_conversion("text_emphasis_position")} pub fn set_text_emphasis_style(&mut self, v: values::computed::TextEmphasisStyle) { - use values::computed::TextEmphasisStyle; - use values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword}; + use crate::values::computed::TextEmphasisStyle; + use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword}; self.clear_text_emphasis_style_if_string(); let (te, s) = match v { @@ -4729,9 +4729,9 @@ fn static_assert() { } pub fn clone_text_emphasis_style(&self) -> values::computed::TextEmphasisStyle { - use values::computed::TextEmphasisStyle; - use values::computed::text::TextEmphasisKeywordValue; - use values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword}; + use crate::values::computed::TextEmphasisStyle; + use crate::values::computed::text::TextEmphasisKeywordValue; + use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword}; if self.gecko.mTextEmphasisStyle == structs::NS_STYLE_TEXT_EMPHASIS_STYLE_NONE as u8 { return TextEmphasisStyle::None; @@ -4792,7 +4792,7 @@ fn static_assert() { ${impl_simple_type_with_conversion("text_decoration_line")} fn clear_overflow_sides_if_string(&mut self) { - use gecko_bindings::structs::nsStyleTextOverflowSide; + use crate::gecko_bindings::structs::nsStyleTextOverflowSide; fn clear_if_string(side: &mut nsStyleTextOverflowSide) { if side.mType == structs::NS_STYLE_TEXT_OVERFLOW_STRING as u8 { side.mString.truncate(); @@ -4804,8 +4804,8 @@ fn static_assert() { } pub fn set_text_overflow(&mut self, v: longhands::text_overflow::computed_value::T) { - use gecko_bindings::structs::nsStyleTextOverflowSide; - use values::specified::text::TextOverflowSide; + use crate::gecko_bindings::structs::nsStyleTextOverflowSide; + use crate::values::specified::text::TextOverflowSide; fn set(side: &mut nsStyleTextOverflowSide, value: &TextOverflowSide) { let ty = match *value { @@ -4827,7 +4827,7 @@ fn static_assert() { } pub fn copy_text_overflow_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleTextOverflowSide; + use crate::gecko_bindings::structs::nsStyleTextOverflowSide; fn set(side: &mut nsStyleTextOverflowSide, other: &nsStyleTextOverflowSide) { if other.mType == structs::NS_STYLE_TEXT_OVERFLOW_STRING as u8 { side.mString.assign(&*other.mString) @@ -4845,8 +4845,8 @@ fn static_assert() { } pub fn clone_text_overflow(&self) -> longhands::text_overflow::computed_value::T { - use gecko_bindings::structs::nsStyleTextOverflowSide; - use values::specified::text::TextOverflowSide; + use crate::gecko_bindings::structs::nsStyleTextOverflowSide; + use crate::values::specified::text::TextOverflowSide; fn to_servo(side: &nsStyleTextOverflowSide) -> TextOverflowSide { match side.mType as u32 { @@ -4866,7 +4866,7 @@ fn static_assert() { } pub fn set_initial_letter(&mut self, v: longhands::initial_letter::computed_value::T) { - use values::generics::text::InitialLetter; + use crate::values::generics::text::InitialLetter; match v { InitialLetter::Normal => { self.gecko.mInitialLetterSize = 0.; @@ -4893,7 +4893,7 @@ fn static_assert() { } pub fn clone_initial_letter(&self) -> longhands::initial_letter::computed_value::T { - use values::generics::text::InitialLetter; + use crate::values::generics::text::InitialLetter; if self.gecko.mInitialLetterSize == 0. && self.gecko.mInitialLetterSink == 0 { InitialLetter::Normal @@ -4926,8 +4926,8 @@ fn set_style_svg_path( servo_path: &values::specified::svg_path::SVGPathData, fill: values::generics::basic_shape::FillRule, ) { - use gecko_bindings::bindings::Gecko_NewStyleSVGPath; - use gecko_bindings::structs::StyleShapeSourceType; + use crate::gecko_bindings::bindings::Gecko_NewStyleSVGPath; + use crate::gecko_bindings::structs::StyleShapeSourceType; // Setup type. shape_source.mType = StyleShapeSourceType::Path; @@ -4946,12 +4946,12 @@ fn set_style_svg_path( <%def name="impl_shape_source(ident, gecko_ffi_name)"> pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { - use gecko_bindings::bindings::{Gecko_NewBasicShape, Gecko_DestroyShapeSource}; - use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleShapeSourceType}; - use gecko_bindings::structs::{StyleGeometryBox, StyleShapeSource}; - use gecko::conversions::basic_shape::set_corners_from_radius; - use gecko::values::GeckoStyleCoordConvertible; - use values::generics::basic_shape::{BasicShape, ShapeSource}; + use crate::gecko_bindings::bindings::{Gecko_NewBasicShape, Gecko_DestroyShapeSource}; + use crate::gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleShapeSourceType}; + use crate::gecko_bindings::structs::{StyleGeometryBox, StyleShapeSource}; + use crate::gecko::conversions::basic_shape::set_corners_from_radius; + use crate::gecko::values::GeckoStyleCoordConvertible; + use crate::values::generics::basic_shape::{BasicShape, ShapeSource}; let ref mut ${ident} = self.gecko.${gecko_ffi_name}; @@ -5063,7 +5063,7 @@ fn set_style_svg_path( } pub fn copy_${ident}_from(&mut self, other: &Self) { - use gecko_bindings::bindings::Gecko_CopyShapeSourceFrom; + use crate::gecko_bindings::bindings::Gecko_CopyShapeSourceFrom; unsafe { Gecko_CopyShapeSourceFrom(&mut self.gecko.${gecko_ffi_name}, &other.gecko.${gecko_ffi_name}); } @@ -5097,13 +5097,13 @@ clip-path ${impl_simple_copy('paint_order', 'mPaintOrder')} pub fn clone_paint_order(&self) -> longhands::paint_order::computed_value::T { - use properties::longhands::paint_order::computed_value::T; + use crate::properties::longhands::paint_order::computed_value::T; T(self.gecko.mPaintOrder) } pub fn set_stroke_dasharray(&mut self, v: longhands::stroke_dasharray::computed_value::T) { - use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; - use values::generics::svg::{SVGStrokeDashArray, SvgLengthOrPercentageOrNumber}; + use crate::gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; + use crate::values::generics::svg::{SVGStrokeDashArray, SvgLengthOrPercentageOrNumber}; match v { SVGStrokeDashArray::Values(v) => { @@ -5131,7 +5131,7 @@ clip-path } pub fn copy_stroke_dasharray_from(&mut self, other: &Self) { - use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; + use crate::gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; unsafe { bindings::Gecko_nsStyleSVG_CopyDashArray(&mut self.gecko, &other.gecko); } @@ -5145,9 +5145,9 @@ clip-path } pub fn clone_stroke_dasharray(&self) -> longhands::stroke_dasharray::computed_value::T { - use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; - use values::computed::LengthOrPercentage; - use values::generics::svg::{SVGStrokeDashArray, SvgLengthOrPercentageOrNumber}; + use crate::gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; + use crate::values::computed::LengthOrPercentage; + use crate::values::generics::svg::{SVGStrokeDashArray, SvgLengthOrPercentageOrNumber}; if self.gecko.mContextFlags & CONTEXT_VALUE != 0 { debug_assert_eq!(self.gecko.mStrokeDasharray.len(), 0); @@ -5329,8 +5329,8 @@ clip-path } pub fn clone_cursor(&self) -> longhands::cursor::computed_value::T { - use values::computed::ui::CursorImage; - use values::computed::url::ComputedImageUrl; + use crate::values::computed::ui::CursorImage; + use crate::values::computed::url::ComputedImageUrl; use style_traits::cursor::CursorKind; let keyword = match self.gecko.mCursor as u32 { @@ -5393,8 +5393,8 @@ clip-path } pub fn set_scrollbar_color(&mut self, v: longhands::scrollbar_color::computed_value::T) { - use gecko_bindings::structs::StyleComplexColor; - use values::generics::ui::ScrollbarColor; + use crate::gecko_bindings::structs::StyleComplexColor; + use crate::values::generics::ui::ScrollbarColor; match v { ScrollbarColor::Auto => { self.gecko.mScrollbarFaceColor = StyleComplexColor::auto(); @@ -5417,8 +5417,8 @@ clip-path } pub fn clone_scrollbar_color(&self) -> longhands::scrollbar_color::computed_value::T { - use gecko_bindings::structs::StyleComplexColor_Tag as Tag; - use values::generics::ui::ScrollbarColor; + use crate::gecko_bindings::structs::StyleComplexColor_Tag as Tag; + use crate::values::generics::ui::ScrollbarColor; debug_assert!( (self.gecko.mScrollbarFaceColor.mTag == Tag::eAuto) == (self.gecko.mScrollbarTrackColor.mTag == Tag::eAuto), @@ -5440,7 +5440,7 @@ clip-path #[allow(unused_unsafe)] pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) { - use gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount}; + use crate::gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount}; self.gecko.mColumnCount = match v { ColumnCount::Integer(integer) => { @@ -5453,7 +5453,7 @@ clip-path ${impl_simple_copy('column_count', 'mColumnCount')} pub fn clone_column_count(&self) -> longhands::column_count::computed_value::T { - use gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount}; + use crate::gecko_bindings::structs::{nsStyleColumn_kColumnCountAuto, nsStyleColumn_kMaxColumnCount}; if self.gecko.mColumnCount != nsStyleColumn_kColumnCountAuto { debug_assert!(self.gecko.mColumnCount >= 1 && self.gecko.mColumnCount <= nsStyleColumn_kMaxColumnCount); @@ -5474,13 +5474,13 @@ clip-path } pub fn set_content(&mut self, v: longhands::content::computed_value::T, device: &Device) { - use values::CustomIdent; - use values::generics::counters::{Content, ContentItem}; - use values::generics::CounterStyleOrNone; - use gecko_bindings::structs::nsStyleContentData; - use gecko_bindings::structs::nsStyleContentAttr; - use gecko_bindings::structs::StyleContentType; - use gecko_bindings::bindings::Gecko_ClearAndResizeStyleContents; + use crate::values::CustomIdent; + use crate::values::generics::counters::{Content, ContentItem}; + use crate::values::generics::CounterStyleOrNone; + use crate::gecko_bindings::structs::nsStyleContentData; + use crate::gecko_bindings::structs::nsStyleContentAttr; + use crate::gecko_bindings::structs::StyleContentType; + use crate::gecko_bindings::bindings::Gecko_ClearAndResizeStyleContents; // Converts a string as utf16, and returns an owned, zero-terminated raw buffer. fn as_utf16_and_forget(s: &str) -> *mut u16 { @@ -5612,7 +5612,7 @@ clip-path } pub fn copy_content_from(&mut self, other: &Self) { - use gecko_bindings::bindings::Gecko_CopyStyleContentsFrom; + use crate::gecko_bindings::bindings::Gecko_CopyStyleContentsFrom; unsafe { Gecko_CopyStyleContentsFrom(&mut self.gecko, &other.gecko) } @@ -5624,13 +5624,13 @@ clip-path pub fn clone_content(&self) -> longhands::content::computed_value::T { use {Atom, Namespace}; - use gecko::conversions::string_from_chars_pointer; - use gecko_bindings::structs::StyleContentType; - use values::generics::counters::{Content, ContentItem}; - use values::computed::url::ComputedImageUrl; - use values::{CustomIdent, Either}; - use values::generics::CounterStyleOrNone; - use values::specified::Attr; + use crate::gecko::conversions::string_from_chars_pointer; + use crate::gecko_bindings::structs::StyleContentType; + use crate::values::generics::counters::{Content, ContentItem}; + use crate::values::computed::url::ComputedImageUrl; + use crate::values::{CustomIdent, Either}; + use crate::values::generics::CounterStyleOrNone; + use crate::values::specified::Attr; if self.gecko.mContents.is_empty() { return Content::None; @@ -5727,8 +5727,8 @@ clip-path pub fn clone_counter_${counter_property.lower()}( &self ) -> longhands::counter_${counter_property.lower()}::computed_value::T { - use values::generics::counters::CounterPair; - use values::CustomIdent; + use crate::values::generics::counters::CounterPair; + use crate::values::CustomIdent; longhands::counter_${counter_property.lower()}::computed_value::T::new( self.gecko.m${counter_property}s.iter().map(|ref gecko_counter| { diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 5b04e0dc02e..c56fe6cd176 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -17,15 +17,15 @@ #[allow(unused_imports)] use cssparser::{Color as CSSParserColor, RGBA}; #[allow(unused_imports)] - use values::specified::AllowQuirks; + use crate::values::specified::AllowQuirks; #[allow(unused_imports)] use smallvec::SmallVec; - pub use values::specified::${type} as SpecifiedValue; + pub use crate::values::specified::${type} as SpecifiedValue; pub mod computed_value { % if computed_type: pub use ${computed_type} as T; % else: - pub use values::computed::${type} as T; + pub use crate::values::computed::${type} as T; % endif } % if initial_value: @@ -91,19 +91,19 @@ #[allow(unused_imports)] use cssparser::{Parser, BasicParseError}; #[allow(unused_imports)] - use parser::{Parse, ParserContext}; + use crate::parser::{Parse, ParserContext}; #[allow(unused_imports)] - use properties::ShorthandId; + use crate::properties::ShorthandId; #[allow(unused_imports)] use selectors::parser::SelectorParseErrorKind; #[allow(unused_imports)] use style_traits::{ParseError, StyleParseErrorKind}; #[allow(unused_imports)] - use values::computed::{Context, ToComputedValue}; + use crate::values::computed::{Context, ToComputedValue}; #[allow(unused_imports)] - use values::{computed, specified}; + use crate::values::{computed, specified}; #[allow(unused_imports)] - use values::{Auto, Either, None_, Normal}; + use crate::values::{Auto, Either, None_, Normal}; ${caller.body()} } @@ -116,7 +116,7 @@ % else: use smallvec::{IntoIter, SmallVec}; % endif - use values::computed::ComputedVecIter; + use crate::values::computed::ComputedVecIter; /// The generic type defining the value for this property. /// @@ -148,9 +148,9 @@ Sorry, this is stupid but needed for now. % endif - use properties::animated_properties::ListAnimation; - use values::animated::{Animate, ToAnimatedValue, ToAnimatedZero, Procedure}; - use values::distance::{SquaredDistance, ComputeSquaredDistance}; + use crate::properties::animated_properties::ListAnimation; + use crate::values::animated::{Animate, ToAnimatedValue, ToAnimatedZero, Procedure}; + use crate::values::distance::{SquaredDistance, ComputeSquaredDistance}; // FIXME(emilio): For some reason rust thinks that this alias is // unused, even though it's clearly used below? @@ -235,7 +235,7 @@ } % endif - ::style_traits::${separator}::parse(input, |parser| { + style_traits::${separator}::parse(input, |parser| { single_value::parse(context, parser) }).map(SpecifiedValue) } @@ -279,21 +279,21 @@ #[allow(unused_imports)] use cssparser::{Parser, BasicParseError, Token}; #[allow(unused_imports)] - use parser::{Parse, ParserContext}; + use crate::parser::{Parse, ParserContext}; #[allow(unused_imports)] - use properties::{UnparsedValue, ShorthandId}; + use crate::properties::{UnparsedValue, ShorthandId}; #[allow(unused_imports)] - use values::{Auto, Either, None_, Normal}; + use crate::values::{Auto, Either, None_, Normal}; #[allow(unused_imports)] - use error_reporting::ParseErrorReporter; + use crate::error_reporting::ParseErrorReporter; #[allow(unused_imports)] - use properties::longhands; + use crate::properties::longhands; #[allow(unused_imports)] - use properties::{LonghandId, LonghandIdSet}; + use crate::properties::{LonghandId, LonghandIdSet}; #[allow(unused_imports)] - use properties::{CSSWideKeyword, ComputedValues, PropertyDeclaration}; + use crate::properties::{CSSWideKeyword, ComputedValues, PropertyDeclaration}; #[allow(unused_imports)] - use properties::style_structs; + use crate::properties::style_structs; #[allow(unused_imports)] use selectors::parser::SelectorParseErrorKind; #[allow(unused_imports)] @@ -301,11 +301,11 @@ #[allow(unused_imports)] use style_traits::{ParseError, StyleParseErrorKind}; #[allow(unused_imports)] - use values::computed::{Context, ToComputedValue}; + use crate::values::computed::{Context, ToComputedValue}; #[allow(unused_imports)] - use values::{computed, generics, specified}; + use crate::values::{computed, generics, specified}; #[allow(unused_imports)] - use Atom; + use crate::Atom; ${caller.body()} #[allow(unused_variables)] pub fn cascade_property( @@ -428,7 +428,7 @@ keyword = keyword=Keyword(name, values, **keyword_kwargs) %> <%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)"> - use properties::longhands::system_font::SystemFont; + use crate::properties::longhands::system_font::SystemFont; pub mod computed_value { #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] @@ -511,7 +511,7 @@ /// /// Intended for use with presentation attributes, not style structs pub fn from_gecko_keyword(kw: u32) -> Self { - use gecko_bindings::structs; + use crate::gecko_bindings::structs; % for value in values: // We can't match on enum values if we're matching on a u32 const ${to_rust_ident(value).upper()}: ${const_type} @@ -535,7 +535,7 @@ /// Intended for use with presentation attributes, not style structs pub fn from_gecko_keyword(kw: ${kw_type}) -> Self { % for gecko_bit in bit_map.values(): - use gecko_bindings::structs::${gecko_bit_prefix}${gecko_bit}; + use crate::gecko_bindings::structs::${gecko_bit_prefix}${gecko_bit}; % endfor let mut bits = ${type}::empty(); @@ -549,7 +549,7 @@ pub fn to_gecko_keyword(self) -> ${kw_type} { % for gecko_bit in bit_map.values(): - use gecko_bindings::structs::${gecko_bit_prefix}${gecko_bit}; + use crate::gecko_bindings::structs::${gecko_bit_prefix}${gecko_bit}; % endfor let mut bits: ${kw_type} = 0; @@ -668,8 +668,8 @@ /// ${shorthand.spec} pub mod ${shorthand.ident} { use cssparser::Parser; - use parser::ParserContext; - use properties::{PropertyDeclaration, SourcePropertyDeclaration, MaybeBoxed, longhands}; + use crate::parser::ParserContext; + use crate::properties::{PropertyDeclaration, SourcePropertyDeclaration, MaybeBoxed, longhands}; #[allow(unused_imports)] use selectors::parser::SelectorParseErrorKind; #[allow(unused_imports)] @@ -772,7 +772,7 @@ input: &mut Parser<'i, 't>, ) -> Result<(), ParseError<'i>> { #[allow(unused_imports)] - use properties::{NonCustomPropertyId, LonghandId}; + use crate::properties::{NonCustomPropertyId, LonghandId}; input.parse_entirely(|input| parse_value(context, input)).map(|longhands| { % for sub_property in shorthand.sub_properties: % if sub_property.may_be_disabled_in(shorthand, product): @@ -798,9 +798,9 @@ <% sub_properties=' '.join(sub_property_pattern % side for side in PHYSICAL_SIDES) %> <%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)"> #[allow(unused_imports)] - use parser::Parse; - use values::generics::rect::Rect; - use values::specified; + use crate::parser::Parse; + use crate::values::generics::rect::Rect; + use crate::values::specified; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -852,7 +852,7 @@ return to_rust_ident(name.replace(side, phy_side).replace("inset-", "")) %> % if side is not None: - use logical_geometry::PhysicalSide; + use crate::logical_geometry::PhysicalSide; match wm.${to_rust_ident(side)}_physical_side() { % for phy_side in PHYSICAL_SIDES: PhysicalSide::${phy_side.title()} => { diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 2ab27687241..284e35877df 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -9,40 +9,40 @@ from itertools import groupby %> -#[cfg(feature = "gecko")] use gecko_bindings::structs::RawServoAnimationValueMap; -#[cfg(feature = "gecko")] use gecko_bindings::structs::RawGeckoGfxMatrix4x4; -#[cfg(feature = "gecko")] use gecko_bindings::structs::nsCSSPropertyID; -#[cfg(feature = "gecko")] use gecko_bindings::sugar::ownership::{HasFFI, HasSimpleFFI}; +#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::RawServoAnimationValueMap; +#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::RawGeckoGfxMatrix4x4; +#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::nsCSSPropertyID; +#[cfg(feature = "gecko")] use crate::gecko_bindings::sugar::ownership::{HasFFI, HasSimpleFFI}; use itertools::{EitherOrBoth, Itertools}; use num_traits::Zero; -use properties::{CSSWideKeyword, PropertyDeclaration}; -use properties::longhands; -use properties::longhands::visibility::computed_value::T as Visibility; -use properties::LonghandId; +use crate::properties::{CSSWideKeyword, PropertyDeclaration}; +use crate::properties::longhands; +use crate::properties::longhands::visibility::computed_value::T as Visibility; +use crate::properties::LonghandId; use servo_arc::Arc; use smallvec::SmallVec; use std::{cmp, ptr}; use std::mem::{self, ManuallyDrop}; -use hash::FxHashMap; +use crate::hash::FxHashMap; use super::ComputedValues; -use values::CSSFloat; -use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; -use values::animated::effects::Filter as AnimatedFilter; -#[cfg(feature = "gecko")] use values::computed::TransitionProperty; -use values::computed::Angle; -use values::computed::{ClipRect, Context}; -use values::computed::{Length, LengthOrPercentage}; -use values::computed::{Number, Percentage}; -use values::computed::ToComputedValue; -use values::computed::transform::{DirectionVector, Matrix, Matrix3D}; -use values::computed::transform::TransformOperation as ComputedTransformOperation; -use values::computed::transform::Transform as ComputedTransform; -use values::computed::transform::Rotate as ComputedRotate; -use values::computed::transform::Translate as ComputedTranslate; -use values::computed::transform::Scale as ComputedScale; -use values::generics::transform::{self, Rotate, Translate, Scale, Transform, TransformOperation}; -use values::distance::{ComputeSquaredDistance, SquaredDistance}; -use values::generics::effects::Filter; +use crate::values::CSSFloat; +use crate::values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; +use crate::values::animated::effects::Filter as AnimatedFilter; +#[cfg(feature = "gecko")] use crate::values::computed::TransitionProperty; +use crate::values::computed::Angle; +use crate::values::computed::{ClipRect, Context}; +use crate::values::computed::{Length, LengthOrPercentage}; +use crate::values::computed::{Number, Percentage}; +use crate::values::computed::ToComputedValue; +use crate::values::computed::transform::{DirectionVector, Matrix, Matrix3D}; +use crate::values::computed::transform::TransformOperation as ComputedTransformOperation; +use crate::values::computed::transform::Transform as ComputedTransform; +use crate::values::computed::transform::Rotate as ComputedRotate; +use crate::values::computed::transform::Translate as ComputedTranslate; +use crate::values::computed::transform::Scale as ComputedScale; +use crate::values::generics::transform::{self, Rotate, Translate, Scale, Transform, TransformOperation}; +use crate::values::distance::{ComputeSquaredDistance, SquaredDistance}; +use crate::values::generics::effects::Filter; use void::{self, Void}; /// Convert nsCSSPropertyID to TransitionProperty @@ -357,7 +357,7 @@ impl AnimationValue { /// "Uncompute" this animation value in order to be used inside the CSS /// cascade. pub fn uncompute(&self) -> PropertyDeclaration { - use properties::longhands; + use crate::properties::longhands; use self::AnimationValue::*; use super::PropertyDeclarationVariantRepr; @@ -401,7 +401,7 @@ impl AnimationValue { pub fn from_declaration( decl: &PropertyDeclaration, context: &mut Context, - extra_custom_properties: Option<<&Arc<::custom_properties::CustomPropertiesMap>>, + extra_custom_properties: Option<<&Arc<crate::custom_properties::CustomPropertiesMap>>, initial: &ComputedValues ) -> Option<Self> { use super::PropertyDeclarationVariantRepr; @@ -815,7 +815,7 @@ impl ToAnimatedZero for Visibility { impl Animate for ClipRect { #[inline] fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> { - use values::computed::Length; + use crate::values::computed::Length; let animate_component = |this: &Option<Length>, other: &Option<Length>| { match (this.animate(other, procedure)?, procedure) { (None, Procedure::Interpolate { .. }) => Ok(None), @@ -1070,8 +1070,8 @@ impl Animate for ComputedTransformOperation { &TransformOperation::Perspective(ref fd), &TransformOperation::Perspective(ref td), ) => { - use values::computed::CSSPixelLength; - use values::generics::transform::create_perspective_matrix; + use crate::values::computed::CSSPixelLength; + use crate::values::generics::transform::create_perspective_matrix; // From https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions: // @@ -1246,7 +1246,7 @@ impl ComputeSquaredDistance for MatrixDecomposed2D { #[inline] fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> { // Use Radian to compute the distance. - const RAD_PER_DEG: f64 = ::std::f64::consts::PI / 180.0; + const RAD_PER_DEG: f64 = std::f64::consts::PI / 180.0; let angle1 = self.angle as f64 * RAD_PER_DEG; let angle2 = other.angle as f64 * RAD_PER_DEG; Ok(self.translate.compute_squared_distance(&other.translate)? + diff --git a/components/style/properties/longhands/border.mako.rs b/components/style/properties/longhands/border.mako.rs index 2f455a1716b..81e5fa647b1 100644 --- a/components/style/properties/longhands/border.mako.rs +++ b/components/style/properties/longhands/border.mako.rs @@ -48,8 +48,8 @@ ${helpers.predefined_type( "border-%s-width" % side_name, "BorderSideWidth", - "::values::computed::NonNegativeLength::new(3.)", - computed_type="::values::computed::NonNegativeLength", + "crate::values::computed::NonNegativeLength::new(3.)", + computed_type="crate::values::computed::NonNegativeLength", alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-width"), spec=maybe_logical_spec(side, "width"), animation_value_type="NonNegativeLength", @@ -64,7 +64,7 @@ ${helpers.gecko_keyword_conversion( Keyword('border-style', "none solid double dotted dashed hidden groove ridge inset outset"), - type="::values::specified::BorderStyle", + type="crate::values::specified::BorderStyle", )} // FIXME(#4126): when gfx supports painting it, make this Size2D<LengthOrPercentage> @@ -160,11 +160,11 @@ ${helpers.predefined_type( )} #[cfg(feature = "gecko")] -impl ::values::computed::BorderImageWidth { - pub fn to_gecko_rect(&self, sides: &mut ::gecko_bindings::structs::nsStyleSides) { - use gecko_bindings::sugar::ns_style_coord::{CoordDataMut, CoordDataValue}; - use gecko::values::GeckoStyleCoordConvertible; - use values::generics::border::BorderImageSideWidth; +impl crate::values::computed::BorderImageWidth { + pub fn to_gecko_rect(&self, sides: &mut crate::gecko_bindings::structs::nsStyleSides) { + use crate::gecko_bindings::sugar::ns_style_coord::{CoordDataMut, CoordDataValue}; + use crate::gecko::values::GeckoStyleCoordConvertible; + use crate::values::generics::border::BorderImageSideWidth; % for i in range(0, 4): match self.${i} { @@ -182,16 +182,16 @@ impl ::values::computed::BorderImageWidth { } pub fn from_gecko_rect( - sides: &::gecko_bindings::structs::nsStyleSides, - ) -> Option<::values::computed::BorderImageWidth> { - use gecko_bindings::structs::nsStyleUnit::{eStyleUnit_Factor, eStyleUnit_Auto}; - use gecko_bindings::sugar::ns_style_coord::CoordData; - use gecko::values::GeckoStyleCoordConvertible; - use values::computed::{LengthOrPercentage, Number}; - use values::generics::border::BorderImageSideWidth; + sides: &crate::gecko_bindings::structs::nsStyleSides, + ) -> Option<crate::values::computed::BorderImageWidth> { + use crate::gecko_bindings::structs::nsStyleUnit::{eStyleUnit_Factor, eStyleUnit_Auto}; + use crate::gecko_bindings::sugar::ns_style_coord::CoordData; + use crate::gecko::values::GeckoStyleCoordConvertible; + use crate::values::computed::{LengthOrPercentage, Number}; + use crate::values::generics::border::BorderImageSideWidth; Some( - ::values::computed::BorderImageWidth::new( + crate::values::computed::BorderImageWidth::new( % for i in range(0, 4): match sides.data_at(${i}).unit() { eStyleUnit_Auto => { diff --git a/components/style/properties/longhands/color.mako.rs b/components/style/properties/longhands/color.mako.rs index d53632835b6..c773885a833 100644 --- a/components/style/properties/longhands/color.mako.rs +++ b/components/style/properties/longhands/color.mako.rs @@ -63,11 +63,11 @@ pub mod system_colors { IMESelectedConvertedTextBackground IMESelectedConvertedTextForeground IMESelectedConvertedTextUnderline SpellCheckerUnderline""".split() %> - use gecko_bindings::bindings::Gecko_GetLookAndFeelSystemColor; - use gecko_bindings::structs::root::mozilla::LookAndFeel_ColorID; + use crate::gecko_bindings::bindings::Gecko_GetLookAndFeelSystemColor; + use crate::gecko_bindings::structs::root::mozilla::LookAndFeel_ColorID; use std::fmt::{self, Write}; use style_traits::{CssWriter, ToCss}; - use values::computed::{Context, ToComputedValue}; + use crate::values::computed::{Context, ToComputedValue}; pub type SystemColor = LookAndFeel_ColorID; diff --git a/components/style/properties/longhands/column.mako.rs b/components/style/properties/longhands/column.mako.rs index adc9371e99f..4f223ceb856 100644 --- a/components/style/properties/longhands/column.mako.rs +++ b/components/style/properties/longhands/column.mako.rs @@ -43,9 +43,9 @@ ${helpers.single_keyword( ${helpers.predefined_type( "column-rule-width", "BorderSideWidth", - "::values::computed::NonNegativeLength::new(3.)", + "crate::values::computed::NonNegativeLength::new(3.)", initial_specified_value="specified::BorderSideWidth::Medium", - computed_type="::values::computed::NonNegativeLength", + computed_type="crate::values::computed::NonNegativeLength", products="gecko", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width", animation_value_type="NonNegativeLength", diff --git a/components/style/properties/longhands/font.mako.rs b/components/style/properties/longhands/font.mako.rs index e14d16e0cb7..2b105e43659 100644 --- a/components/style/properties/longhands/font.mako.rs +++ b/components/style/properties/longhands/font.mako.rs @@ -326,12 +326,12 @@ ${helpers.predefined_type( use app_units::Au; use cssparser::{Parser, ToCss}; - use gecko_bindings::structs::FontFamilyType; - use properties::longhands; + use crate::gecko_bindings::structs::FontFamilyType; + use crate::properties::longhands; use std::fmt; use std::hash::{Hash, Hasher}; use style_traits::ParseError; - use values::computed::{ToComputedValue, Context}; + use crate::values::computed::{ToComputedValue, Context}; <% system_fonts = """caption icon menu message-box small-caption status-bar @@ -375,12 +375,12 @@ ${helpers.predefined_type( type ComputedValue = ComputedSystemFont; fn to_computed_value(&self, cx: &Context) -> Self::ComputedValue { - use gecko_bindings::bindings; - use gecko_bindings::structs::{LookAndFeel_FontID, nsFont}; + use crate::gecko_bindings::bindings; + use crate::gecko_bindings::structs::{LookAndFeel_FontID, nsFont}; use std::mem; - use values::computed::Percentage; - use values::computed::font::{FontSize, FontStretch, FontStyle, FontFamilyList}; - use values::generics::NonNegative; + use crate::values::computed::Percentage; + use crate::values::computed::font::{FontSize, FontStretch, FontStyle, FontFamilyList}; + use crate::values::generics::NonNegative; let id = match *self { % for font in system_fonts: diff --git a/components/style/properties/longhands/inherited_svg.mako.rs b/components/style/properties/longhands/inherited_svg.mako.rs index 4ecad6e39fd..52bac0bcdf5 100644 --- a/components/style/properties/longhands/inherited_svg.mako.rs +++ b/components/style/properties/longhands/inherited_svg.mako.rs @@ -39,7 +39,7 @@ ${helpers.single_keyword( ${helpers.predefined_type( "fill", "SVGPaint", - "::values::computed::SVGPaint::black()", + "crate::values::computed::SVGPaint::black()", products="gecko", animation_value_type="IntermediateSVGPaint", boxed=True, @@ -87,7 +87,7 @@ ${helpers.predefined_type( "stroke-width", "SVGWidth", "computed::SVGWidth::one()", products="gecko", - animation_value_type="::values::computed::SVGWidth", + animation_value_type="crate::values::computed::SVGWidth", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth", )} @@ -112,7 +112,7 @@ ${helpers.predefined_type( "GreaterThanOrEqualToOneNumber", "From::from(4.0)", products="gecko", - animation_value_type="::values::computed::GreaterThanOrEqualToOneNumber", + animation_value_type="crate::values::computed::GreaterThanOrEqualToOneNumber", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty", )} @@ -130,7 +130,7 @@ ${helpers.predefined_type( "SVGStrokeDashArray", "Default::default()", products="gecko", - animation_value_type="::values::computed::SVGStrokeDashArray", + animation_value_type="crate::values::computed::SVGStrokeDashArray", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing", )} diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs index 164f8a7dea1..5b6cf609826 100644 --- a/components/style/properties/longhands/inherited_text.mako.rs +++ b/components/style/properties/longhands/inherited_text.mako.rs @@ -293,9 +293,9 @@ ${helpers.predefined_type( ${helpers.predefined_type( "-webkit-text-stroke-width", "BorderSideWidth", - "::values::computed::NonNegativeLength::new(0.)", + "crate::values::computed::NonNegativeLength::new(0.)", initial_specified_value="specified::BorderSideWidth::Length(specified::Length::zero())", - computed_type="::values::computed::NonNegativeLength", + computed_type="crate::values::computed::NonNegativeLength", products="gecko", gecko_pref="layout.css.prefixes.webkit", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", diff --git a/components/style/properties/longhands/outline.mako.rs b/components/style/properties/longhands/outline.mako.rs index a61aae06d7c..0274b728867 100644 --- a/components/style/properties/longhands/outline.mako.rs +++ b/components/style/properties/longhands/outline.mako.rs @@ -32,9 +32,9 @@ ${helpers.predefined_type( ${helpers.predefined_type( "outline-width", "BorderSideWidth", - "::values::computed::NonNegativeLength::new(3.)", + "crate::values::computed::NonNegativeLength::new(3.)", initial_specified_value="specified::BorderSideWidth::Medium", - computed_type="::values::computed::NonNegativeLength", + computed_type="crate::values::computed::NonNegativeLength", animation_value_type="NonNegativeLength", spec="https://drafts.csswg.org/css-ui/#propdef-outline-width", )} @@ -55,7 +55,7 @@ ${helpers.predefined_type( ${helpers.predefined_type( "outline-offset", "Length", - "::values::computed::Length::new(0.)", + "crate::values::computed::Length::new(0.)", products="servo gecko", animation_value_type="ComputedValue", spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset", diff --git a/components/style/properties/longhands/position.mako.rs b/components/style/properties/longhands/position.mako.rs index 5ec34961d22..a316349d9f9 100644 --- a/components/style/properties/longhands/position.mako.rs +++ b/components/style/properties/longhands/position.mako.rs @@ -42,7 +42,7 @@ macro_rules! impl_align_conversions { ($name: path) => { impl From<u8> for $name { fn from(bits: u8) -> $name { - $name(::values::specified::align::AlignFlags::from_bits(bits) + $name(crate::values::specified::align::AlignFlags::from_bits(bits) .expect("bits contain valid flag")) } } @@ -149,7 +149,7 @@ ${helpers.single_keyword( )} #[cfg(feature = "gecko")] - impl_align_conversions!(::values::specified::align::AlignItems); + impl_align_conversions!(crate::values::specified::align::AlignItems); ${helpers.predefined_type( "justify-items", @@ -160,7 +160,7 @@ ${helpers.single_keyword( )} #[cfg(feature = "gecko")] - impl_align_conversions!(::values::specified::align::JustifyItems); + impl_align_conversions!(crate::values::specified::align::JustifyItems); % endif // Flex item properties @@ -214,7 +214,7 @@ ${helpers.predefined_type( )} #[cfg(feature = "gecko")] - impl_align_conversions!(::values::specified::align::SelfAlignment); + impl_align_conversions!(crate::values::specified::align::SelfAlignment); % endif // https://drafts.csswg.org/css-flexbox/#propdef-order diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 8080d0c14f0..072b78cf377 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -22,28 +22,28 @@ use std::mem::{self, ManuallyDrop}; use cssparser::{Parser, RGBA, TokenSerializationType}; use cssparser::ParserInput; #[cfg(feature = "servo")] use euclid::SideOffsets2D; -use context::QuirksMode; -#[cfg(feature = "gecko")] use gecko_bindings::structs::{self, nsCSSPropertyID}; -#[cfg(feature = "servo")] use logical_geometry::LogicalMargin; -#[cfg(feature = "servo")] use computed_values; -use logical_geometry::WritingMode; +use crate::context::QuirksMode; +#[cfg(feature = "gecko")] use crate::gecko_bindings::structs::{self, nsCSSPropertyID}; +#[cfg(feature = "servo")] use crate::logical_geometry::LogicalMargin; +#[cfg(feature = "servo")] use crate::computed_values; +use crate::logical_geometry::WritingMode; #[cfg(feature = "gecko")] use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; -use media_queries::Device; -use parser::ParserContext; -use properties::longhands::system_font::SystemFont; -use selector_parser::PseudoElement; +use crate::media_queries::Device; +use crate::parser::ParserContext; +use crate::properties::longhands::system_font::SystemFont; +use crate::selector_parser::PseudoElement; use selectors::parser::SelectorParseErrorKind; #[cfg(feature = "servo")] use servo_config::prefs::PREFS; use style_traits::{CssWriter, KeywordsCollectFn, ParseError, ParsingMode}; use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss}; -use stylesheets::{CssRuleType, Origin, UrlExtraData}; -use values::generics::text::LineHeight; -use values::computed; -use values::computed::NonNegativeLength; -use values::serialize_atom_name; -use rule_tree::StrongRuleNode; +use crate::stylesheets::{CssRuleType, Origin, UrlExtraData}; +use crate::values::generics::text::LineHeight; +use crate::values::computed; +use crate::values::computed::NonNegativeLength; +use crate::values::serialize_atom_name; +use crate::rule_tree::StrongRuleNode; use self::computed_value_flags::*; -use str::{CssString, CssStringBorrow, CssStringWriter}; +use crate::str::{CssString, CssStringBorrow, CssStringWriter}; pub use self::declaration_block::*; pub use self::cascade::*; @@ -110,12 +110,12 @@ macro_rules! unwrap_or_initial { #[allow(missing_docs)] pub mod shorthands { use cssparser::Parser; - use parser::{Parse, ParserContext}; + use crate::parser::{Parse, ParserContext}; use style_traits::{ParseError, StyleParseErrorKind}; - use values::specified; + use crate::values::specified; use style_traits::{CssWriter, ToCss}; - use values::specified::{BorderStyle, Color}; + use crate::values::specified::{BorderStyle, Color}; use std::fmt::{self, Write}; fn serialize_directional_border<W, I,>( @@ -427,7 +427,7 @@ pub const NON_CUSTOM_PROPERTY_ID_COUNT: usize = #[allow(dead_code)] unsafe fn static_assert_nscsspropertyid() { % for i, property in enumerate(data.longhands + data.shorthands + data.all_aliases()): - ::std::mem::transmute::<[u8; ${i}], [u8; ${property.nscsspropertyid()} as usize]>([0; ${i}]); // ${property.name} + std::mem::transmute::<[u8; ${i}], [u8; ${property.nscsspropertyid()} as usize]>([0; ${i}]); // ${property.name} % endfor } % endif @@ -442,7 +442,7 @@ impl NonCustomPropertyId { #[inline] fn to_nscsspropertyid(self) -> nsCSSPropertyID { // unsafe: guaranteed by static_assert_nscsspropertyid above. - unsafe { ::std::mem::transmute(self.0 as i32) } + unsafe { std::mem::transmute(self.0 as i32) } } /// Convert an `nsCSSPropertyID` into a `NonCustomPropertyId`. @@ -457,7 +457,7 @@ impl NonCustomPropertyId { return Err(()); } // unsafe: guaranteed by static_assert_nscsspropertyid above. - Ok(unsafe { ::std::mem::transmute(prop as usize) }) + Ok(unsafe { std::mem::transmute(prop as usize) }) } /// Get the property name. @@ -1301,7 +1301,7 @@ impl LonghandId { /// shorthand, if that shorthand is enabled for all content too. pub struct NonCustomPropertyIterator<Item: 'static> { filter: bool, - iter: ::std::slice::Iter<'static, Item>, + iter: std::slice::Iter<'static, Item>, } impl<Item> Iterator for NonCustomPropertyIterator<Item> @@ -1534,11 +1534,11 @@ impl UnparsedValue { fn substitute_variables( &self, longhand_id: LonghandId, - custom_properties: Option<<&Arc<::custom_properties::CustomPropertiesMap>>, + custom_properties: Option<<&Arc<crate::custom_properties::CustomPropertiesMap>>, quirks_mode: QuirksMode, environment: &::custom_properties::CssEnvironment, ) -> PropertyDeclaration { - ::custom_properties::substitute( + crate::custom_properties::substitute( &self.css, self.first_token_type, custom_properties, @@ -1617,7 +1617,7 @@ pub enum PropertyDeclarationId<'a> { /// A longhand. Longhand(LonghandId), /// A custom property declaration. - Custom(&'a ::custom_properties::Name), + Custom(&'a crate::custom_properties::Name), } impl<'a> ToCss for PropertyDeclarationId<'a> { @@ -1699,7 +1699,7 @@ pub enum PropertyId { /// An alias for a shorthand property. ShorthandAlias(ShorthandId, AliasId), /// A custom property. - Custom(::custom_properties::Name), + Custom(crate::custom_properties::Name), } impl fmt::Debug for PropertyId { @@ -1763,8 +1763,8 @@ impl PropertyId { return Ok(id.clone()) } - let name = ::custom_properties::parse_name(property_name)?; - Ok(PropertyId::Custom(::custom_properties::Name::from(name))) + let name = crate::custom_properties::parse_name(property_name)?; + Ok(PropertyId::Custom(crate::custom_properties::Name::from(name))) } /// Parses a property name, and returns an error if it's unknown or isn't @@ -1948,7 +1948,7 @@ pub struct VariableDeclaration { #[derive(Clone, PartialEq, ToCss)] pub enum CustomDeclarationValue { /// A value. - Value(Arc<::custom_properties::SpecifiedValue>), + Value(Arc<crate::custom_properties::SpecifiedValue>), /// A wide keyword. CSSWideKeyword(CSSWideKeyword), } @@ -1959,7 +1959,7 @@ pub enum CustomDeclarationValue { pub struct CustomDeclaration { /// The name of the custom property. #[css(skip)] - pub name: ::custom_properties::Name, + pub name: crate::custom_properties::Name, /// The value of the custom property. #[cfg_attr(feature = "gecko", ignore_malloc_size_of = "XXX: how to handle this?")] pub value: CustomDeclarationValue, @@ -2196,7 +2196,7 @@ impl PropertyDeclaration { // This probably affects some test results. let value = match input.try(CSSWideKeyword::parse) { Ok(keyword) => CustomDeclarationValue::CSSWideKeyword(keyword), - Err(()) => match ::custom_properties::SpecifiedValue::parse(input) { + Err(()) => match crate::custom_properties::SpecifiedValue::parse(input) { Ok(value) => CustomDeclarationValue::Value(value), Err(e) => return Err(StyleParseErrorKind::new_invalid( format!("--{}", property_name), @@ -2230,7 +2230,7 @@ impl PropertyDeclaration { } input.reset(&start); let (first_token_type, css) = - ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { + crate::custom_properties::parse_non_custom_with_var(input).map_err(|e| { StyleParseErrorKind::new_invalid( non_custom_id.unwrap().name(), e, @@ -2282,7 +2282,7 @@ impl PropertyDeclaration { input.reset(&start); let (first_token_type, css) = - ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { + crate::custom_properties::parse_non_custom_with_var(input).map_err(|e| { StyleParseErrorKind::new_invalid( non_custom_id.unwrap().name(), e, @@ -2424,7 +2424,7 @@ impl<'a> Iterator for AllShorthandDeclarationIterator<'a> { } #[cfg(feature = "gecko")] -pub use gecko_properties::style_structs; +pub use crate::gecko_properties::style_structs; /// The module where all the style structs are defined. #[cfg(feature = "servo")] @@ -2432,9 +2432,9 @@ pub mod style_structs { use fxhash::FxHasher; use super::longhands; use std::hash::{Hash, Hasher}; - use logical_geometry::WritingMode; - use media_queries::Device; - use values::computed::NonNegativeLength; + use crate::logical_geometry::WritingMode; + use crate::media_queries::Device; + use crate::values::computed::NonNegativeLength; % for style_struct in data.active_style_structs(): % if style_struct.name == "Font": @@ -2453,7 +2453,7 @@ pub mod style_structs { /// /// FIXME(emilio): This is technically a box-tree concept, and /// would be nice to move away from style. - pub text_decorations_in_effect: ::values::computed::text::TextDecorationsInEffect, + pub text_decorations_in_effect: crate::values::computed::text::TextDecorationsInEffect, % endif % if style_struct.name == "Font": /// The font hash, used for font caching. @@ -2700,7 +2700,7 @@ pub mod style_structs { /// Whether this is a multicol style. #[cfg(feature = "servo")] pub fn is_multicol(&self) -> bool { - use values::Either; + use crate::values::Either; match self.column_width { Either::First(_width) => true, Either::Second(_auto) => !self.column_count.is_auto(), @@ -2736,7 +2736,7 @@ pub mod style_structs { #[cfg(feature = "gecko")] -pub use gecko_properties::{ComputedValues, ComputedValuesInner}; +pub use crate::gecko_properties::{ComputedValues, ComputedValuesInner}; #[cfg(feature = "servo")] #[cfg_attr(feature = "servo", derive(Clone, Debug))] @@ -2745,7 +2745,7 @@ pub struct ComputedValuesInner { % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc<style_structs::${style_struct.name}>, % endfor - custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, + custom_properties: Option<Arc<crate::custom_properties::CustomPropertiesMap>>, /// The writing mode of this computed values struct. pub writing_mode: WritingMode, @@ -2804,7 +2804,7 @@ impl ComputedValues { } /// Gets a reference to the custom properties map (if one exists). - pub fn custom_properties(&self) -> Option<<&Arc<::custom_properties::CustomPropertiesMap>> { + pub fn custom_properties(&self) -> Option<<&Arc<crate::custom_properties::CustomPropertiesMap>> { self.custom_properties.as_ref() } @@ -2874,7 +2874,7 @@ impl ComputedValues { pub fn new( _: &Device, _: Option<<&PseudoElement>, - custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, + custom_properties: Option<Arc<crate::custom_properties::CustomPropertiesMap>>, writing_mode: WritingMode, flags: ComputedValueFlags, rules: Option<StrongRuleNode>, @@ -2978,7 +2978,7 @@ impl ComputedValuesInner { /// ineffective, and would yield an empty `::before` or `::after` /// pseudo-element. pub fn ineffective_content_property(&self) -> bool { - use values::generics::counters::Content; + use crate::values::generics::counters::Content; match self.get_counters().content { Content::Normal | Content::None => true, Content::Items(ref items) => items.is_empty(), @@ -3100,7 +3100,7 @@ impl ComputedValuesInner { /// Return true if the effects force the transform style to be Flat pub fn overrides_transform_style(&self) -> bool { - use computed_values::mix_blend_mode::T as MixBlendMode; + use crate::computed_values::mix_blend_mode::T as MixBlendMode; let effects = self.get_effects(); // TODO(gw): Add clip-path, isolation, mask-image, mask-border-source when supported. @@ -3112,7 +3112,7 @@ impl ComputedValuesInner { /// <https://drafts.csswg.org/css-transforms/#grouping-property-values> pub fn get_used_transform_style(&self) -> computed_values::transform_style::T { - use computed_values::transform_style::T as TransformStyle; + use crate::computed_values::transform_style::T as TransformStyle; let box_ = self.get_box(); @@ -3127,7 +3127,7 @@ impl ComputedValuesInner { /// Whether given this transform value, the compositor would require a /// layer. pub fn transform_requires_layer(&self) -> bool { - use values::generics::transform::TransformOperation; + use crate::values::generics::transform::TransformOperation; // Check if the transform matrix is 2D or 3D for transform in &self.get_box().transform.0 { match *transform { @@ -3160,13 +3160,13 @@ impl ComputedValuesInner { } % if product == "gecko": - pub use ::servo_arc::RawOffsetArc as BuilderArc; + pub use crate::servo_arc::RawOffsetArc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { Arc::from_raw_offset(x.clone()) } % else: - pub use ::servo_arc::Arc as BuilderArc; + pub use crate::servo_arc::Arc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { x.clone() @@ -3301,7 +3301,7 @@ pub struct StyleBuilder<'a> { /// node. pub rules: Option<StrongRuleNode>, - custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, + custom_properties: Option<Arc<crate::custom_properties::CustomPropertiesMap>>, /// The pseudo-element this style will represent. pub pseudo: Option<<&'a PseudoElement>, @@ -3334,12 +3334,12 @@ impl<'a> StyleBuilder<'a> { parent_style_ignoring_first_line: Option<<&'a ComputedValues>, pseudo: Option<<&'a PseudoElement>, rules: Option<StrongRuleNode>, - custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, + custom_properties: Option<Arc<crate::custom_properties::CustomPropertiesMap>>, ) -> Self { debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || - ::std::ptr::eq(parent_style.unwrap(), + std::ptr::eq(parent_style.unwrap(), parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let reset_style = device.default_computed_values(); @@ -3604,7 +3604,7 @@ impl<'a> StyleBuilder<'a> { /// Returns whether this computed style represents an out of flow-positioned /// object. pub fn out_of_flow_positioned(&self) -> bool { - use properties::longhands::position::computed_value::T as Position; + use crate::properties::longhands::position::computed_value::T as Position; matches!(self.get_box().clone_position(), Position::Absolute | Position::Fixed) } @@ -3653,7 +3653,7 @@ impl<'a> StyleBuilder<'a> { /// /// Cloning the Arc here is fine because it only happens in the case where /// we have custom properties, and those are both rare and expensive. - fn custom_properties(&self) -> Option<<&Arc<::custom_properties::CustomPropertiesMap>> { + fn custom_properties(&self) -> Option<<&Arc<crate::custom_properties::CustomPropertiesMap>> { self.custom_properties.as_ref() } @@ -3697,7 +3697,7 @@ pub use self::lazy_static_module::INITIAL_SERVO_VALUES; #[cfg(feature = "servo")] #[allow(missing_docs)] mod lazy_static_module { - use logical_geometry::WritingMode; + use crate::logical_geometry::WritingMode; use servo_arc::Arc; use super::{ComputedValues, ComputedValuesInner, longhands, style_structs}; use super::computed_value_flags::ComputedValueFlags; @@ -3712,7 +3712,8 @@ mod lazy_static_module { ${longhand.ident}: longhands::${longhand.ident}::get_initial_value(), % endfor % if style_struct.name == "InheritedText": - text_decorations_in_effect: ::values::computed::text::TextDecorationsInEffect::default(), + text_decorations_in_effect: + crate::values::computed::text::TextDecorationsInEffect::default(), % endif % if style_struct.name == "Font": hash: 0, diff --git a/components/style/properties/shorthands/background.mako.rs b/components/style/properties/shorthands/background.mako.rs index dff9319cb30..435cc287075 100644 --- a/components/style/properties/shorthands/background.mako.rs +++ b/components/style/properties/shorthands/background.mako.rs @@ -10,13 +10,13 @@ background-attachment background-image background-size background-origin background-clip" spec="https://drafts.csswg.org/css-backgrounds/#the-background"> - use properties::longhands::{background_position_x, background_position_y, background_repeat}; - use properties::longhands::{background_attachment, background_image, background_size, background_origin}; - use properties::longhands::background_clip; - use properties::longhands::background_clip::single_value::computed_value::T as Clip; - use properties::longhands::background_origin::single_value::computed_value::T as Origin; - use values::specified::{Color, Position, PositionComponent}; - use parser::Parse; + use crate::properties::longhands::{background_position_x, background_position_y, background_repeat}; + use crate::properties::longhands::{background_attachment, background_image, background_size, background_origin}; + use crate::properties::longhands::background_clip; + use crate::properties::longhands::background_clip::single_value::computed_value::T as Clip; + use crate::properties::longhands::background_origin::single_value::computed_value::T as Origin; + use crate::values::specified::{Color, Position, PositionComponent}; + use crate::parser::Parse; // FIXME(emilio): Should be the same type! impl From<background_origin::single_value::SpecifiedValue> for background_clip::single_value::SpecifiedValue { @@ -199,9 +199,9 @@ flags="SHORTHAND_IN_GETCS" sub_properties="background-position-x background-position-y" spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position"> - use properties::longhands::{background_position_x, background_position_y}; - use values::specified::AllowQuirks; - use values::specified::position::Position; + use crate::properties::longhands::{background_position_x, background_position_y}; + use crate::values::specified::AllowQuirks; + use crate::values::specified::position::Position; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/border.mako.rs b/components/style/properties/shorthands/border.mako.rs index 056096353bc..9a5b0a81827 100644 --- a/components/style/properties/shorthands/border.mako.rs +++ b/components/style/properties/shorthands/border.mako.rs @@ -21,8 +21,8 @@ ${helpers.four_sides_shorthand( ' '.join('border-%s-width' % side for side in PHYSICAL_SIDES)}" spec="https://drafts.csswg.org/css-backgrounds/#border-width"> - use values::generics::rect::Rect; - use values::specified::{AllowQuirks, BorderSideWidth}; + use crate::values::generics::rect::Rect; + use crate::values::specified::{AllowQuirks, BorderSideWidth}; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -54,7 +54,7 @@ pub fn parse_border<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<(specified::Color, specified::BorderStyle, specified::BorderSideWidth), ParseError<'i>> { - use values::specified::{Color, BorderStyle, BorderSideWidth}; + use crate::values::specified::{Color, BorderStyle, BorderSideWidth}; let _unused = context; let mut color = None; let mut style = None; @@ -147,8 +147,8 @@ pub fn parse_border<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<Longhands, ParseError<'i>> { - use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; - use properties::longhands::{border_image_source, border_image_width}; + use crate::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; + use crate::properties::longhands::{border_image_source, border_image_width}; let (color, style, width) = super::parse_border(context, input)?; Ok(expanded! { @@ -206,7 +206,7 @@ pub fn parse_border<'i, 't>( // Just use the same as border-left. The border shorthand can't accept // any value that the sub-shorthand couldn't. <% - border_left = "<::properties::shorthands::border_left::Longhands as SpecifiedValueInfo>" + border_left = "<crate::properties::shorthands::border_left::Longhands as SpecifiedValueInfo>" %> impl SpecifiedValueInfo for Longhands { const SUPPORTED_TYPES: u8 = ${border_left}::SUPPORTED_TYPES; @@ -220,10 +220,10 @@ pub fn parse_border<'i, 't>( 'border-%s-radius' % (corner) for corner in ['top-left', 'top-right', 'bottom-right', 'bottom-left'] )}" extra_prefixes="webkit" spec="https://drafts.csswg.org/css-backgrounds/#border-radius"> - use values::generics::rect::Rect; - use values::generics::border::BorderCornerRadius; - use values::specified::border::BorderRadius; - use parser::Parse; + use crate::values::generics::rect::Rect; + use crate::values::generics::border::BorderCornerRadius; + use crate::values::specified::border::BorderRadius; + use crate::parser::Parse; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -260,8 +260,8 @@ pub fn parse_border<'i, 't>( border-image-repeat border-image-slice border-image-source border-image-width" extra_prefixes="moz:layout.css.prefixes.border-image webkit" spec="https://drafts.csswg.org/css-backgrounds-3/#border-image"> - use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; - use properties::longhands::{border_image_source, border_image_width}; + use crate::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; + use crate::properties::longhands::{border_image_source, border_image_width}; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/box.mako.rs b/components/style/properties/shorthands/box.mako.rs index 3886c7d2d3c..b06db806a17 100644 --- a/components/style/properties/shorthands/box.mako.rs +++ b/components/style/properties/shorthands/box.mako.rs @@ -10,9 +10,9 @@ sub_properties="overflow-x overflow-y" spec="https://drafts.csswg.org/css-overflow/#propdef-overflow" > - use properties::longhands::overflow_x::parse as parse_overflow; + use crate::properties::longhands::overflow_x::parse as parse_overflow; % if product == "gecko": - use properties::longhands::overflow_x::SpecifiedValue; + use crate::properties::longhands::overflow_x::SpecifiedValue; % endif pub fn parse_value<'i, 't>( @@ -20,7 +20,7 @@ input: &mut Parser<'i, 't>, ) -> Result<Longhands, ParseError<'i>> { % if product == "gecko": - use gecko_bindings::structs; + use crate::gecko_bindings::structs; let moz_kw_enabled = unsafe { structs::StaticPrefs_sVarCache_layout_css_overflow_moz_scrollbars_enabled }; @@ -82,7 +82,7 @@ "(https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-box)" products="gecko" > - use values::specified::OverflowClipBox; + use crate::values::specified::OverflowClipBox; pub fn parse_value<'i, 't>( _: &ParserContext, input: &mut Parser<'i, 't>, @@ -130,11 +130,11 @@ macro_rules! try_parse_one { transition-timing-function transition-delay" spec="https://drafts.csswg.org/css-transitions/#propdef-transition"> - use parser::Parse; + use crate::parser::Parse; % for prop in "delay duration property timing_function".split(): - use properties::longhands::transition_${prop}; + use crate::properties::longhands::transition_${prop}; % endfor - use values::specified::TransitionProperty; + use crate::values::specified::TransitionProperty; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -282,7 +282,7 @@ macro_rules! try_parse_one { direction fill_mode play_state".split() %> % for prop in props: - use properties::longhands::animation_${prop}; + use crate::properties::longhands::animation_${prop}; % endfor pub fn parse_value<'i, 't>( @@ -391,7 +391,7 @@ macro_rules! try_parse_one { gecko_pref="layout.css.scroll-snap.enabled" sub_properties="scroll-snap-type-x scroll-snap-type-y" spec="https://drafts.csswg.org/css-scroll-snap/#propdef-scroll-snap-type"> - use properties::longhands::scroll_snap_type_x; + use crate::properties::longhands::scroll_snap_type_x; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -425,7 +425,7 @@ macro_rules! try_parse_one { _: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<Longhands, ParseError<'i>> { - use values::specified::OverscrollBehavior; + use crate::values::specified::OverscrollBehavior; let behavior_x = OverscrollBehavior::parse(input)?; let behavior_y = input.try(OverscrollBehavior::parse).unwrap_or(behavior_x); Ok(expanded! { diff --git a/components/style/properties/shorthands/column.mako.rs b/components/style/properties/shorthands/column.mako.rs index cdd05dc786b..d252ef5dfb3 100644 --- a/components/style/properties/shorthands/column.mako.rs +++ b/components/style/properties/shorthands/column.mako.rs @@ -9,7 +9,7 @@ servo_pref="layout.columns.enabled", derive_serialize="True" extra_prefixes="moz" spec="https://drafts.csswg.org/css-multicol/#propdef-columns"> - use properties::longhands::{column_count, column_width}; + use crate::properties::longhands::{column_count, column_width}; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -59,8 +59,8 @@ sub_properties="column-rule-width column-rule-style column-rule-color" derive_serialize="True" spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule"> - use properties::longhands::{column_rule_width, column_rule_style}; - use properties::longhands::column_rule_color; + use crate::properties::longhands::{column_rule_width, column_rule_style}; + use crate::properties::longhands::column_rule_color; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/font.mako.rs b/components/style/properties/shorthands/font.mako.rs index 75095bcebc2..0d319715278 100644 --- a/components/style/properties/shorthands/font.mako.rs +++ b/components/style/properties/shorthands/font.mako.rs @@ -21,14 +21,14 @@ ${'font-variation-settings' if product == 'gecko' else ''}" derive_value_info="False" spec="https://drafts.csswg.org/css-fonts-3/#propdef-font"> - use parser::Parse; - use properties::longhands::{font_family, font_style, font_weight, font_stretch}; - use properties::longhands::font_variant_caps; + use crate::parser::Parse; + use crate::properties::longhands::{font_family, font_style, font_weight, font_stretch}; + use crate::properties::longhands::font_variant_caps; #[cfg(feature = "gecko")] - use properties::longhands::system_font::SystemFont; - use values::specified::text::LineHeight; - use values::specified::FontSize; - use values::specified::font::{FontStretch, FontStretchKeyword}; + use crate::properties::longhands::system_font::SystemFont; + use crate::values::specified::text::LineHeight; + use crate::values::specified::FontSize; + use crate::values::specified::font::{FontStretch, FontStretchKeyword}; <% gecko_sub_properties = "kerning language_override size_adjust \ @@ -39,7 +39,7 @@ %> % if product == "gecko": % for prop in gecko_sub_properties: - use properties::longhands::font_${prop}; + use crate::properties::longhands::font_${prop}; % endfor % endif use self::font_family::SpecifiedValue as FontFamily; @@ -301,10 +301,10 @@ %> % for prop in sub_properties: - use properties::longhands::font_variant_${prop}; + use crate::properties::longhands::font_variant_${prop}; % endfor #[allow(unused_imports)] - use values::specified::FontVariantLigatures; + use crate::values::specified::FontVariantLigatures; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/inherited_svg.mako.rs b/components/style/properties/shorthands/inherited_svg.mako.rs index 09c533a708b..e7b00740600 100644 --- a/components/style/properties/shorthands/inherited_svg.mako.rs +++ b/components/style/properties/shorthands/inherited_svg.mako.rs @@ -7,13 +7,13 @@ <%helpers:shorthand name="marker" products="gecko" sub_properties="marker-start marker-end marker-mid" spec="https://www.w3.org/TR/SVG2/painting.html#MarkerShorthand"> - use values::specified::url::UrlOrNone; + use crate::values::specified::url::UrlOrNone; pub fn parse_value<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result<Longhands, ParseError<'i>> { - use parser::Parse; + use crate::parser::Parse; let url = UrlOrNone::parse(context, input)?; Ok(expanded! { diff --git a/components/style/properties/shorthands/inherited_text.mako.rs b/components/style/properties/shorthands/inherited_text.mako.rs index 98ded998bb1..f645d84ad6a 100644 --- a/components/style/properties/shorthands/inherited_text.mako.rs +++ b/components/style/properties/shorthands/inherited_text.mako.rs @@ -8,7 +8,7 @@ sub_properties="text-emphasis-style text-emphasis-color" derive_serialize="True" spec="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-property"> - use properties::longhands::{text_emphasis_color, text_emphasis_style}; + use crate::properties::longhands::{text_emphasis_color, text_emphasis_style}; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -52,7 +52,7 @@ products="gecko" derive_serialize="True" spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke"> - use properties::longhands::{_webkit_text_stroke_color, _webkit_text_stroke_width}; + use crate::properties::longhands::{_webkit_text_stroke_color, _webkit_text_stroke_width}; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/list.mako.rs b/components/style/properties/shorthands/list.mako.rs index 67e141f5ac6..060b6b4580a 100644 --- a/components/style/properties/shorthands/list.mako.rs +++ b/components/style/properties/shorthands/list.mako.rs @@ -8,8 +8,8 @@ sub_properties="list-style-position list-style-image list-style-type" derive_serialize="True" spec="https://drafts.csswg.org/css-lists/#propdef-list-style"> - use properties::longhands::{list_style_image, list_style_position, list_style_type}; - use values::specified::url::ImageUrlOrNone; + use crate::properties::longhands::{list_style_image, list_style_position, list_style_type}; + use crate::values::specified::url::ImageUrlOrNone; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -64,7 +64,7 @@ % if product == "servo": list_style_type::SpecifiedValue::None % else: - use values::generics::CounterStyleOrNone; + use crate::values::generics::CounterStyleOrNone; list_style_type::SpecifiedValue::CounterStyle(CounterStyleOrNone::None) % endif } diff --git a/components/style/properties/shorthands/outline.mako.rs b/components/style/properties/shorthands/outline.mako.rs index 14b935f3bfd..051137116f7 100644 --- a/components/style/properties/shorthands/outline.mako.rs +++ b/components/style/properties/shorthands/outline.mako.rs @@ -8,9 +8,9 @@ sub_properties="outline-color outline-style outline-width" derive_serialize="True" spec="https://drafts.csswg.org/css-ui/#propdef-outline"> - use properties::longhands::{outline_color, outline_width, outline_style}; - use values::specified; - use parser::Parse; + use crate::properties::longhands::{outline_color, outline_width, outline_style}; + use crate::values::specified; + use crate::parser::Parse; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -62,9 +62,9 @@ '-moz-outline-radius-%s' % corner for corner in ['topleft', 'topright', 'bottomright', 'bottomleft'] )}" products="gecko" spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)"> - use values::generics::rect::Rect; - use values::specified::border::BorderRadius; - use parser::Parse; + use crate::values::generics::rect::Rect; + use crate::values::specified::border::BorderRadius; + use crate::parser::Parse; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -81,7 +81,7 @@ impl<'a> ToCss for LonghandsToSerialize<'a> { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { - use values::generics::border::BorderCornerRadius; + use crate::values::generics::border::BorderCornerRadius; let LonghandsToSerialize { _moz_outline_radius_topleft: &BorderCornerRadius(ref tl), diff --git a/components/style/properties/shorthands/position.mako.rs b/components/style/properties/shorthands/position.mako.rs index 19ca0cf1916..17a0be3d90b 100644 --- a/components/style/properties/shorthands/position.mako.rs +++ b/components/style/properties/shorthands/position.mako.rs @@ -9,7 +9,7 @@ extra_prefixes="webkit" derive_serialize="True" spec="https://drafts.csswg.org/css-flexbox/#flex-flow-property"> - use properties::longhands::{flex_direction, flex_wrap}; + use crate::properties::longhands::{flex_direction, flex_wrap}; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -48,9 +48,9 @@ extra_prefixes="webkit" derive_serialize="True" spec="https://drafts.csswg.org/css-flexbox/#flex-property"> - use parser::Parse; - use values::specified::NonNegativeNumber; - use properties::longhands::flex_basis::SpecifiedValue as FlexBasis; + use crate::parser::Parse; + use crate::values::specified::NonNegativeNumber; + use crate::properties::longhands::flex_basis::SpecifiedValue as FlexBasis; fn parse_flexibility<'i, 't>( context: &ParserContext, @@ -111,7 +111,7 @@ <%helpers:shorthand name="gap" alias="grid-gap" sub_properties="row-gap column-gap" spec="https://drafts.csswg.org/css-align-3/#gap-shorthand" products="gecko"> - use properties::longhands::{row_gap, column_gap}; + use crate::properties::longhands::{row_gap, column_gap}; pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Longhands, ParseError<'i>> { @@ -142,8 +142,8 @@ <%helpers:shorthand name="grid-${kind}" sub_properties="grid-${kind}-start grid-${kind}-end" spec="https://drafts.csswg.org/css-grid/#propdef-grid-${kind}" products="gecko"> - use values::specified::GridLine; - use parser::Parse; + use crate::values::specified::GridLine; + use crate::parser::Parse; // NOTE: Since both the shorthands have the same code, we should (re-)use code from one to implement // the other. This might not be a big deal for now, but we should consider looking into this in the future @@ -184,8 +184,8 @@ sub_properties="grid-row-start grid-row-end grid-column-start grid-column-end" spec="https://drafts.csswg.org/css-grid/#propdef-grid-area" products="gecko"> - use values::specified::GridLine; - use parser::Parse; + use crate::values::specified::GridLine; + use crate::parser::Parse; // The code is the same as `grid-{row,column}` except that this can have four values at most. pub fn parse_value<'i, 't>( @@ -251,14 +251,14 @@ sub_properties="grid-template-rows grid-template-columns grid-template-areas" spec="https://drafts.csswg.org/css-grid/#propdef-grid-template" products="gecko"> - use parser::Parse; + use crate::parser::Parse; use servo_arc::Arc; - use values::{Either, None_}; - use values::generics::grid::{LineNameList, TrackSize, TrackList, TrackListType}; - use values::generics::grid::{TrackListValue, concat_serialize_idents}; - use values::specified::{GridTemplateComponent, GenericGridTemplateComponent}; - use values::specified::grid::parse_line_names; - use values::specified::position::{TemplateAreas, TemplateAreasArc}; + use crate::values::{Either, None_}; + use crate::values::generics::grid::{LineNameList, TrackSize, TrackList, TrackListType}; + use crate::values::generics::grid::{TrackListValue, concat_serialize_idents}; + use crate::values::specified::{GridTemplateComponent, GenericGridTemplateComponent}; + use crate::values::specified::grid::parse_line_names; + use crate::values::specified::position::{TemplateAreas, TemplateAreasArc}; /// Parsing for `<grid-template>` shorthand (also used by `grid` shorthand). pub fn parse_grid_template<'i, 't>( @@ -484,12 +484,12 @@ grid-auto-rows grid-auto-columns grid-auto-flow" spec="https://drafts.csswg.org/css-grid/#propdef-grid" products="gecko"> - use parser::Parse; - use properties::longhands::{grid_auto_columns, grid_auto_rows, grid_auto_flow}; - use values::{Either, None_}; - use values::generics::grid::{GridTemplateComponent, TrackListType}; - use values::specified::{GenericGridTemplateComponent, TrackSize}; - use values::specified::position::{AutoFlow, GridAutoFlow}; + use crate::parser::Parse; + use crate::properties::longhands::{grid_auto_columns, grid_auto_rows, grid_auto_flow}; + use crate::values::{Either, None_}; + use crate::values::generics::grid::{GridTemplateComponent, TrackListType}; + use crate::values::specified::{GenericGridTemplateComponent, TrackSize}; + use crate::values::specified::position::{AutoFlow, GridAutoFlow}; pub fn parse_value<'i, 't>( context: &ParserContext, @@ -636,7 +636,7 @@ <%helpers:shorthand name="place-content" sub_properties="align-content justify-content" spec="https://drafts.csswg.org/css-align/#propdef-place-content" products="gecko"> - use values::specified::align::{AlignContent, JustifyContent, ContentDistribution, AxisDirection}; + use crate::values::specified::align::{AlignContent, JustifyContent, ContentDistribution, AxisDirection}; pub fn parse_value<'i, 't>( _: &ParserContext, @@ -688,7 +688,7 @@ <%helpers:shorthand name="place-self" sub_properties="align-self justify-self" spec="https://drafts.csswg.org/css-align/#place-self-property" products="gecko"> - use values::specified::align::{AlignSelf, JustifySelf, SelfAlignment, AxisDirection}; + use crate::values::specified::align::{AlignSelf, JustifySelf, SelfAlignment, AxisDirection}; pub fn parse_value<'i, 't>( _: &ParserContext, @@ -726,8 +726,8 @@ <%helpers:shorthand name="place-items" sub_properties="align-items justify-items" spec="https://drafts.csswg.org/css-align/#place-items-property" products="gecko"> - use values::specified::align::{AlignItems, JustifyItems}; - use parser::Parse; + use crate::values::specified::align::{AlignItems, JustifyItems}; + use crate::parser::Parse; impl From<AlignItems> for JustifyItems { fn from(align: AlignItems) -> JustifyItems { diff --git a/components/style/properties/shorthands/svg.mako.rs b/components/style/properties/shorthands/svg.mako.rs index 03027359dd4..e814a0404c4 100644 --- a/components/style/properties/shorthands/svg.mako.rs +++ b/components/style/properties/shorthands/svg.mako.rs @@ -9,11 +9,11 @@ sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x mask-position-y mask-size mask-image" spec="https://drafts.fxtf.org/css-masking/#propdef-mask"> - use properties::longhands::{mask_mode, mask_repeat, mask_clip, mask_origin, mask_composite, mask_position_x, + use crate::properties::longhands::{mask_mode, mask_repeat, mask_clip, mask_origin, mask_composite, mask_position_x, mask_position_y}; - use properties::longhands::{mask_size, mask_image}; - use values::specified::{Position, PositionComponent}; - use parser::Parse; + use crate::properties::longhands::{mask_size, mask_image}; + use crate::values::specified::{Position, PositionComponent}; + use crate::parser::Parse; // FIXME(emilio): These two mask types should be the same! impl From<mask_origin::single_value::SpecifiedValue> for mask_clip::single_value::SpecifiedValue { @@ -125,8 +125,8 @@ impl<'a> ToCss for LonghandsToSerialize<'a> { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { - use properties::longhands::mask_origin::single_value::computed_value::T as Origin; - use properties::longhands::mask_clip::single_value::computed_value::T as Clip; + use crate::properties::longhands::mask_origin::single_value::computed_value::T as Origin; + use crate::properties::longhands::mask_clip::single_value::computed_value::T as Clip; let len = self.mask_image.0.len(); if len == 0 { @@ -186,9 +186,9 @@ flags="SHORTHAND_IN_GETCS" sub_properties="mask-position-x mask-position-y" spec="https://drafts.csswg.org/css-masks-4/#the-mask-position"> - use properties::longhands::{mask_position_x,mask_position_y}; - use values::specified::position::Position; - use parser::Parse; + use crate::properties::longhands::{mask_position_x,mask_position_y}; + use crate::values::specified::position::Position; + use crate::parser::Parse; pub fn parse_value<'i, 't>( context: &ParserContext, diff --git a/components/style/properties/shorthands/text.mako.rs b/components/style/properties/shorthands/text.mako.rs index e83d0b67544..c837a9fb92b 100644 --- a/components/style/properties/shorthands/text.mako.rs +++ b/components/style/properties/shorthands/text.mako.rs @@ -11,10 +11,10 @@ spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration"> % if product == "gecko": - use values::specified; - use properties::longhands::{text_decoration_line, text_decoration_style, text_decoration_color}; + use crate::values::specified; + use crate::properties::longhands::{text_decoration_line, text_decoration_style, text_decoration_color}; % else: - use properties::longhands::text_decoration_line; + use crate::properties::longhands::text_decoration_line; % endif pub fn parse_value<'i, 't>( |