style: Make color-adjust an alias of print-color-adjust as per spec

Differential Revision: https://phabricator.services.mozilla.com/D134779
This commit is contained in:
Emilio Cobos Álvarez 2023-06-06 23:28:52 +02:00 committed by Oriol Brufau
parent fcc55f2156
commit 01e43a8488
6 changed files with 20 additions and 10 deletions

View file

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

View file

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

View file

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

View file

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