mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: Move image-rendering out of mako
It's easier to touch in the future that way, even though the derive list is massive. Differential Revision: https://phabricator.services.mozilla.com/D124377
This commit is contained in:
parent
5f5ea8603d
commit
036056d2a9
6 changed files with 44 additions and 10 deletions
|
@ -476,6 +476,7 @@ class Longhand(Property):
|
||||||
"FontWeight",
|
"FontWeight",
|
||||||
"GreaterThanOrEqualToOneNumber",
|
"GreaterThanOrEqualToOneNumber",
|
||||||
"GridAutoFlow",
|
"GridAutoFlow",
|
||||||
|
"ImageRendering",
|
||||||
"InitialLetter",
|
"InitialLetter",
|
||||||
"Integer",
|
"Integer",
|
||||||
"JustifyContent",
|
"JustifyContent",
|
||||||
|
|
|
@ -69,17 +69,13 @@ ${helpers.single_keyword(
|
||||||
|
|
||||||
// According to to CSS-IMAGES-3, `optimizespeed` and `optimizequality` are synonyms for `auto`
|
// According to to CSS-IMAGES-3, `optimizespeed` and `optimizequality` are synonyms for `auto`
|
||||||
// And, firefox doesn't support `pixelated` yet (https://bugzilla.mozilla.org/show_bug.cgi?id=856337)
|
// And, firefox doesn't support `pixelated` yet (https://bugzilla.mozilla.org/show_bug.cgi?id=856337)
|
||||||
${helpers.single_keyword(
|
${helpers.predefined_type(
|
||||||
"image-rendering",
|
"image-rendering",
|
||||||
"auto crisp-edges",
|
"ImageRendering",
|
||||||
|
"computed::ImageRendering::Auto",
|
||||||
engines="gecko servo-2013 servo-2020",
|
engines="gecko servo-2013 servo-2020",
|
||||||
extra_gecko_values="optimizespeed optimizequality",
|
|
||||||
extra_servo_2013_values="pixelated",
|
|
||||||
extra_servo_2020_values="pixelated",
|
|
||||||
gecko_aliases="-moz-crisp-edges=crisp-edges",
|
|
||||||
gecko_enum_prefix="StyleImageRendering",
|
|
||||||
animation_value_type="discrete",
|
|
||||||
spec="https://drafts.csswg.org/css-images/#propdef-image-rendering",
|
spec="https://drafts.csswg.org/css-images/#propdef-image-rendering",
|
||||||
|
animation_value_type="discrete",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${helpers.single_keyword(
|
${helpers.single_keyword(
|
||||||
|
|
|
@ -24,6 +24,8 @@ use std::f32::consts::PI;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
use style_traits::{CssWriter, ToCss};
|
use style_traits::{CssWriter, ToCss};
|
||||||
|
|
||||||
|
pub use specified::ImageRendering;
|
||||||
|
|
||||||
/// Computed values for an image according to CSS-IMAGES.
|
/// Computed values for an image according to CSS-IMAGES.
|
||||||
/// <https://drafts.csswg.org/css-images/#image-values>
|
/// <https://drafts.csswg.org/css-images/#image-values>
|
||||||
pub type Image =
|
pub type Image =
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub use self::font::{FontSize, FontSizeAdjust, FontStretch, FontSynthesis};
|
||||||
pub use self::font::{FontVariantAlternates, FontWeight};
|
pub use self::font::{FontVariantAlternates, FontWeight};
|
||||||
pub use self::font::{FontVariantEastAsian, FontVariationSettings};
|
pub use self::font::{FontVariantEastAsian, FontVariationSettings};
|
||||||
pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
|
pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
|
||||||
pub use self::image::{Gradient, Image, LineDirection, MozImageRect};
|
pub use self::image::{Gradient, Image, LineDirection, MozImageRect, ImageRendering};
|
||||||
pub use self::length::{CSSPixelLength, NonNegativeLength};
|
pub use self::length::{CSSPixelLength, NonNegativeLength};
|
||||||
pub use self::length::{Length, LengthOrNumber, LengthPercentage, NonNegativeLengthOrNumber};
|
pub use self::length::{Length, LengthOrNumber, LengthPercentage, NonNegativeLengthOrNumber};
|
||||||
pub use self::length::{LengthOrAuto, LengthPercentageOrAuto, MaxSize, Size};
|
pub use self::length::{LengthOrAuto, LengthPercentageOrAuto, MaxSize, Size};
|
||||||
|
|
|
@ -1226,3 +1226,38 @@ impl MozImageRect {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// https://drafts.csswg.org/css-images/#propdef-image-rendering
|
||||||
|
#[allow(missing_docs)]
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
Hash,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToCss,
|
||||||
|
ToComputedValue,
|
||||||
|
ToResolvedValue,
|
||||||
|
ToShmem,
|
||||||
|
)]
|
||||||
|
#[repr(u8)]
|
||||||
|
pub enum ImageRendering {
|
||||||
|
Auto,
|
||||||
|
#[parse(aliases = "-moz-crisp-edges")]
|
||||||
|
CrispEdges,
|
||||||
|
// From the spec:
|
||||||
|
//
|
||||||
|
// This property previously accepted the values optimizeSpeed and
|
||||||
|
// optimizeQuality. These are now deprecated; a user agent must accept
|
||||||
|
// them as valid values but must treat them as having the same behavior
|
||||||
|
// as crisp-edges and smooth respectively, and authors must not use
|
||||||
|
// them.
|
||||||
|
Optimizespeed,
|
||||||
|
Optimizequality,
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
Pixelated,
|
||||||
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ pub use self::font::{FontVariantAlternates, FontWeight};
|
||||||
pub use self::font::{FontVariantEastAsian, FontVariationSettings};
|
pub use self::font::{FontVariantEastAsian, FontVariationSettings};
|
||||||
pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
|
pub use self::font::{MathDepth, MozScriptMinSize, MozScriptSizeMultiplier, XLang, XTextZoom};
|
||||||
pub use self::image::{EndingShape as GradientEndingShape, Gradient};
|
pub use self::image::{EndingShape as GradientEndingShape, Gradient};
|
||||||
pub use self::image::{Image, MozImageRect};
|
pub use self::image::{Image, MozImageRect, ImageRendering};
|
||||||
pub use self::length::{AbsoluteLength, CalcLengthPercentage, CharacterWidth};
|
pub use self::length::{AbsoluteLength, CalcLengthPercentage, CharacterWidth};
|
||||||
pub use self::length::{FontRelativeLength, Length, LengthOrNumber, NonNegativeLengthOrNumber};
|
pub use self::length::{FontRelativeLength, Length, LengthOrNumber, NonNegativeLengthOrNumber};
|
||||||
pub use self::length::{LengthOrAuto, LengthPercentage, LengthPercentageOrAuto};
|
pub use self::length::{LengthOrAuto, LengthPercentage, LengthPercentageOrAuto};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue