mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords in color components where allowed. We store the none values as 0.0 (as per the spec) and mark the components with the flags. This way we don't have to check anything on the components before doing calculations. As this is the last part intended to be released for the new [color-4] changes, I've also enabled the changes on nightly. Differential Revision: https://phabricator.services.mozilla.com/D170208
This commit is contained in:
parent
f8273e1c13
commit
56e7e7777d
@ -122,7 +122,7 @@ replace-with = "vendored-sources"
|
||||
|
||||
[source."https://github.com/servo/rust-cssparser"]
|
||||
git = "https://github.com/servo/rust-cssparser"
|
||||
rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb"
|
||||
rev = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
|
||||
|
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -1104,7 +1104,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cssparser"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
|
||||
source = "git+https://github.com/servo/rust-cssparser?rev=45bc47e2bcb846f1efb5aea156be5fe7d18624bf#45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
|
||||
dependencies = [
|
||||
"cssparser-macros",
|
||||
"dtoa-short",
|
||||
@ -1119,7 +1119,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cssparser-macros"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
|
||||
source = "git+https://github.com/servo/rust-cssparser?rev=45bc47e2bcb846f1efb5aea156be5fe7d18624bf#45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
|
@ -167,7 +167,7 @@ minidump-writer = { git = "https://github.com/rust-minidump/minidump-writer.git"
|
||||
# warp 0.3.3 + https://github.com/seanmonstar/warp/pull/1007
|
||||
warp = { git = "https://github.com/glandium/warp", rev = "4af45fae95bc98b0eba1ef0db17e1dac471bb23d" }
|
||||
|
||||
cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb" }
|
||||
cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf" }
|
||||
|
||||
# application-services overrides to make updating them all simpler.
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
|
||||
|
@ -8899,7 +8899,7 @@
|
||||
# Enable experimental enhanced color CSS color spaces. (lab(), lch(), oklab(), oklch(), color())
|
||||
- name: layout.css.more_color_4.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: false
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
rust: true
|
||||
|
||||
|
@ -68,6 +68,7 @@ fn hue_to_rgb(t1: f32, t2: f32, hue: f32) -> f32 {
|
||||
}
|
||||
|
||||
/// Convert from HSL notation to RGB notation.
|
||||
/// https://drafts.csswg.org/css-color-4/#hsl-to-rgb
|
||||
#[inline]
|
||||
pub fn hsl_to_rgb(from: &ColorComponents) -> ColorComponents {
|
||||
let ColorComponents(hue, saturation, lightness) = *from;
|
||||
@ -87,26 +88,26 @@ pub fn hsl_to_rgb(from: &ColorComponents) -> ColorComponents {
|
||||
}
|
||||
|
||||
/// Convert from RGB notation to HSL notation.
|
||||
/// https://drafts.csswg.org/css-color/#rgb-to-hsl
|
||||
/// https://drafts.csswg.org/css-color-4/#rgb-to-hsl
|
||||
pub fn rgb_to_hsl(from: &ColorComponents) -> ColorComponents {
|
||||
let ColorComponents(red, green, blue) = *from;
|
||||
|
||||
let (hue, min, max) = rgb_to_hue_min_max(red, green, blue);
|
||||
|
||||
let light = (min + max) / 2.0;
|
||||
let lightness = (min + max) / 2.0;
|
||||
let delta = max - min;
|
||||
|
||||
let sat = if delta != 0.0 {
|
||||
if light == 0.0 || light == 1.0 {
|
||||
let saturation = if delta != 0.0 {
|
||||
if lightness == 0.0 || lightness == 1.0 {
|
||||
0.0
|
||||
} else {
|
||||
(max - light) / light.min(1.0 - light)
|
||||
(max - lightness) / lightness.min(1.0 - lightness)
|
||||
}
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
ColorComponents(hue, sat, light)
|
||||
ColorComponents(hue, saturation, lightness)
|
||||
}
|
||||
|
||||
/// Convert from HWB notation to RGB notation.
|
||||
@ -138,6 +139,30 @@ pub fn rgb_to_hwb(from: &ColorComponents) -> ColorComponents {
|
||||
ColorComponents(hue, whiteness, blackness)
|
||||
}
|
||||
|
||||
/// Convert from Lab to Lch. This calculation works for both Lab and Olab.
|
||||
/// <https://drafts.csswg.org/css-color-4/#color-conversion-code>
|
||||
#[inline]
|
||||
pub fn lab_to_lch(from: &ColorComponents) -> ColorComponents {
|
||||
let ColorComponents(lightness, a, b) = *from;
|
||||
|
||||
let hue = normalize_hue(b.atan2(a) * 180.0 / PI);
|
||||
let chroma = (a.powf(2.0) + b.powf(2.0)).sqrt();
|
||||
|
||||
ColorComponents(lightness, chroma, hue)
|
||||
}
|
||||
|
||||
/// Convert from Lch to Lab. This calculation works for both Lch and Oklch.
|
||||
/// <https://drafts.csswg.org/css-color-4/#color-conversion-code>
|
||||
#[inline]
|
||||
pub fn lch_to_lab(from: &ColorComponents) -> ColorComponents {
|
||||
let ColorComponents(lightness, chroma, hue) = *from;
|
||||
|
||||
let a = chroma * (hue * PI / 180.0).cos();
|
||||
let b = chroma * (hue * PI / 180.0).sin();
|
||||
|
||||
ColorComponents(lightness, a, b)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn transform(from: &ColorComponents, mat: &Transform) -> ColorComponents {
|
||||
let result = mat.transform_vector3d(Vector::new(from.0, from.1, from.2));
|
||||
@ -305,6 +330,56 @@ impl ColorSpaceConversion for Srgb {
|
||||
}
|
||||
}
|
||||
|
||||
/// Color specified with hue, saturation and lightness components.
|
||||
pub struct Hsl;
|
||||
|
||||
impl ColorSpaceConversion for Hsl {
|
||||
const WHITE_POINT: WhitePoint = Srgb::WHITE_POINT;
|
||||
|
||||
fn to_linear_light(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::to_linear_light(&hsl_to_rgb(from))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_xyz(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::to_xyz(from)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_xyz(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::from_xyz(from)
|
||||
}
|
||||
|
||||
fn to_gamma_encoded(from: &ColorComponents) -> ColorComponents {
|
||||
rgb_to_hsl(&Srgb::to_gamma_encoded(from))
|
||||
}
|
||||
}
|
||||
|
||||
/// Color specified with hue, whiteness and blackness components.
|
||||
pub struct Hwb;
|
||||
|
||||
impl ColorSpaceConversion for Hwb {
|
||||
const WHITE_POINT: WhitePoint = Srgb::WHITE_POINT;
|
||||
|
||||
fn to_linear_light(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::to_linear_light(&hwb_to_rgb(from))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_xyz(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::to_xyz(from)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_xyz(from: &ColorComponents) -> ColorComponents {
|
||||
Srgb::from_xyz(from)
|
||||
}
|
||||
|
||||
fn to_gamma_encoded(from: &ColorComponents) -> ColorComponents {
|
||||
rgb_to_hwb(&Srgb::to_gamma_encoded(from))
|
||||
}
|
||||
}
|
||||
|
||||
/// The same as sRGB color space, except the transfer function is linear light.
|
||||
/// https://drafts.csswg.org/csswg-drafts/css-color-4/#predefined-sRGB-linear
|
||||
pub struct SrgbLinear;
|
||||
|
@ -26,11 +26,6 @@ impl ColorComponents {
|
||||
/// A color space representation in the CSS specification.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-color-4/#typedef-color-space
|
||||
///
|
||||
/// NOTE: Right now HSL and HWB colors can not be constructed by the user. They
|
||||
/// are converted to RGB in the parser. The parser should return the
|
||||
/// HSL/HWB values as is to avoid unnescessary conversions to/from RGB.
|
||||
/// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1817035
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
@ -138,7 +133,15 @@ bitflags! {
|
||||
pub struct SerializationFlags : u8 {
|
||||
/// If set, serializes sRGB colors into `color(srgb ...)` instead of
|
||||
/// `rgba(...)`.
|
||||
const AS_COLOR_FUNCTION = 0x01;
|
||||
const AS_COLOR_FUNCTION = 1 << 0;
|
||||
/// Whether the 1st color component is `none`.
|
||||
const C1_IS_NONE = 1 << 1;
|
||||
/// Whether the 2nd color component is `none`.
|
||||
const C2_IS_NONE = 1 << 2;
|
||||
/// Whether the 3rd color component is `none`.
|
||||
const C3_IS_NONE = 1 << 3;
|
||||
/// Whether the alpha component is `none`.
|
||||
const ALPHA_IS_NONE = 1 << 4;
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,20 +262,69 @@ impl AbsoluteColor {
|
||||
return self.clone();
|
||||
}
|
||||
|
||||
// We have simplified conversions that do not need to convert to XYZ
|
||||
// first. This improves performance, because it skips 2 matrix
|
||||
// multiplications and reduces float rounding errors.
|
||||
match (self.color_space, color_space) {
|
||||
(Srgb, Hsl) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::rgb_to_hsl(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
(Srgb, Hwb) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::rgb_to_hwb(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
(Hsl, Srgb) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::hsl_to_rgb(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
(Hwb, Srgb) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::hwb_to_rgb(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
(Lab, Lch) | (Oklab, Oklch) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::lab_to_lch(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
(Lch, Lab) | (Oklch, Oklab) => {
|
||||
return Self::new(
|
||||
color_space,
|
||||
convert::lch_to_lab(&self.components),
|
||||
self.alpha,
|
||||
);
|
||||
},
|
||||
|
||||
_ => {},
|
||||
}
|
||||
|
||||
let (xyz, white_point) = match self.color_space {
|
||||
Hsl => {
|
||||
let rgb = convert::hsl_to_rgb(&self.components);
|
||||
convert::to_xyz::<convert::Srgb>(&rgb)
|
||||
},
|
||||
Hwb => {
|
||||
let rgb = convert::hwb_to_rgb(&self.components);
|
||||
convert::to_xyz::<convert::Srgb>(&rgb)
|
||||
},
|
||||
Lab => convert::to_xyz::<convert::Lab>(&self.components),
|
||||
Lch => convert::to_xyz::<convert::Lch>(&self.components),
|
||||
Oklab => convert::to_xyz::<convert::Oklab>(&self.components),
|
||||
Oklch => convert::to_xyz::<convert::Oklch>(&self.components),
|
||||
Srgb => convert::to_xyz::<convert::Srgb>(&self.components),
|
||||
Hsl => convert::to_xyz::<convert::Hsl>(&self.components),
|
||||
Hwb => convert::to_xyz::<convert::Hwb>(&self.components),
|
||||
SrgbLinear => convert::to_xyz::<convert::SrgbLinear>(&self.components),
|
||||
DisplayP3 => convert::to_xyz::<convert::DisplayP3>(&self.components),
|
||||
A98Rgb => convert::to_xyz::<convert::A98Rgb>(&self.components),
|
||||
@ -283,19 +335,13 @@ impl AbsoluteColor {
|
||||
};
|
||||
|
||||
let result = match color_space {
|
||||
Hsl => {
|
||||
let rgb = convert::from_xyz::<convert::Srgb>(&xyz, white_point);
|
||||
convert::rgb_to_hsl(&rgb)
|
||||
},
|
||||
Hwb => {
|
||||
let rgb = convert::from_xyz::<convert::Srgb>(&xyz, white_point);
|
||||
convert::rgb_to_hwb(&rgb)
|
||||
},
|
||||
Lab => convert::from_xyz::<convert::Lab>(&xyz, white_point),
|
||||
Lch => convert::from_xyz::<convert::Lch>(&xyz, white_point),
|
||||
Oklab => convert::from_xyz::<convert::Oklab>(&xyz, white_point),
|
||||
Oklch => convert::from_xyz::<convert::Oklch>(&xyz, white_point),
|
||||
Srgb => convert::from_xyz::<convert::Srgb>(&xyz, white_point),
|
||||
Hsl => convert::from_xyz::<convert::Hsl>(&xyz, white_point),
|
||||
Hwb => convert::from_xyz::<convert::Hwb>(&xyz, white_point),
|
||||
SrgbLinear => convert::from_xyz::<convert::SrgbLinear>(&xyz, white_point),
|
||||
DisplayP3 => convert::from_xyz::<convert::DisplayP3>(&xyz, white_point),
|
||||
A98Rgb => convert::from_xyz::<convert::A98Rgb>(&xyz, white_point),
|
||||
@ -329,6 +375,21 @@ impl ToCss for AbsoluteColor {
|
||||
where
|
||||
W: Write,
|
||||
{
|
||||
macro_rules! value_or_none {
|
||||
($v:expr,$flag:tt) => {{
|
||||
if self.flags.contains(SerializationFlags::$flag) {
|
||||
None
|
||||
} else {
|
||||
Some($v)
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
let maybe_c1 = value_or_none!(self.components.0, C1_IS_NONE);
|
||||
let maybe_c2 = value_or_none!(self.components.1, C2_IS_NONE);
|
||||
let maybe_c3 = value_or_none!(self.components.2, C3_IS_NONE);
|
||||
let maybe_alpha = value_or_none!(self.alpha, ALPHA_IS_NONE);
|
||||
|
||||
match self.color_space {
|
||||
ColorSpace::Hsl => {
|
||||
let rgb = convert::hsl_to_rgb(&self.components);
|
||||
@ -342,30 +403,28 @@ impl ToCss for AbsoluteColor {
|
||||
},
|
||||
|
||||
ColorSpace::Srgb if !self.flags.contains(SerializationFlags::AS_COLOR_FUNCTION) => {
|
||||
// Althought we are passing Option<_> in here, the to_css fn
|
||||
// knows that the "none" keyword is not supported in the
|
||||
// rgb/rgba legacy syntax.
|
||||
cssparser::ToCss::to_css(
|
||||
&cssparser::RGBA::from_floats(
|
||||
self.components.0,
|
||||
self.components.1,
|
||||
self.components.2,
|
||||
self.alpha(),
|
||||
),
|
||||
&cssparser::RGBA::from_floats(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
|
||||
dest,
|
||||
)
|
||||
},
|
||||
ColorSpace::Lab => cssparser::ToCss::to_css(
|
||||
unsafe { color_components_as!(self, cssparser::Lab) },
|
||||
&cssparser::Lab::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
|
||||
dest,
|
||||
),
|
||||
ColorSpace::Lch => cssparser::ToCss::to_css(
|
||||
unsafe { color_components_as!(self, cssparser::Lch) },
|
||||
&cssparser::Lch::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
|
||||
dest,
|
||||
),
|
||||
ColorSpace::Oklab => cssparser::ToCss::to_css(
|
||||
unsafe { color_components_as!(self, cssparser::Oklab) },
|
||||
&cssparser::Oklab::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
|
||||
dest,
|
||||
),
|
||||
ColorSpace::Oklch => cssparser::ToCss::to_css(
|
||||
unsafe { color_components_as!(self, cssparser::Oklch) },
|
||||
&cssparser::Oklch::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
|
||||
dest,
|
||||
),
|
||||
_ => {
|
||||
@ -393,10 +452,10 @@ impl ToCss for AbsoluteColor {
|
||||
|
||||
let color_function = cssparser::ColorFunction {
|
||||
color_space,
|
||||
c1: self.components.0,
|
||||
c2: self.components.1,
|
||||
c3: self.components.2,
|
||||
alpha: self.alpha,
|
||||
c1: maybe_c1,
|
||||
c2: maybe_c2,
|
||||
c3: maybe_c3,
|
||||
alpha: maybe_alpha,
|
||||
};
|
||||
let color = cssparser::Color::ColorFunction(color_function);
|
||||
cssparser::ToCss::to_css(&color, dest)
|
||||
|
@ -14,7 +14,7 @@ use crate::values::generics::color::{GenericCaretColor, GenericColorMix, Generic
|
||||
use crate::values::specified::calc::CalcNode;
|
||||
use crate::values::specified::Percentage;
|
||||
use crate::values::CustomIdent;
|
||||
use cssparser::{AngleOrNumber, Color as CSSParserColor, Parser, Token, RGBA};
|
||||
use cssparser::{AngleOrNumber, Color as CSSParserColor, Parser, Token};
|
||||
use cssparser::{BasicParseErrorKind, NumberOrPercentage, ParseErrorKind};
|
||||
use itoa;
|
||||
use std::fmt::{self, Write};
|
||||
@ -393,9 +393,35 @@ impl SystemColor {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn new_absolute(color_space: ColorSpace, c1: f32, c2: f32, c3: f32, alpha: f32) -> Color {
|
||||
fn new_absolute(
|
||||
color_space: ColorSpace,
|
||||
c1: Option<f32>,
|
||||
c2: Option<f32>,
|
||||
c3: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Color {
|
||||
let mut flags = SerializationFlags::empty();
|
||||
|
||||
macro_rules! c {
|
||||
($v:expr,$flag:tt) => {{
|
||||
if let Some(value) = $v {
|
||||
value
|
||||
} else {
|
||||
flags |= SerializationFlags::$flag;
|
||||
0.0
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
let c1 = c!(c1, C1_IS_NONE);
|
||||
let c2 = c!(c2, C2_IS_NONE);
|
||||
let c3 = c!(c3, C3_IS_NONE);
|
||||
let alpha = c!(alpha, ALPHA_IS_NONE);
|
||||
|
||||
let mut color = AbsoluteColor::new(color_space, ColorComponents(c1, c2, c3), alpha);
|
||||
color.flags |= flags;
|
||||
Color::Absolute(Box::new(Absolute {
|
||||
color: AbsoluteColor::new(color_space, ColorComponents(c1, c2, c3), alpha),
|
||||
color,
|
||||
authored: None,
|
||||
}))
|
||||
}
|
||||
@ -405,38 +431,76 @@ impl cssparser::FromParsedColor for Color {
|
||||
Color::CurrentColor
|
||||
}
|
||||
|
||||
fn from_rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Self {
|
||||
fn from_rgba(red: Option<u8>, green: Option<u8>, blue: Option<u8>, alpha: Option<f32>) -> Self {
|
||||
new_absolute(
|
||||
ColorSpace::Srgb,
|
||||
red as f32 / 255.0,
|
||||
green as f32 / 255.0,
|
||||
blue as f32 / 255.0,
|
||||
red.map(|r| r as f32 / 255.0),
|
||||
green.map(|g| g as f32 / 255.0),
|
||||
blue.map(|b| b as f32 / 255.0),
|
||||
alpha,
|
||||
)
|
||||
}
|
||||
|
||||
fn from_lab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
|
||||
fn from_hsl(
|
||||
hue: Option<f32>,
|
||||
saturation: Option<f32>,
|
||||
lightness: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Hsl, hue, saturation, lightness, alpha)
|
||||
}
|
||||
|
||||
fn from_hwb(
|
||||
hue: Option<f32>,
|
||||
whiteness: Option<f32>,
|
||||
blackness: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Hwb, hue, whiteness, blackness, alpha)
|
||||
}
|
||||
|
||||
fn from_lab(
|
||||
lightness: Option<f32>,
|
||||
a: Option<f32>,
|
||||
b: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Lab, lightness, a, b, alpha)
|
||||
}
|
||||
|
||||
fn from_lch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
|
||||
fn from_lch(
|
||||
lightness: Option<f32>,
|
||||
chroma: Option<f32>,
|
||||
hue: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Lch, lightness, chroma, hue, alpha)
|
||||
}
|
||||
|
||||
fn from_oklab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
|
||||
fn from_oklab(
|
||||
lightness: Option<f32>,
|
||||
a: Option<f32>,
|
||||
b: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Oklab, lightness, a, b, alpha)
|
||||
}
|
||||
|
||||
fn from_oklch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
|
||||
fn from_oklch(
|
||||
lightness: Option<f32>,
|
||||
chroma: Option<f32>,
|
||||
hue: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
new_absolute(ColorSpace::Oklch, lightness, chroma, hue, alpha)
|
||||
}
|
||||
|
||||
fn from_color_function(
|
||||
color_space: cssparser::PredefinedColorSpace,
|
||||
c1: f32,
|
||||
c2: f32,
|
||||
c3: f32,
|
||||
alpha: f32,
|
||||
c1: Option<f32>,
|
||||
c2: Option<f32>,
|
||||
c3: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
let mut result = new_absolute(color_space.into(), c1, c2, c3, alpha);
|
||||
if let Color::Absolute(ref mut absolute) = result {
|
||||
@ -553,14 +617,17 @@ impl Color {
|
||||
Ok(mut color) => {
|
||||
if let Color::Absolute(ref mut absolute) = color {
|
||||
let enabled = {
|
||||
let is_srgb = matches!(absolute.color.color_space, ColorSpace::Srgb);
|
||||
let is_legacy_color = matches!(
|
||||
absolute.color.color_space,
|
||||
ColorSpace::Srgb | ColorSpace::Hsl
|
||||
);
|
||||
let is_color_function = absolute
|
||||
.color
|
||||
.flags
|
||||
.contains(SerializationFlags::AS_COLOR_FUNCTION);
|
||||
let pref_enabled = static_prefs::pref!("layout.css.more_color_4.enabled");
|
||||
|
||||
(is_srgb && !is_color_function) || pref_enabled
|
||||
(is_legacy_color && !is_color_function) || pref_enabled
|
||||
};
|
||||
if !enabled {
|
||||
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
@ -712,23 +779,14 @@ impl Color {
|
||||
if !allow_quirks.allowed(context.quirks_mode) {
|
||||
return Err(e);
|
||||
}
|
||||
Color::parse_quirky_color(input)
|
||||
.map(|rgba| {
|
||||
Color::from_absolute_color(AbsoluteColor::srgb(
|
||||
rgba.red as f32 / 255.0,
|
||||
rgba.green as f32 / 255.0,
|
||||
rgba.blue as f32 / 255.0,
|
||||
rgba.alpha, // alpha value is already a float and in range [0..1]
|
||||
))
|
||||
})
|
||||
.map_err(|_| e)
|
||||
Color::parse_quirky_color(input).map_err(|_| e)
|
||||
})
|
||||
}
|
||||
|
||||
/// Parse a <quirky-color> value.
|
||||
///
|
||||
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
||||
fn parse_quirky_color<'i, 't>(input: &mut Parser<'i, 't>) -> Result<RGBA, ParseError<'i>> {
|
||||
fn parse_quirky_color<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
let location = input.current_source_location();
|
||||
let (value, unit) = match *input.next()? {
|
||||
Token::Number {
|
||||
@ -744,7 +802,7 @@ impl Color {
|
||||
if ident.len() != 3 && ident.len() != 6 {
|
||||
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
}
|
||||
return RGBA::parse_hash(ident.as_bytes()).map_err(|()| {
|
||||
return cssparser::parse_hash_color(ident.as_bytes()).map_err(|()| {
|
||||
location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
|
||||
});
|
||||
},
|
||||
@ -789,7 +847,7 @@ impl Color {
|
||||
.unwrap();
|
||||
}
|
||||
debug_assert_eq!(written, 6);
|
||||
RGBA::parse_hash(&serialization)
|
||||
cssparser::parse_hash_color(&serialization)
|
||||
.map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
|
||||
}
|
||||
}
|
||||
|
@ -454,6 +454,12 @@ Trivial crate with a single proc macro to compute the max length of the inputs
|
||||
to a match expression.
|
||||
"""
|
||||
|
||||
[[audits.cssparser-macros]]
|
||||
who = "Tiaan Louw <tlouw@mozilla.com>"
|
||||
criteria = "safe-to-deploy"
|
||||
delta = "0.6.0 -> 0.6.0@git:45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
|
||||
notes = "Latest version of changes to the cssparser pulled from master branch."
|
||||
|
||||
[[audits.cssparser-macros]]
|
||||
who = "Tiaan Louw <tlouw@mozilla.com>"
|
||||
criteria = "safe-to-deploy"
|
||||
|
@ -1,354 +1,3 @@
|
||||
[color-computed-color-function.html]
|
||||
[Property color value 'color(srgb none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 10% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 0.2 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 0.2 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 0.2 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb none none none)' [sRGB all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 1.00 none 0.2)' [sRGB number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 100% none 20%)' [sRGB percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 100% none 0.2)' [sRGB number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb none none none / none)' [sRGB with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 1.00 none 0.2 / none)' [sRGB with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 100% none 20% / 30%)' [sRGB with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb 100% none 0.2 / 23.7%)' [sRGB with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear none none none)' [Linear-light sRGB all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 1.00 none 0.2)' [Linear-light sRGB number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 100% none 20%)' [Linear-light sRGB percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 100% none 0.2)' [Linear-light sRGB number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear none none none / none)' [Linear-light sRGB with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 1.00 none 0.2 / none)' [Linear-light sRGB with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 100% none 20% / 30%)' [Linear-light sRGB with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(srgb-linear 100% none 0.2 / 23.7%)' [Linear-light sRGB with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 none none none)' [Display P3 all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 1.00 none 0.2)' [Display P3 number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 100% none 20%)' [Display P3 percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 100% none 0.2)' [Display P3 number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 none none none / none)' [Display P3 with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 1.00 none 0.2 / none)' [Display P3 with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 100% none 20% / 30%)' [Display P3 with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 100% none 0.2 / 23.7%)' [Display P3 with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb none none none)' [A98 RGB all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 1.00 none 0.2)' [A98 RGB number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 100% none 20%)' [A98 RGB percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 100% none 0.2)' [A98 RGB number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb none none none / none)' [A98 RGB with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 1.00 none 0.2 / none)' [A98 RGB with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 100% none 20% / 30%)' [A98 RGB with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(a98-rgb 100% none 0.2 / 23.7%)' [A98 RGB with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb none none none)' [ProPhoto RGB all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 1.00 none 0.2)' [ProPhoto RGB number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 100% none 20%)' [ProPhoto RGB percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 100% none 0.2)' [ProPhoto RGB number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb none none none / none)' [ProPhoto RGB with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 1.00 none 0.2 / none)' [ProPhoto RGB with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 100% none 20% / 30%)' [ProPhoto RGB with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(prophoto-rgb 100% none 0.2 / 23.7%)' [ProPhoto RGB with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 none none none)' [Rec BT.2020 all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 1.00 none 0.2)' [Rec BT.2020 number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 100% none 20%)' [Rec BT.2020 percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 100% none 0.2)' [Rec BT.2020 number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 none none none / none)' [Rec BT.2020 with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 1.00 none 0.2 / none)' [Rec BT.2020 with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 100% none 20% / 30%)' [Rec BT.2020 with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(rec2020 100% none 0.2 / 23.7%)' [Rec BT.2020 with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 none none none)' [CIE XYZ D50 all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 1.00 none 0.2)' [CIE XYZ D50 number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 100% none 20%)' [CIE XYZ D50 percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 100% none 0.2)' [CIE XYZ D50 number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 none none none / none)' [CIE XYZ D50 with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 1.00 none 0.2 / none)' [CIE XYZ D50 with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 100% none 20% / 30%)' [CIE XYZ D50 with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d50 100% none 0.2 / 23.7%)' [CIE XYZ D50 with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 none none none)' [CIE XYZ D65 all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 1.00 none 0.2)' [CIE XYZ D65 number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 100% none 20%)' [CIE XYZ D65 percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 100% none 0.2)' [CIE XYZ D65 number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 none none none / none)' [CIE XYZ D65 with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 1.00 none 0.2 / none)' [CIE XYZ D65 with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 100% none 20% / 30%)' [CIE XYZ D65 with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz-d65 100% none 0.2 / 23.7%)' [CIE XYZ D65 with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz none none none)' [CIE XYZ (implicit D65) all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 1.00 none 0.2)' [CIE XYZ (implicit D65) number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 100% none 20%)' [CIE XYZ (implicit D65) percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 100% none 0.2)' [CIE XYZ (implicit D65) number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz none none none / none)' [CIE XYZ (implicit D65) with alpha, all none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 1.00 none 0.2 / none)' [CIE XYZ (implicit D65) with alpha, number and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 100% none 20% / 30%)' [CIE XYZ (implicit D65) with alpha, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(xyz 100% none 0.2 / 23.7%)' [CIE XYZ (implicit D65) with alpha, number, percent and none\]]
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color(display-p3 184 1.00001 2347329746587)' [Display P3 color with component > 1 should not clamp\]]
|
||||
expected: FAIL
|
||||
|
@ -1,7 +1,4 @@
|
||||
[color-computed-color-mix-function.html]
|
||||
[Property color value 'color-mix(in hsl, hsl(none none none), hsl(none none none))']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color-mix(in hsl, hsl(none none none), hsl(30deg 40% 80%))']
|
||||
expected: FAIL
|
||||
|
||||
@ -20,15 +17,9 @@
|
||||
[Property color value 'color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40%))']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40% / 0.5))']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40% / none))']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color-mix(in hwb, hwb(none none none), hwb(none none none))']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'color-mix(in hwb, hwb(none none none), hwb(30deg 30% 40%))']
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
[color-computed-hsl.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [TIMEOUT, OK]
|
||||
[Property color value 'hsl(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsla(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsla(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(120 none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(120 80% none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(120 none 50%)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(120 100% 50% / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hsl(none 100% 50%)']
|
||||
expected: FAIL
|
@ -1,23 +0,0 @@
|
||||
[color-computed-hwb.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[Property color value 'hwb(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(120 none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(120 80% none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(120 none 50%)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(120 30% 50% / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'hwb(none 100% 50% / none)']
|
||||
expected: FAIL
|
@ -1,62 +0,0 @@
|
||||
[color-computed-lab.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[Property color value 'lab(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lab(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lab(20 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lab(none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lab(0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklab(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklab(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklab(20 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklab(none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklab(0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lch(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lch(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lch(20 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lch(none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'lch(0 0 0 / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklch(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklch(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklch(20 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklch(none none none / 0.5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'oklch(0 0 0 / none)']
|
||||
expected: FAIL
|
@ -1,50 +0,0 @@
|
||||
[color-computed-rgb.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[Property color value 'rgb(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(128 none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(128 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(none none none / .5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(20% none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(20% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgb(none none none / 50%)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(none none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(none none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(128 none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(128 none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(none none none / .5)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(20% none none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(20% none none / none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property color value 'rgba(none none none / 50%)']
|
||||
expected: FAIL
|
@ -1,142 +1,6 @@
|
||||
[color-valid-color-function.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
|
||||
[e.style['color'\] = "color(srgb none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb-linear none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb-linear none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb-linear 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb-linear none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb-linear 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(a98-rgb none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(a98-rgb none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(a98-rgb 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(a98-rgb none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(a98-rgb 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(rec2020 none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(rec2020 none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(rec2020 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(rec2020 none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(rec2020 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(prophoto-rgb none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(prophoto-rgb none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(prophoto-rgb 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(prophoto-rgb none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(prophoto-rgb 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(display-p3 none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(display-p3 none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(display-p3 10% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(display-p3 none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(display-p3 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz 0.2 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d50 none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d50 none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d50 0.2 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d50 none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d50 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d65 none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d65 none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d65 0.2 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d65 none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(xyz-d65 0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color(srgb 0 0 0 / 300%)" should set the property value]
|
||||
expected:
|
||||
if not debug and (os == "mac"): [PASS, FAIL]
|
||||
|
@ -17,33 +17,6 @@
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 10% 20% / .4) 25%, hsl(30deg 30% 40% / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(none none none), hsl(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(none none none), hsl(30deg 40% 80%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 20% 40%), hsl(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 20% none), hsl(30deg 40% 60%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 20% 40%), hsl(30deg 20% none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(none 20% 40%), hsl(30deg none 80%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40% / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, hsl(120deg 40% 40% / none), hsl(0deg 40% 40% / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, color(display-p3 0 1 0) 100%, rgb(0, 0, 0) 0%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -89,33 +62,6 @@
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20% / .4) 25%, hwb(30deg 30% 40% / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(none none none), hwb(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(none none none), hwb(30deg 30% 40%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20%), hwb(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% none), hwb(30deg 30% 40%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20%), hwb(30deg 30% none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(none 10% 20%), hwb(30deg none 40%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20% / none), hwb(30deg 30% 40%))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20% / none), hwb(30deg 30% 40% / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, hwb(120deg 10% 20% / none), hwb(30deg 30% 40% / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hwb, color(display-p3 0 1 0) 100%, rgb(0, 0, 0) 0%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -161,33 +107,6 @@
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg / .4) 25%, lch(50 60 70deg / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(none none none), lch(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(none none none), lch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg), lch(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 none), lch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg), lch(50 60 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(none 20 30deg), lch(50 none 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg / none), lch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg / none), lch(50 60 70deg / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lch, lch(10 20 30deg / none), lch(50 60 70deg / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg), 25% oklch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -206,33 +125,6 @@
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg / .4) 25%, oklch(50 60 70deg / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(none none none), oklch(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(none none none), oklch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg), oklch(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 none), oklch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg), oklch(50 60 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(none 20 30deg), oklch(50 none 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg / none), oklch(50 60 70deg))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg / none), oklch(50 60 70deg / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklch, oklch(10 20 30deg / none), oklch(50 60 70deg / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30), 25% lab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -251,33 +143,6 @@
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30 / .4) 25%, lab(50 60 70 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(none none none), lab(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(none none none), lab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30), lab(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 none), lab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30), lab(50 60 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(none 20 30), lab(50 none 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30 / none), lab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30 / none), lab(50 60 70 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in lab, lab(10 20 30 / none), lab(50 60 70 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30), 25% oklab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -296,33 +161,6 @@
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30 / .4) 25%, oklab(50 60 70 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(none none none), oklab(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(none none none), oklab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30), oklab(none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 none), oklab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30), oklab(50 60 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(none 20 30), oklab(50 none 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30 / none), oklab(50 60 70))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30 / none), oklab(50 60 70 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in oklab, oklab(10 20 30 / none), oklab(50 60 70 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3), color(srgb .5 .6 .7) 25%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -335,33 +173,6 @@
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3 / .4) 25%, color(srgb .5 .6 .7 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb none none none), color(srgb none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb none none none), color(srgb .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3), color(srgb none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 none), color(srgb .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3), color(srgb .5 .6 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb none .2 .3), color(srgb .5 none .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3 / none), color(srgb .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3 / none), color(srgb .5 .6 .7 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb, color(srgb .1 .2 .3 / none), color(srgb .5 .6 .7 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear .5 .6 .7) 25%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -374,33 +185,6 @@
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 25%, color(srgb-linear .5 .6 .7 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear none none none), color(srgb-linear none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear none none none), color(srgb-linear .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 none), color(srgb-linear .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear .5 .6 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear none .2 .3), color(srgb-linear .5 none .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / none), color(srgb-linear .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / none), color(srgb-linear .5 .6 .7 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / none), color(srgb-linear .5 .6 .7 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 .7) 25%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -413,33 +197,6 @@
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz none none none), color(xyz none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz none none none), color(xyz .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3), color(xyz none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 none), color(xyz .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz none .2 .3), color(xyz .5 none .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3 / none), color(xyz .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3 / none), color(xyz .5 .6 .7 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz, color(xyz .1 .2 .3 / none), color(xyz .5 .6 .7 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 .5 .6 .7) 25%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -452,33 +209,6 @@
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 25%, color(xyz-d50 .5 .6 .7 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 none none none), color(xyz-d50 none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 none none none), color(xyz-d50 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 none), color(xyz-d50 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 .5 .6 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 none .2 .3), color(xyz-d50 .5 none .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / none), color(xyz-d50 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / none), color(xyz-d50 .5 .6 .7 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / none), color(xyz-d50 .5 .6 .7 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 .5 .6 .7) 25%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
@ -491,33 +221,6 @@
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 25%, color(xyz-d65 .5 .6 .7 / .8) 75%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 none none none), color(xyz-d65 none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 none none none), color(xyz-d65 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 none none none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 none), color(xyz-d65 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 .5 .6 none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 none .2 .3), color(xyz-d65 .5 none .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / none), color(xyz-d65 .5 .6 .7))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / none), color(xyz-d65 .5 .6 .7 / 0.5))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / none), color(xyz-d65 .5 .6 .7 / none))" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "color-mix(in hsl, red 60%, blue 40%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
[color-valid-hsl.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[e.style['color'\] = "hsl(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsla(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsla(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(120 none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(120 80% none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(120 none 50%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(120 100% 50% / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hsl(none 100% 50%)" should set the property value]
|
||||
expected: FAIL
|
@ -1,23 +0,0 @@
|
||||
[color-valid-hwb.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[e.style['color'\] = "hwb(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(120 none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(120 80% none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(120 none 50%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(120 30% 50% / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "hwb(none 100% 50% / none)" should set the property value]
|
||||
expected: FAIL
|
@ -1,62 +0,0 @@
|
||||
[color-valid-lab.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[e.style['color'\] = "lab(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lab(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lab(20 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lab(none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lab(0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklab(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklab(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklab(20 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklab(none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklab(0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lch(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lch(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lch(20 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lch(none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "lch(0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklch(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklch(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklch(20 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklch(none none none / 0.5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "oklch(0 0 0 / none)" should set the property value]
|
||||
expected: FAIL
|
@ -1,50 +0,0 @@
|
||||
[color-valid-rgb.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[e.style['color'\] = "rgb(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(128 none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(128 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(none none none / .5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(20% none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(20% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgb(none none none / 50%)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(none none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(none none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(128 none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(128 none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(none none none / .5)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(20% none none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(20% none none / none)" should set the property value]
|
||||
expected: FAIL
|
||||
|
||||
[e.style['color'\] = "rgba(none none none / 50%)" should set the property value]
|
||||
expected: FAIL
|
@ -124,36 +124,36 @@
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(60deg 30% 40%), hwb(40deg 30% 40%))`, `color-mix(in hwb, rgb(153, 153, 77), rgb(153, 128, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(50deg 30% 40%), hwb(330deg 30% 40%))`, `color-mix(in hwb, rgb(153, 140, 77), rgb(153, 77, 115))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(330deg 30% 40%), hwb(50deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 115), rgb(153, 140, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb, rgb(153, 102, 77), rgb(153, 77, 127))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 127), rgb(153, 102, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb, rgb(153, 102, 77), rgb(153, 77, 128))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 128), rgb(153, 102, 77))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(40deg 30% 40%), hwb(60deg 30% 40%))`, `color-mix(in hwb, rgb(153, 128, 77), rgb(153, 153, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(60deg 30% 40%), hwb(40deg 30% 40%))`, `color-mix(in hwb, rgb(153, 153, 77), rgb(153, 128, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(50deg 30% 40%), hwb(330deg 30% 40%))`, `color-mix(in hwb, rgb(153, 140, 77), rgb(153, 77, 115))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(330deg 30% 40%), hwb(50deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 115), rgb(153, 140, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb, rgb(153, 102, 77), rgb(153, 77, 127))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 127), rgb(153, 102, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb, rgb(153, 102, 77), rgb(153, 77, 128))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb shorter hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb, rgb(153, 77, 128), rgb(153, 102, 77))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(40deg 30% 40%), hwb(60deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 128, 77), rgb(153, 153, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(60deg 30% 40%), hwb(40deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 153, 77), rgb(153, 128, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(50deg 30% 40%), hwb(330deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 140, 77), rgb(153, 77, 115))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(330deg 30% 40%), hwb(50deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 77, 115), rgb(153, 140, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 102, 77), rgb(153, 77, 127))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 77, 127), rgb(153, 102, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 102, 77), rgb(153, 77, 128))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb longer hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb longer hue, rgb(153, 77, 128), rgb(153, 102, 77))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(40deg 30% 40%), hwb(60deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 128, 77), rgb(153, 153, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(60deg 30% 40%), hwb(40deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 153, 77), rgb(153, 128, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(50deg 30% 40%), hwb(330deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 140, 77), rgb(153, 77, 115))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(330deg 30% 40%), hwb(50deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 77, 115), rgb(153, 140, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 102, 77), rgb(153, 77, 127))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 77, 127), rgb(153, 102, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 102, 77), rgb(153, 77, 128))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb increasing hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb increasing hue, rgb(153, 77, 128), rgb(153, 102, 77))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(40deg 30% 40%), hwb(60deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 128, 77), rgb(153, 153, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(60deg 30% 40%), hwb(40deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 153, 77), rgb(153, 128, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(50deg 30% 40%), hwb(330deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 140, 77), rgb(153, 77, 115))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(330deg 30% 40%), hwb(50deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 77, 115), rgb(153, 140, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 102, 77), rgb(153, 77, 127))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 77, 127), rgb(153, 102, 77))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(20deg 30% 40%), hwb(320deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 102, 77), rgb(153, 77, 128))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb decreasing hue, hwb(320deg 30% 40%), hwb(20deg 30% 40%))`, `color-mix(in hwb decreasing hue, rgb(153, 77, 128), rgb(153, 102, 77))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(none none none), hwb(none none none))`, `color-mix(in hwb, rgb(255, 0, 0), rgb(255, 0, 0))`);
|
||||
test_valid_value(`color`, `color-mix(in hwb, hwb(none none none), hwb(30deg 30% 40%))`, `color-mix(in hwb, rgb(255, 0, 0), rgb(153, 115, 77))`);
|
||||
@ -274,39 +274,39 @@
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, ${colorSpace}(10 20 30 / none), ${colorSpace}(50 60 70 / none))`, `color-mix(in ${colorSpace}, ${colorSpace}(10 20 30 / none), ${colorSpace}(50 60 70 / none))`);
|
||||
}
|
||||
|
||||
for (const colorSpace of [ "srgb", "srgb-linear", "xyz", "xyz-d50", "xyz-d65" ]) {
|
||||
const resultColorSpace = colorSpace == "xyz" ? "xyz-d65" : colorSpace;
|
||||
for (const colorSpace of [ "srgb", "srgb-linear", "xyz", "xyz-d50", "xyz-d65" ]) {
|
||||
const resultColorSpace = colorSpace == "xyz" ? "xyz-d65" : colorSpace;
|
||||
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 25%, color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 25%, color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 .7) 25%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 0.7) 25%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 25%, color(${colorSpace} .5 .6 .7) 75%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 25%, color(${resultColorSpace} 0.5 0.6 0.7) 75%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 30%, color(${colorSpace} .5 .6 .7) 90%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 30%, color(${resultColorSpace} 0.5 0.6 0.7) 90%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 12.5%, color(${colorSpace} .5 .6 .7) 37.5%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 12.5%, color(${resultColorSpace} 0.5 0.6 0.7) 37.5%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 0%, color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 0%, color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 25%, color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 25%, color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 .7) 25%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 0.7) 25%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 25%, color(${colorSpace} .5 .6 .7) 75%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 25%, color(${resultColorSpace} 0.5 0.6 0.7) 75%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 30%, color(${colorSpace} .5 .6 .7) 90%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 30%, color(${resultColorSpace} 0.5 0.6 0.7) 90%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 12.5%, color(${colorSpace} .5 .6 .7) 37.5%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 12.5%, color(${resultColorSpace} 0.5 0.6 0.7) 37.5%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3) 0%, color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3) 0%, color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .5), color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.5), color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 25%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4), color(${colorSpace} .5 .6 .7 / .8) 25%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4), color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 25%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8) 75%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 25%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 75%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 30%, color(${colorSpace} .5 .6 .7 / .8) 90%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 30%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 90%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 12.5%, color(${colorSpace} .5 .6 .7 / .8) 37.5%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 12.5%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 37.5%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 0%, color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 0%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .5), color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.5), color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 25%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4), color(${colorSpace} .5 .6 .7 / .8) 25%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4), color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 25%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8) 75%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 25%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 75%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 30%, color(${colorSpace} .5 .6 .7 / .8) 90%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 30%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 90%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 12.5%, color(${colorSpace} .5 .6 .7 / .8) 37.5%)`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 12.5%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8) 37.5%)`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 0%, color(${colorSpace} .5 .6 .7 / .8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / 0.4) 0%, color(${resultColorSpace} 0.5 0.6 0.7 / 0.8))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} 2 3 4 / 5), color(${colorSpace} 4 6 8 / 10))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 2 3 4), color(${resultColorSpace} 4 6 8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4), color(${colorSpace} -4 -6 -8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} -2 -3 -4), color(${resultColorSpace} -4 -6 -8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4 / -5), color(${colorSpace} -4 -6 -8 / -10))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} -2 -3 -4 / 0), color(${resultColorSpace} -4 -6 -8 / 0))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} 2 3 4 / 5), color(${colorSpace} 4 6 8 / 10))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 2 3 4), color(${resultColorSpace} 4 6 8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4), color(${colorSpace} -4 -6 -8))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} -2 -3 -4), color(${resultColorSpace} -4 -6 -8))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4 / -5), color(${colorSpace} -4 -6 -8 / -10))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} -2 -3 -4 / 0), color(${resultColorSpace} -4 -6 -8 / 0))`);
|
||||
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none none none), color(${colorSpace} none none none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none none none), color(${resultColorSpace} none none none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none none none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none none none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} none none none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} none none none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none .2 .3), color(${colorSpace} .5 none .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none 0.2 0.3), color(${resultColorSpace} 0.5 none 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7 / 0.5))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7 / 0.5))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7 / none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7 / none))`);
|
||||
}
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none none none), color(${colorSpace} none none none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none none none), color(${resultColorSpace} none none none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none none none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none none none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} none none none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} none none none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3), color(${colorSpace} .5 .6 none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3), color(${resultColorSpace} 0.5 0.6 none))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} none .2 .3), color(${colorSpace} .5 none .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} none 0.2 0.3), color(${resultColorSpace} 0.5 none 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7 / 0.5))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7 / 0.5))`);
|
||||
test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / none), color(${colorSpace} .5 .6 .7 / none))`, `color-mix(in ${resultColorSpace}, color(${resultColorSpace} 0.1 0.2 0.3 / none), color(${resultColorSpace} 0.5 0.6 0.7 / none))`);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1 +1 @@
|
||||
{"files":{".github/workflows/main.yml":"d66f2aac0764ebb09540737931fe2b9311e7033a2bf9a116c072cae6bec5e187","Cargo.toml":"03677b7dd7609f355cdeff66b2034647e2e553b282aa9fe7d0aca93a3ab04299","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"53a6805edd80f642473514cb93f1f4197e17a911d66a2dfcefc3dc5e82bac206","build.rs":"b30f35bfbd713943822a19ce6ebe5c99017f603cb001ed37354020549aec71fc","build/match_byte.rs":"f57faf0597cb7b3e32999c5fb1215a43a5603121588c67d5031f720362171e1c","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"541087948795b2e6e605fb9947db94956c1d0d6956444c6ff4860a430bb421ca","src/cow_rc_str.rs":"89b5dff5cf80eef3fcff0c11799e54a978d02d8b8963a621fbb999d35e7c03a3","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"a708572027ee6a21795c2bc2652ecda2871e620b69241120491a6117a8a1eec6","src/macros.rs":"0d4c3d27a22677d9eb3616d7f7af604dc3de2932ca04fd1c036102884cd6f079","src/nth.rs":"2fc26915f0a36cb22ac45dd9a7ecbdc64c327b2ec135370258ec3db9f9985460","src/parser.rs":"f9985187ede4361a29b3bf22d248903343d58e5cf369a9b5e046961356a4faf9","src/rules_and_declarations.rs":"d826f82f8c179fc13756b92336556e3ee40a273314ef774f95af71e687745f2a","src/serializer.rs":"3a0155521676deea9a6327c2ed00af6d5dabb29a97e2341d0f565f8c2b66d0a3","src/size_of_tests.rs":"da0cbcaa304f7800e9122e2bce0a11d42a70b9012e646a723cb23ee74a6b858c","src/tests.rs":"20e2369301229c541955eb7417196419c5f676e1c0dd141b191ba7ddbb51cae3","src/tokenizer.rs":"71600903284f1d68a7da6b69c938b31f9d641f8d981c7adfd06a3c8b783541f2","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":null}
|
||||
{"files":{".github/workflows/main.yml":"d66f2aac0764ebb09540737931fe2b9311e7033a2bf9a116c072cae6bec5e187","Cargo.toml":"50e9595b9b5243dab2200c2006ea9aed05e68118a9109e3320bda3d3bd82924b","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"53a6805edd80f642473514cb93f1f4197e17a911d66a2dfcefc3dc5e82bac206","build.rs":"b30f35bfbd713943822a19ce6ebe5c99017f603cb001ed37354020549aec71fc","build/match_byte.rs":"f57faf0597cb7b3e32999c5fb1215a43a5603121588c67d5031f720362171e1c","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"788898ddc0dec90fc972091642f37ab769fc818199293b8dc1c59c21ad0d3d00","src/cow_rc_str.rs":"89b5dff5cf80eef3fcff0c11799e54a978d02d8b8963a621fbb999d35e7c03a3","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"9a6b8657291eb142cd33972eaba1afd8fb2432b96b061687238278fecc3e0de1","src/macros.rs":"0d4c3d27a22677d9eb3616d7f7af604dc3de2932ca04fd1c036102884cd6f079","src/nth.rs":"2fc26915f0a36cb22ac45dd9a7ecbdc64c327b2ec135370258ec3db9f9985460","src/parser.rs":"f9985187ede4361a29b3bf22d248903343d58e5cf369a9b5e046961356a4faf9","src/rules_and_declarations.rs":"d826f82f8c179fc13756b92336556e3ee40a273314ef774f95af71e687745f2a","src/serializer.rs":"3a0155521676deea9a6327c2ed00af6d5dabb29a97e2341d0f565f8c2b66d0a3","src/size_of_tests.rs":"da0cbcaa304f7800e9122e2bce0a11d42a70b9012e646a723cb23ee74a6b858c","src/tests.rs":"9847bd8a60bda34259d2900e2b2d217e4c4a0e7dc6e410c61eee3b0e805b9a7e","src/tokenizer.rs":"71600903284f1d68a7da6b69c938b31f9d641f8d981c7adfd06a3c8b783541f2","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":null}
|
84
third_party/rust/cssparser/Cargo.toml
vendored
84
third_party/rust/cssparser/Cargo.toml
vendored
@ -1,41 +1,77 @@
|
||||
[package]
|
||||
name = "cssparser"
|
||||
version = "0.30.0"
|
||||
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]
|
||||
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
||||
#
|
||||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
description = "Rust implementation of CSS Syntax Level 3"
|
||||
documentation = "https://docs.rs/cssparser/"
|
||||
repository = "https://github.com/servo/rust-cssparser"
|
||||
readme = "README.md"
|
||||
keywords = ["css", "syntax", "parser"]
|
||||
license = "MPL-2.0"
|
||||
build = "build.rs"
|
||||
[package]
|
||||
edition = "2018"
|
||||
rust-version = "1.56"
|
||||
|
||||
exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"]
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1.0"
|
||||
difference = "2.0"
|
||||
encoding_rs = "0.8"
|
||||
name = "cssparser"
|
||||
version = "0.30.0"
|
||||
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
|
||||
build = "build.rs"
|
||||
exclude = [
|
||||
"src/css-parsing-tests/**",
|
||||
"src/big-data-url.css",
|
||||
]
|
||||
description = "Rust implementation of CSS Syntax Level 3"
|
||||
documentation = "https://docs.rs/cssparser/"
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
"css",
|
||||
"syntax",
|
||||
"parser",
|
||||
]
|
||||
license = "MPL-2.0"
|
||||
repository = "https://github.com/servo/rust-cssparser"
|
||||
|
||||
[dependencies]
|
||||
cssparser-macros = {path = "./macros", version = "0.6"}
|
||||
dtoa-short = "0.3"
|
||||
itoa = "1.0"
|
||||
phf = {version = ">=0.8,<=0.11", features = ["macros"]}
|
||||
serde = {version = "1.0", optional = true}
|
||||
smallvec = "1.0"
|
||||
|
||||
[dependencies.cssparser-macros]
|
||||
version = "0.6"
|
||||
path = "./macros"
|
||||
|
||||
[dependencies.phf]
|
||||
version = ">=0.8,<=0.11"
|
||||
features = ["macros"]
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
optional = true
|
||||
|
||||
[dev-dependencies]
|
||||
difference = "2.0"
|
||||
encoding_rs = "0.8"
|
||||
serde_json = "1.0"
|
||||
|
||||
[build-dependencies]
|
||||
syn = { version = "1", features = ["extra-traits", "fold", "full"] }
|
||||
quote = "1"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
|
||||
[build-dependencies.syn]
|
||||
version = "1"
|
||||
features = [
|
||||
"extra-traits",
|
||||
"fold",
|
||||
"full",
|
||||
]
|
||||
|
||||
[features]
|
||||
bench = []
|
||||
dummy_match_byte = []
|
||||
|
||||
[workspace]
|
||||
members = [".", "./macros", "./procedural-masquerade"]
|
||||
members = [
|
||||
".",
|
||||
"./macros",
|
||||
"./procedural-masquerade",
|
||||
]
|
||||
|
850
third_party/rust/cssparser/src/color.rs
vendored
850
third_party/rust/cssparser/src/color.rs
vendored
File diff suppressed because it is too large
Load Diff
4
third_party/rust/cssparser/src/lib.rs
vendored
4
third_party/rust/cssparser/src/lib.rs
vendored
@ -68,8 +68,8 @@ fn parse_border_spacing(_context: &ParserContext, input: &mut Parser)
|
||||
#![recursion_limit = "200"] // For color::parse_color_keyword
|
||||
|
||||
pub use crate::color::{
|
||||
hsl_to_rgb, hwb_to_rgb, parse_color_keyword, parse_color_with, AngleOrNumber, Color,
|
||||
ColorFunction, ColorParser, FromParsedColor, Lab, Lch, NumberOrPercentage, Oklab, Oklch,
|
||||
hsl_to_rgb, hwb_to_rgb, parse_color_keyword, parse_color_with, parse_hash_color, AngleOrNumber,
|
||||
Color, ColorFunction, ColorParser, FromParsedColor, Lab, Lch, NumberOrPercentage, Oklab, Oklch,
|
||||
PredefinedColorSpace, RGBA,
|
||||
};
|
||||
pub use crate::cow_rc_str::CowRcStr;
|
||||
|
176
third_party/rust/cssparser/src/tests.rs
vendored
176
third_party/rust/cssparser/src/tests.rs
vendored
@ -592,19 +592,19 @@ fn serialize_current_color() {
|
||||
|
||||
#[test]
|
||||
fn serialize_rgb_full_alpha() {
|
||||
let c = Color::Rgba(RGBA::new(255, 230, 204, 1.0));
|
||||
let c = Color::Rgba(RGBA::new(Some(255), Some(230), Some(204), Some(1.0)));
|
||||
assert_eq!(c.to_css_string(), "rgb(255, 230, 204)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_rgba() {
|
||||
let c = Color::Rgba(RGBA::new(26, 51, 77, 0.125));
|
||||
let c = Color::Rgba(RGBA::new(Some(26), Some(51), Some(77), Some(0.125)));
|
||||
assert_eq!(c.to_css_string(), "rgba(26, 51, 77, 0.125)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_rgba_two_digit_float_if_roundtrips() {
|
||||
let c = Color::Rgba(RGBA::from_floats(0., 0., 0., 0.5));
|
||||
let c = Color::Rgba(RGBA::from_floats(Some(0.), Some(0.), Some(0.), Some(0.5)));
|
||||
assert_eq!(c.to_css_string(), "rgba(0, 0, 0, 0.5)");
|
||||
}
|
||||
|
||||
@ -900,6 +900,8 @@ impl ToJson for Color {
|
||||
Color::Rgba(ref rgba) => {
|
||||
json!([rgba.red, rgba.green, rgba.blue, rgba.alpha])
|
||||
}
|
||||
Color::Hsl(ref c) => json!([c.hue, c.saturation, c.lightness, c.alpha]),
|
||||
Color::Hwb(ref c) => json!([c.hue, c.whiteness, c.blackness, c.alpha]),
|
||||
Color::Lab(ref c) => json!([c.lightness, c.a, c.b, c.alpha]),
|
||||
Color::Lch(ref c) => json!([c.lightness, c.chroma, c.hue, c.alpha]),
|
||||
Color::Oklab(ref c) => json!([c.lightness, c.a, c.b, c.alpha]),
|
||||
@ -1516,12 +1518,20 @@ fn generic_parser() {
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum OutputType {
|
||||
CurrentColor,
|
||||
Rgba(u8, u8, u8, f32),
|
||||
Lab(f32, f32, f32, f32),
|
||||
Lch(f32, f32, f32, f32),
|
||||
Oklab(f32, f32, f32, f32),
|
||||
Oklch(f32, f32, f32, f32),
|
||||
ColorFunction(PredefinedColorSpace, f32, f32, f32, f32),
|
||||
Rgba(Option<u8>, Option<u8>, Option<u8>, Option<f32>),
|
||||
Hsl(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
Hwb(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
Lab(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
Lch(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
Oklab(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
Oklch(Option<f32>, Option<f32>, Option<f32>, Option<f32>),
|
||||
ColorFunction(
|
||||
PredefinedColorSpace,
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
),
|
||||
}
|
||||
|
||||
impl FromParsedColor for OutputType {
|
||||
@ -1529,102 +1539,124 @@ fn generic_parser() {
|
||||
OutputType::CurrentColor
|
||||
}
|
||||
|
||||
fn from_rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Self {
|
||||
fn from_rgba(
|
||||
red: Option<u8>,
|
||||
green: Option<u8>,
|
||||
blue: Option<u8>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Rgba(red, green, blue, alpha)
|
||||
}
|
||||
|
||||
fn from_lab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
|
||||
fn from_hsl(
|
||||
hue: Option<f32>,
|
||||
saturation: Option<f32>,
|
||||
lightness: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Hsl(hue, saturation, lightness, alpha)
|
||||
}
|
||||
|
||||
fn from_hwb(
|
||||
hue: Option<f32>,
|
||||
blackness: Option<f32>,
|
||||
whiteness: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Hwb(hue, blackness, whiteness, alpha)
|
||||
}
|
||||
|
||||
fn from_lab(
|
||||
lightness: Option<f32>,
|
||||
a: Option<f32>,
|
||||
b: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Lab(lightness, a, b, alpha)
|
||||
}
|
||||
|
||||
fn from_lch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
|
||||
fn from_lch(
|
||||
lightness: Option<f32>,
|
||||
chroma: Option<f32>,
|
||||
hue: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Lch(lightness, chroma, hue, alpha)
|
||||
}
|
||||
|
||||
fn from_oklab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
|
||||
fn from_oklab(
|
||||
lightness: Option<f32>,
|
||||
a: Option<f32>,
|
||||
b: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Oklab(lightness, a, b, alpha)
|
||||
}
|
||||
|
||||
fn from_oklch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
|
||||
fn from_oklch(
|
||||
lightness: Option<f32>,
|
||||
chroma: Option<f32>,
|
||||
hue: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::Oklch(lightness, chroma, hue, alpha)
|
||||
}
|
||||
|
||||
fn from_color_function(
|
||||
color_space: PredefinedColorSpace,
|
||||
c1: f32,
|
||||
c2: f32,
|
||||
c3: f32,
|
||||
alpha: f32,
|
||||
c1: Option<f32>,
|
||||
c2: Option<f32>,
|
||||
c3: Option<f32>,
|
||||
alpha: Option<f32>,
|
||||
) -> Self {
|
||||
OutputType::ColorFunction(color_space, c1, c2, c3, alpha)
|
||||
}
|
||||
}
|
||||
|
||||
struct ComponentParser;
|
||||
impl<'i> ColorParser<'i> for ComponentParser {
|
||||
struct TestColorParser;
|
||||
impl<'i> ColorParser<'i> for TestColorParser {
|
||||
type Output = OutputType;
|
||||
type Error = ();
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
const TESTS: &[(&str, OutputType)] = &[
|
||||
("currentColor", OutputType::CurrentColor),
|
||||
("rgb(1, 2, 3)", OutputType::Rgba(1, 2, 3, 1.0)),
|
||||
("rgba(1, 2, 3, 0.4)", OutputType::Rgba(1, 2, 3, 0.4)),
|
||||
(
|
||||
"lab(100 20 30 / 0.4)",
|
||||
OutputType::Lab(100.0, 20.0, 30.0, 0.4),
|
||||
),
|
||||
(
|
||||
"lch(100 20 30 / 0.4)",
|
||||
OutputType::Lch(100.0, 20.0, 30.0, 0.4),
|
||||
),
|
||||
(
|
||||
"oklab(100 20 30 / 0.4)",
|
||||
OutputType::Oklab(100.0, 20.0, 30.0, 0.4),
|
||||
),
|
||||
(
|
||||
"oklch(100 20 30 / 0.4)",
|
||||
OutputType::Oklch(100.0, 20.0, 30.0, 0.4),
|
||||
),
|
||||
(
|
||||
"color(srgb 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::Srgb, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(srgb-linear 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::SrgbLinear, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(display-p3 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::DisplayP3, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(a98-rgb 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::A98Rgb, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(prophoto-rgb 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::ProphotoRgb, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(rec2020 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::Rec2020, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(xyz-d50 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::XyzD50, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
(
|
||||
"color(xyz-d65 0.1 0.2 0.3 / 0.4)",
|
||||
OutputType::ColorFunction(PredefinedColorSpace::XyzD65, 0.1, 0.2, 0.3, 0.4),
|
||||
),
|
||||
("currentColor", OutputType::CurrentColor),
|
||||
("rgb(1, 2, 3)", OutputType::Rgba(Some(1), Some(2), Some(3), Some(1.0))),
|
||||
("rgba(1, 2, 3, 0.4)", OutputType::Rgba(Some(1), Some(2), Some(3), Some(0.4))),
|
||||
("rgb(none none none / none)", OutputType::Rgba(None, None, None, None)),
|
||||
("rgb(1 none 3 / none)", OutputType::Rgba(Some(1), None, Some(3), None)),
|
||||
|
||||
("hsla(45deg, 20%, 30%, 0.4)", OutputType::Hsl(Some(45.0), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("hsl(45deg none none)", OutputType::Hsl(Some(45.0), None, None, Some(1.0))),
|
||||
("hsl(none 10% none / none)", OutputType::Hsl(None, Some(0.1), None, None)),
|
||||
("hsl(120 100.0% 50.0%)", OutputType::Hsl(Some(120.0), Some(1.0), Some(0.5), Some(1.0))),
|
||||
|
||||
("hwb(45deg 20% 30% / 0.4)", OutputType::Hwb(Some(45.0), Some(0.2), Some(0.3), Some(0.4))),
|
||||
|
||||
("lab(100 20 30 / 0.4)", OutputType::Lab(Some(100.0), Some(20.0), Some(30.0), Some(0.4))),
|
||||
("lch(100 20 30 / 0.4)", OutputType::Lch(Some(100.0), Some(20.0), Some(30.0), Some(0.4))),
|
||||
|
||||
("oklab(100 20 30 / 0.4)", OutputType::Oklab(Some(100.0), Some(20.0), Some(30.0), Some(0.4))),
|
||||
("oklch(100 20 30 / 0.4)", OutputType::Oklch(Some(100.0), Some(20.0), Some(30.0), Some(0.4))),
|
||||
|
||||
("color(srgb 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::Srgb, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(srgb none none none)", OutputType::ColorFunction(PredefinedColorSpace::Srgb, None, None, None, Some(1.0))),
|
||||
("color(srgb none none none / none)", OutputType::ColorFunction(PredefinedColorSpace::Srgb, None, None, None, None)),
|
||||
("color(srgb-linear 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::SrgbLinear, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(display-p3 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::DisplayP3, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(a98-rgb 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::A98Rgb, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(prophoto-rgb 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::ProphotoRgb, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(rec2020 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::Rec2020, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(xyz-d50 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::XyzD50, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
("color(xyz-d65 0.1 0.2 0.3 / 0.4)", OutputType::ColorFunction(PredefinedColorSpace::XyzD65, Some(0.1), Some(0.2), Some(0.3), Some(0.4))),
|
||||
];
|
||||
|
||||
for (input, expected) in TESTS {
|
||||
let mut input = ParserInput::new(*input);
|
||||
let mut input = Parser::new(&mut input);
|
||||
|
||||
let actual: OutputType = parse_color_with(&ComponentParser, &mut input).unwrap();
|
||||
let actual: OutputType = parse_color_with(&TestColorParser, &mut input).unwrap();
|
||||
assert_eq!(actual, *expected);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user