Backed out changeset 160ac6b5f726 (bug 1813481) for assertion failure on nsCSSRenderingGradients.cpp.

This commit is contained in:
Marian-Vasile Laza 2023-03-16 01:50:39 +02:00
parent 4692815ff1
commit b1bb1b3c9b
32 changed files with 1679 additions and 1336 deletions

View File

@ -122,7 +122,7 @@ replace-with = "vendored-sources"
[source."https://github.com/servo/rust-cssparser"]
git = "https://github.com/servo/rust-cssparser"
rev = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb"
replace-with = "vendored-sources"

4
Cargo.lock generated
View File

@ -1104,7 +1104,7 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.30.0"
source = "git+https://github.com/servo/rust-cssparser?rev=45bc47e2bcb846f1efb5aea156be5fe7d18624bf#45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
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=45bc47e2bcb846f1efb5aea156be5fe7d18624bf#45bc47e2bcb846f1efb5aea156be5fe7d18624bf"
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
dependencies = [
"quote",
"syn",

View File

@ -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 = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf" }
cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb" }
# application-services overrides to make updating them all simpler.
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }

View File

@ -60,27 +60,27 @@ const TEST_DATA = [
["c", 'style="display: inherit; color c ', 33, 33, false],
["VK_BACK_SPACE", 'style="display: inherit; color ', 32, 32, false],
[":", 'style="display: inherit; color :aliceblue ', 33, 42, true],
["c", 'style="display: inherit; color :color ', 34, 38, true],
["VK_DOWN", 'style="display: inherit; color :color-mix ', 34, 42, true],
["VK_RIGHT", 'style="display: inherit; color :color-mix ', 42, 42, false],
[" ", 'style="display: inherit; color :color-mix aliceblue ', 43, 52, true],
["c", 'style="display: inherit; color :cadetblue ', 34, 42, true],
["VK_DOWN", 'style="display: inherit; color :chartreuse ', 34, 43, true],
["VK_RIGHT", 'style="display: inherit; color :chartreuse ', 43, 43, false],
[" ", 'style="display: inherit; color :chartreuse aliceblue ', 44, 53, true],
[
"!",
'style="display: inherit; color :color-mix !important; ',
44,
54,
'style="display: inherit; color :chartreuse !important; ',
45,
55,
false,
],
[
"VK_RIGHT",
'style="display: inherit; color :color-mix !important; ',
54,
54,
'style="display: inherit; color :chartreuse !important; ',
55,
55,
false,
],
[
"VK_RETURN",
'style="display: inherit; color :color-mix !important;"',
'style="display: inherit; color :chartreuse !important;"',
-1,
-1,
false,

View File

@ -341,7 +341,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -355,12 +354,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -384,7 +379,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -392,10 +386,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -503,7 +493,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -517,12 +506,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -546,7 +531,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -554,10 +538,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -1881,7 +1861,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -1890,11 +1869,7 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"none",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -2459,7 +2434,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -2467,10 +2441,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -2506,7 +2476,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -2514,11 +2483,7 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"medium",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -2539,7 +2504,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -2547,10 +2511,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -2778,7 +2738,6 @@ exports.CSS_PROPERTIES = {
"values": [
"COLOR",
"auto",
"color",
"color-mix",
"currentColor",
"hsl",
@ -2786,10 +2745,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -3709,7 +3664,6 @@ exports.CSS_PROPERTIES = {
"border-box",
"bottom",
"center",
"color",
"color-mix",
"conic-gradient",
"contain",
@ -3723,15 +3677,11 @@ exports.CSS_PROPERTIES = {
"image-set",
"inherit",
"initial",
"lab",
"lch",
"left",
"linear-gradient",
"local",
"no-repeat",
"none",
"oklab",
"oklch",
"padding-box",
"radial-gradient",
"repeat",
@ -3830,7 +3780,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -3838,10 +3787,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4039,7 +3984,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4053,12 +3997,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4087,7 +4027,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4101,12 +4040,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4131,7 +4066,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4139,10 +4073,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4163,7 +4093,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4177,12 +4106,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4206,7 +4131,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4214,10 +4138,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4279,7 +4199,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4293,12 +4212,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4322,7 +4237,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4330,10 +4244,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4438,7 +4348,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4452,12 +4361,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4481,7 +4386,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4489,10 +4393,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4599,7 +4499,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4607,10 +4506,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4806,7 +4701,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4820,12 +4714,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4850,7 +4740,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4858,10 +4747,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4882,7 +4767,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -4896,12 +4780,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -4925,7 +4805,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -4933,10 +4812,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -4998,7 +4873,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -5012,12 +4886,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -5041,7 +4911,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5049,10 +4918,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5157,7 +5022,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -5171,12 +5035,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -5200,7 +5060,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5208,10 +5067,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5290,7 +5145,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -5304,12 +5158,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -5333,7 +5183,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5341,10 +5190,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5475,7 +5320,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -5489,12 +5333,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -5518,7 +5358,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5526,10 +5365,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5668,7 +5503,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5677,11 +5511,7 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"none",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5791,7 +5621,6 @@ exports.CSS_PROPERTIES = {
"values": [
"COLOR",
"auto",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5799,10 +5628,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -5901,7 +5726,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -5909,10 +5733,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -6047,7 +5867,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"dashed",
@ -6061,12 +5880,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -6090,7 +5905,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -6098,10 +5912,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -6671,7 +6481,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"context-fill",
"context-stroke",
@ -6681,11 +6490,7 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"none",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -6909,7 +6714,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -6917,10 +6721,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -8251,7 +8051,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -8259,10 +8058,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -9463,7 +9258,6 @@ exports.CSS_PROPERTIES = {
"values": [
"COLOR",
"auto",
"color",
"color-mix",
"currentColor",
"dashed",
@ -9477,12 +9271,8 @@ exports.CSS_PROPERTIES = {
"inherit",
"initial",
"inset",
"lab",
"lch",
"medium",
"none",
"oklab",
"oklch",
"outset",
"revert",
"revert-layer",
@ -9506,7 +9296,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -9514,10 +9303,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -10849,7 +10634,6 @@ exports.CSS_PROPERTIES = {
"values": [
"COLOR",
"auto",
"color",
"color-mix",
"currentColor",
"hsl",
@ -10857,10 +10641,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -11030,7 +10810,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -11038,10 +10817,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -11074,7 +10849,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"context-fill",
"context-stroke",
@ -11084,11 +10858,7 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"none",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -11333,7 +11103,6 @@ exports.CSS_PROPERTIES = {
"-moz-none",
"auto",
"blink",
"color",
"color-mix",
"currentColor",
"dashed",
@ -11345,12 +11114,8 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"line-through",
"none",
"oklab",
"oklch",
"overline",
"revert",
"revert-layer",
@ -11373,7 +11138,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -11381,10 +11145,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -11477,7 +11237,6 @@ exports.CSS_PROPERTIES = {
"values": [
"COLOR",
"circle",
"color",
"color-mix",
"currentColor",
"dot",
@ -11488,11 +11247,7 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"none",
"oklab",
"oklch",
"open",
"revert",
"revert-layer",
@ -11514,7 +11269,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -11522,10 +11276,6 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",
@ -11669,7 +11419,6 @@ exports.CSS_PROPERTIES = {
],
"values": [
"COLOR",
"color",
"color-mix",
"currentColor",
"hsl",
@ -11677,11 +11426,7 @@ exports.CSS_PROPERTIES = {
"hwb",
"inherit",
"initial",
"lab",
"lch",
"none",
"oklab",
"oklch",
"revert",
"revert-layer",
"rgb",

View File

@ -1752,11 +1752,17 @@ DeviceColor ToDeviceColor(nscolor aColor) {
}
DeviceColor ToDeviceColor(const StyleAbsoluteColor& aColor) {
// TODO(tlouw): aColor might not be in sRGB.
MOZ_ASSERT(aColor.color_space == StyleColorSpace::Srgb,
"color should be in sRGB");
return ToDeviceColor(aColor.ToColor());
}
sRGBColor ToSRGBColor(const StyleAbsoluteColor& aColor) {
auto srgb = aColor.ToColorSpace(StyleColorSpace::Srgb);
// TODO(tlouw): aColor might not be in sRGB.
MOZ_ASSERT(aColor.color_space == StyleColorSpace::Srgb,
"color should be in sRGB");
const auto ToComponent = [](float aF) -> float {
float component = std::min(std::max(0.0f, aF), 1.0f);
@ -1765,8 +1771,8 @@ sRGBColor ToSRGBColor(const StyleAbsoluteColor& aColor) {
}
return component;
};
return {ToComponent(srgb.components._0), ToComponent(srgb.components._1),
ToComponent(srgb.components._2), ToComponent(srgb.alpha)};
return {ToComponent(aColor.components._0), ToComponent(aColor.components._1),
ToComponent(aColor.components._2), ToComponent(aColor.alpha)};
}
} // namespace gfx

View File

@ -57,13 +57,11 @@ nscolor StyleColor::CalcColor(const nsIFrame* aFrame) const {
return ResolveColor(aFrame->StyleText()->mColor).ToColor();
}
StyleAbsoluteColor StyleAbsoluteColor::ToColorSpace(
StyleColorSpace aColorSpace) const {
return Servo_ConvertColorSpace(this, aColorSpace);
}
nscolor StyleAbsoluteColor::ToColor() const {
auto srgb = ToColorSpace(StyleColorSpace::Srgb);
auto srgb = *this;
if (color_space != StyleColorSpace::Srgb) {
srgb = Servo_ConvertColorSpace(this, StyleColorSpace::Srgb);
}
// TODO(tlouw): Needs gamut mapping here. Right now we just hard clip the
// components to [0..1], which will yield invalid colors.

View File

@ -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: @IS_NIGHTLY_BUILD@
value: false
mirror: always
rust: true

View File

@ -68,7 +68,6 @@ 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;
@ -88,26 +87,26 @@ pub fn hsl_to_rgb(from: &ColorComponents) -> ColorComponents {
}
/// Convert from RGB notation to HSL notation.
/// https://drafts.csswg.org/css-color-4/#rgb-to-hsl
/// https://drafts.csswg.org/css-color/#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 lightness = (min + max) / 2.0;
let light = (min + max) / 2.0;
let delta = max - min;
let saturation = if delta != 0.0 {
if lightness == 0.0 || lightness == 1.0 {
let sat = if delta != 0.0 {
if light == 0.0 || light == 1.0 {
0.0
} else {
(max - lightness) / lightness.min(1.0 - lightness)
(max - light) / light.min(1.0 - light)
}
} else {
0.0
};
ColorComponents(hue, saturation, lightness)
ColorComponents(hue, sat, light)
}
/// Convert from HWB notation to RGB notation.
@ -139,30 +138,6 @@ 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));
@ -330,56 +305,6 @@ 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;

View File

@ -26,6 +26,11 @@ 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,
@ -133,15 +138,7 @@ bitflags! {
pub struct SerializationFlags : u8 {
/// If set, serializes sRGB colors into `color(srgb ...)` instead of
/// `rgba(...)`.
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;
const AS_COLOR_FUNCTION = 0x01;
}
}
@ -262,69 +259,20 @@ 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),
@ -335,13 +283,19 @@ 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),
@ -375,21 +329,6 @@ 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);
@ -403,28 +342,30 @@ 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(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
&cssparser::RGBA::from_floats(
self.components.0,
self.components.1,
self.components.2,
self.alpha(),
),
dest,
)
},
ColorSpace::Lab => cssparser::ToCss::to_css(
&cssparser::Lab::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
unsafe { color_components_as!(self, cssparser::Lab) },
dest,
),
ColorSpace::Lch => cssparser::ToCss::to_css(
&cssparser::Lch::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
unsafe { color_components_as!(self, cssparser::Lch) },
dest,
),
ColorSpace::Oklab => cssparser::ToCss::to_css(
&cssparser::Oklab::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
unsafe { color_components_as!(self, cssparser::Oklab) },
dest,
),
ColorSpace::Oklch => cssparser::ToCss::to_css(
&cssparser::Oklch::new(maybe_c1, maybe_c2, maybe_c3, maybe_alpha),
unsafe { color_components_as!(self, cssparser::Oklch) },
dest,
),
_ => {
@ -452,10 +393,10 @@ impl ToCss for AbsoluteColor {
let color_function = cssparser::ColorFunction {
color_space,
c1: maybe_c1,
c2: maybe_c2,
c3: maybe_c3,
alpha: maybe_alpha,
c1: self.components.0,
c2: self.components.1,
c3: self.components.2,
alpha: self.alpha,
};
let color = cssparser::Color::ColorFunction(color_function);
cssparser::ToCss::to_css(&color, dest)

View File

@ -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};
use cssparser::{AngleOrNumber, Color as CSSParserColor, Parser, Token, RGBA};
use cssparser::{BasicParseErrorKind, NumberOrPercentage, ParseErrorKind};
use itoa;
use std::fmt::{self, Write};
@ -393,35 +393,9 @@ impl SystemColor {
}
#[inline]
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;
fn new_absolute(color_space: ColorSpace, c1: f32, c2: f32, c3: f32, alpha: f32) -> Color {
Color::Absolute(Box::new(Absolute {
color,
color: AbsoluteColor::new(color_space, ColorComponents(c1, c2, c3), alpha),
authored: None,
}))
}
@ -431,76 +405,38 @@ impl cssparser::FromParsedColor for Color {
Color::CurrentColor
}
fn from_rgba(red: Option<u8>, green: Option<u8>, blue: Option<u8>, alpha: Option<f32>) -> Self {
fn from_rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Self {
new_absolute(
ColorSpace::Srgb,
red.map(|r| r as f32 / 255.0),
green.map(|g| g as f32 / 255.0),
blue.map(|b| b as f32 / 255.0),
red as f32 / 255.0,
green as f32 / 255.0,
blue as f32 / 255.0,
alpha,
)
}
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 {
fn from_lab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
new_absolute(ColorSpace::Lab, lightness, a, b, alpha)
}
fn from_lch(
lightness: Option<f32>,
chroma: Option<f32>,
hue: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_lch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
new_absolute(ColorSpace::Lch, lightness, chroma, hue, alpha)
}
fn from_oklab(
lightness: Option<f32>,
a: Option<f32>,
b: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_oklab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
new_absolute(ColorSpace::Oklab, lightness, a, b, alpha)
}
fn from_oklch(
lightness: Option<f32>,
chroma: Option<f32>,
hue: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_oklch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
new_absolute(ColorSpace::Oklch, lightness, chroma, hue, alpha)
}
fn from_color_function(
color_space: cssparser::PredefinedColorSpace,
c1: Option<f32>,
c2: Option<f32>,
c3: Option<f32>,
alpha: Option<f32>,
c1: f32,
c2: f32,
c3: f32,
alpha: f32,
) -> Self {
let mut result = new_absolute(color_space.into(), c1, c2, c3, alpha);
if let Color::Absolute(ref mut absolute) = result {
@ -617,17 +553,14 @@ impl Color {
Ok(mut color) => {
if let Color::Absolute(ref mut absolute) = color {
let enabled = {
let is_legacy_color = matches!(
absolute.color.color_space,
ColorSpace::Srgb | ColorSpace::Hsl
);
let is_srgb = matches!(absolute.color.color_space, ColorSpace::Srgb);
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_legacy_color && !is_color_function) || pref_enabled
(is_srgb && !is_color_function) || pref_enabled
};
if !enabled {
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
@ -779,14 +712,23 @@ impl Color {
if !allow_quirks.allowed(context.quirks_mode) {
return Err(e);
}
Color::parse_quirky_color(input).map_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)
})
}
/// 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<Self, ParseError<'i>> {
fn parse_quirky_color<'i, 't>(input: &mut Parser<'i, 't>) -> Result<RGBA, ParseError<'i>> {
let location = input.current_source_location();
let (value, unit) = match *input.next()? {
Token::Number {
@ -802,7 +744,7 @@ impl Color {
if ident.len() != 3 && ident.len() != 6 {
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
return cssparser::parse_hash_color(ident.as_bytes()).map_err(|()| {
return RGBA::parse_hash(ident.as_bytes()).map_err(|()| {
location.new_custom_error(StyleParseErrorKind::UnspecifiedError)
});
},
@ -847,7 +789,7 @@ impl Color {
.unwrap();
}
debug_assert_eq!(written, 6);
cssparser::parse_hash_color(&serialization)
RGBA::parse_hash(&serialization)
.map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}
}

View File

@ -575,11 +575,6 @@ renaming_overrides_prefixing = true
static inline StyleAbsoluteColor FromColor(nscolor);
/**
* Convert this color into the given color space.
*/
StyleAbsoluteColor ToColorSpace(StyleColorSpace aColorSpace) const;
/**
* Convert this color to an nscolor. The color will be converted to sRGB first
* if required.

View File

@ -454,12 +454,6 @@ 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"

View File

@ -1,3 +1,354 @@
[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

View File

@ -1,4 +1,7 @@
[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
@ -17,9 +20,15 @@
[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

View File

@ -0,0 +1,29 @@
[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

View File

@ -0,0 +1,23 @@
[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

View File

@ -0,0 +1,62 @@
[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

View File

@ -0,0 +1,50 @@
[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

View File

@ -1,6 +1,142 @@
[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]

View File

@ -17,6 +17,33 @@
[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
@ -62,6 +89,33 @@
[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
@ -107,6 +161,33 @@
[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
@ -125,6 +206,33 @@
[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
@ -143,6 +251,33 @@
[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
@ -161,6 +296,33 @@
[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
@ -173,6 +335,33 @@
[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
@ -185,6 +374,33 @@
[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
@ -197,6 +413,33 @@
[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
@ -209,6 +452,33 @@
[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
@ -221,6 +491,33 @@
[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

View File

@ -0,0 +1,29 @@
[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

View File

@ -0,0 +1,23 @@
[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

View File

@ -0,0 +1,62 @@
[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

View File

@ -0,0 +1,50 @@
[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

View File

@ -505,18 +505,48 @@
[sRGB-BB0000.svg, Context display-p3, ImageData display-p3, scaleImage=true]
expected: FAIL
[Display-P3-1-0-0.svg, Context srgb, ImageData srgb, scaleImage=false]
expected: FAIL
[Display-P3-1-0-0.svg, Context srgb, ImageData srgb, scaleImage=true]
expected: FAIL
[Display-P3-1-0-0.svg, Context srgb, ImageData display-p3, scaleImage=false]
expected: FAIL
[Display-P3-1-0-0.svg, Context srgb, ImageData display-p3, scaleImage=true]
expected: FAIL
[Display-P3-1-0-0.svg, Context display-p3, ImageData srgb, scaleImage=false]
expected: FAIL
[Display-P3-1-0-0.svg, Context display-p3, ImageData srgb, scaleImage=true]
expected: FAIL
[Display-P3-1-0-0.svg, Context display-p3, ImageData display-p3, scaleImage=false]
expected: FAIL
[Display-P3-1-0-0.svg, Context display-p3, ImageData display-p3, scaleImage=true]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context srgb, ImageData srgb, scaleImage=false]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context srgb, ImageData srgb, scaleImage=true]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context srgb, ImageData display-p3, scaleImage=false]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context srgb, ImageData display-p3, scaleImage=true]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context display-p3, ImageData srgb, scaleImage=false]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context display-p3, ImageData srgb, scaleImage=true]
expected: FAIL
[Display-P3-0.7333-0-0.svg, Context display-p3, ImageData display-p3, scaleImage=false]
expected: FAIL

View File

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

View File

@ -1 +1 @@
{"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}
{"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}

View File

@ -1,77 +1,41 @@
# 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.
[package]
edition = "2018"
rust-version = "1.56"
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",
]
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]
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"
readme = "README.md"
keywords = ["css", "syntax", "parser"]
license = "MPL-2.0"
build = "build.rs"
edition = "2018"
rust-version = "1.56"
[dependencies]
dtoa-short = "0.3"
itoa = "1.0"
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
exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"]
[dev-dependencies]
serde_json = "1.0"
difference = "2.0"
encoding_rs = "0.8"
serde_json = "1.0"
[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"
[build-dependencies]
proc-macro2 = "1"
syn = { version = "1", features = ["extra-traits", "fold", "full"] }
quote = "1"
[build-dependencies.syn]
version = "1"
features = [
"extra-traits",
"fold",
"full",
]
proc-macro2 = "1"
[features]
bench = []
dummy_match_byte = []
[workspace]
members = [
".",
"./macros",
"./procedural-masquerade",
]
members = [".", "./macros", "./procedural-masquerade"]

File diff suppressed because it is too large Load Diff

View File

@ -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, parse_hash_color, AngleOrNumber,
Color, ColorFunction, ColorParser, FromParsedColor, Lab, Lch, NumberOrPercentage, Oklab, Oklch,
hsl_to_rgb, hwb_to_rgb, parse_color_keyword, parse_color_with, AngleOrNumber, Color,
ColorFunction, ColorParser, FromParsedColor, Lab, Lch, NumberOrPercentage, Oklab, Oklch,
PredefinedColorSpace, RGBA,
};
pub use crate::cow_rc_str::CowRcStr;

View File

@ -592,19 +592,19 @@ fn serialize_current_color() {
#[test]
fn serialize_rgb_full_alpha() {
let c = Color::Rgba(RGBA::new(Some(255), Some(230), Some(204), Some(1.0)));
let c = Color::Rgba(RGBA::new(255, 230, 204, 1.0));
assert_eq!(c.to_css_string(), "rgb(255, 230, 204)");
}
#[test]
fn serialize_rgba() {
let c = Color::Rgba(RGBA::new(Some(26), Some(51), Some(77), Some(0.125)));
let c = Color::Rgba(RGBA::new(26, 51, 77, 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(Some(0.), Some(0.), Some(0.), Some(0.5)));
let c = Color::Rgba(RGBA::from_floats(0., 0., 0., 0.5));
assert_eq!(c.to_css_string(), "rgba(0, 0, 0, 0.5)");
}
@ -900,8 +900,6 @@ 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]),
@ -1518,20 +1516,12 @@ fn generic_parser() {
#[derive(Debug, PartialEq)]
enum OutputType {
CurrentColor,
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>,
),
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),
}
impl FromParsedColor for OutputType {
@ -1539,124 +1529,102 @@ fn generic_parser() {
OutputType::CurrentColor
}
fn from_rgba(
red: Option<u8>,
green: Option<u8>,
blue: Option<u8>,
alpha: Option<f32>,
) -> Self {
fn from_rgba(red: u8, green: u8, blue: u8, alpha: f32) -> Self {
OutputType::Rgba(red, green, blue, alpha)
}
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 {
fn from_lab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
OutputType::Lab(lightness, a, b, alpha)
}
fn from_lch(
lightness: Option<f32>,
chroma: Option<f32>,
hue: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_lch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
OutputType::Lch(lightness, chroma, hue, alpha)
}
fn from_oklab(
lightness: Option<f32>,
a: Option<f32>,
b: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_oklab(lightness: f32, a: f32, b: f32, alpha: f32) -> Self {
OutputType::Oklab(lightness, a, b, alpha)
}
fn from_oklch(
lightness: Option<f32>,
chroma: Option<f32>,
hue: Option<f32>,
alpha: Option<f32>,
) -> Self {
fn from_oklch(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Self {
OutputType::Oklch(lightness, chroma, hue, alpha)
}
fn from_color_function(
color_space: PredefinedColorSpace,
c1: Option<f32>,
c2: Option<f32>,
c3: Option<f32>,
alpha: Option<f32>,
c1: f32,
c2: f32,
c3: f32,
alpha: f32,
) -> Self {
OutputType::ColorFunction(color_space, c1, c2, c3, alpha)
}
}
struct TestColorParser;
impl<'i> ColorParser<'i> for TestColorParser {
struct ComponentParser;
impl<'i> ColorParser<'i> for ComponentParser {
type Output = OutputType;
type Error = ();
}
#[rustfmt::skip]
const TESTS: &[(&str, OutputType)] = &[
("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))),
("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),
),
];
for (input, expected) in TESTS {
let mut input = ParserInput::new(*input);
let mut input = Parser::new(&mut input);
let actual: OutputType = parse_color_with(&TestColorParser, &mut input).unwrap();
let actual: OutputType = parse_color_with(&ComponentParser, &mut input).unwrap();
assert_eq!(actual, *expected);
}
}