From 4f44b1c6b1bec49580b65abce1b755a3de7d247b Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Sun, 24 Mar 2019 23:13:52 +0100 Subject: [PATCH] style: Add an inherited internal UA sheet property (-moz-list-reversed:true|false) to propagate
    to its relevant descendants. Bug: 288704 Reviewed-by: emilio --- components/style/cbindgen.toml | 1 + components/style/properties/data.py | 1 + components/style/properties/gecko.mako.rs | 1 + components/style/properties/longhands/list.mako.rs | 12 ++++++++++++ components/style/values/computed/list.rs | 1 + components/style/values/computed/mod.rs | 1 + components/style/values/specified/list.rs | 10 ++++++++++ components/style/values/specified/mod.rs | 1 + 8 files changed, 28 insertions(+) diff --git a/components/style/cbindgen.toml b/components/style/cbindgen.toml index b5d374d77bfe..54288dff7adb 100644 --- a/components/style/cbindgen.toml +++ b/components/style/cbindgen.toml @@ -108,6 +108,7 @@ include = [ "TouchAction", "WillChangeBits", "TextDecorationLine", + "MozListReversed", ] item_types = ["enums", "structs", "typedefs"] diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 9347d9b94288..52cdcf15d22b 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -324,6 +324,7 @@ def specified_is_copy(self): "JustifyItems", "JustifySelf", "MozForceBrokenImageIcon", + "MozListReversed", "MozScriptLevel", "MozScriptMinSize", "MozScriptSizeMultiplier", diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index e3bd2ea559f8..7c5f4a94c011 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1247,6 +1247,7 @@ impl Clone for ${style_struct.gecko_struct_name} { "Length": impl_absolute_length, "LengthOrNormal": impl_style_coord, "LengthPercentageOrAuto": impl_style_coord, + "MozListReversed": impl_simple, "MozScriptMinSize": impl_absolute_length, "RGBAColor": impl_rgba_color, "SVGLength": impl_svg_length, diff --git a/components/style/properties/longhands/list.mako.rs b/components/style/properties/longhands/list.mako.rs index 4b368ea2ba52..6d79d3ad9ee7 100644 --- a/components/style/properties/longhands/list.mako.rs +++ b/components/style/properties/longhands/list.mako.rs @@ -68,3 +68,15 @@ ${helpers.predefined_type( boxed=True, spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)", )} + +${helpers.predefined_type( + "-moz-list-reversed", + "MozListReversed", + "computed::MozListReversed::False", + animation_value_type="discrete", + products="gecko", + enabled_in="ua", + needs_context=False, + spec="Internal implementation detail for
      ", + servo_restyle_damage="rebuild_and_reflow", +)} diff --git a/components/style/values/computed/list.rs b/components/style/values/computed/list.rs index 622c021554ff..2bde35e3b6b3 100644 --- a/components/style/values/computed/list.rs +++ b/components/style/values/computed/list.rs @@ -6,6 +6,7 @@ #[cfg(feature = "gecko")] pub use crate::values::specified::list::ListStyleType; +pub use crate::values::specified::list::MozListReversed; pub use crate::values::specified::list::{QuotePair, Quotes}; use servo_arc::Arc; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 184bac3b12ac..4c92218e69bb 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -64,6 +64,7 @@ pub use self::length::{LengthOrAuto, LengthPercentageOrAuto, MaxSize, Size}; pub use self::length::{NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto}; #[cfg(feature = "gecko")] pub use self::list::ListStyleType; +pub use self::list::MozListReversed; pub use self::list::{QuotePair, Quotes}; pub use self::motion::OffsetPath; pub use self::outline::OutlineStyle; diff --git a/components/style/values/specified/list.rs b/components/style/values/specified/list.rs index b37ade47081a..d75455a1c71e 100644 --- a/components/style/values/specified/list.rs +++ b/components/style/values/specified/list.rs @@ -123,3 +123,13 @@ impl Parse for Quotes { } } } + +/// Specified and computed `-moz-list-reversed` property (for UA sheets only). +#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)] +#[repr(u8)] +pub enum MozListReversed { + /// the initial value + False, + /// exclusively used for
        in our html.css UA sheet + True, +} diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index e673005f3e66..919cb0cb3416 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -66,6 +66,7 @@ pub use self::length::{NoCalcLength, ViewportPercentageLength}; pub use self::length::{NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto}; #[cfg(feature = "gecko")] pub use self::list::ListStyleType; +pub use self::list::MozListReversed; pub use self::list::{QuotePair, Quotes}; pub use self::motion::OffsetPath; pub use self::outline::OutlineStyle;