Use 2018-style paths in code generated by Mako

This commit is contained in:
Simon Sapin 2018-11-01 11:50:25 +01:00
parent ede79a6a5d
commit e1fcffb336
26 changed files with 598 additions and 597 deletions

View file

@ -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 => {

View file

@ -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;

View file

@ -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",

View file

@ -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:

View file

@ -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",
)}

View file

@ -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",

View file

@ -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",

View file

@ -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