aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/data.py1
-rw-r--r--components/style/properties/longhands/inherited_box.mako.rs13
-rw-r--r--components/style/values/computed/color.rs2
-rw-r--r--components/style/values/computed/mod.rs2
-rw-r--r--components/style/values/specified/color.rs10
-rw-r--r--components/style/values/specified/mod.rs2
6 files changed, 20 insertions, 10 deletions
diff --git a/components/style/properties/data.py b/components/style/properties/data.py
index abcffe68e95..740815bcb38 100644
--- a/components/style/properties/data.py
+++ b/components/style/properties/data.py
@@ -501,6 +501,7 @@ class Longhand(Property):
"OverscrollBehavior",
"Percentage",
"PositiveIntegerOrNone",
+ "PrintColorAdjust",
"Resize",
"RubyPosition",
"SVGOpacity",
diff --git a/components/style/properties/longhands/inherited_box.mako.rs b/components/style/properties/longhands/inherited_box.mako.rs
index 294f36bd96f..50f385ee343 100644
--- a/components/style/properties/longhands/inherited_box.mako.rs
+++ b/components/style/properties/longhands/inherited_box.mako.rs
@@ -56,15 +56,14 @@ ${helpers.single_keyword(
spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation",
)}
-// CSS Color Module Level 4
-// https://drafts.csswg.org/css-color/
-${helpers.single_keyword(
- "color-adjust",
- "economy exact",
+${helpers.predefined_type(
+ "print-color-adjust",
+ "PrintColorAdjust",
+ "computed::PrintColorAdjust::Economy",
engines="gecko",
- gecko_enum_prefix="StyleColorAdjust",
+ aliases="color-adjust",
+ spec="https://drafts.csswg.org/css-color-adjust/#print-color-adjust",
animation_value_type="discrete",
- spec="https://drafts.csswg.org/css-color/#propdef-color-adjust",
)}
// According to to CSS-IMAGES-3, `optimizespeed` and `optimizequality` are synonyms for `auto`
diff --git a/components/style/values/computed/color.rs b/components/style/values/computed/color.rs
index 6b970181d85..7610bfbba3b 100644
--- a/components/style/values/computed/color.rs
+++ b/components/style/values/computed/color.rs
@@ -11,7 +11,7 @@ use cssparser::{Color as CSSParserColor, RGBA};
use std::fmt;
use style_traits::{CssWriter, ToCss};
-pub use crate::values::specified::color::ColorScheme;
+pub use crate::values::specified::color::{ColorScheme, PrintColorAdjust};
/// The computed value of the `color` property.
pub type ColorPropertyValue = RGBA;
diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs
index 054ec1ff410..74e78887480 100644
--- a/components/style/values/computed/mod.rs
+++ b/components/style/values/computed/mod.rs
@@ -50,7 +50,7 @@ pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty};
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
pub use self::box_::{TouchAction, VerticalAlign, WillChange};
-pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme};
+pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme, PrintColorAdjust};
pub use self::column::ColumnCount;
pub use self::counters::{Content, ContentItem, CounterIncrement, CounterReset, CounterSet};
pub use self::easing::TimingFunction;
diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs
index 550ad207578..4c0683dbce0 100644
--- a/components/style/values/specified/color.rs
+++ b/components/style/values/specified/color.rs
@@ -1006,3 +1006,13 @@ impl ToCss for ColorScheme {
Ok(())
}
}
+
+/// https://drafts.csswg.org/css-color-adjust/#print-color-adjust
+#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToComputedValue, ToResolvedValue, ToShmem)]
+#[repr(u8)]
+pub enum PrintColorAdjust {
+ /// Ignore backgrounds and darken text.
+ Economy,
+ /// Respect specified colors.
+ Exact,
+}
diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs
index 78da87d4ceb..099b06a48b3 100644
--- a/components/style/values/specified/mod.rs
+++ b/components/style/values/specified/mod.rs
@@ -42,7 +42,7 @@ pub use self::box_::{Clear, Float, Overflow, OverflowAnchor};
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
pub use self::box_::{TouchAction, TransitionProperty, VerticalAlign, WillChange};
-pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme};
+pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme, PrintColorAdjust};
pub use self::column::ColumnCount;
pub use self::counters::{Content, ContentItem, CounterIncrement, CounterReset, CounterSet};
pub use self::easing::TimingFunction;