@@ -4785,8 +4785,8 @@ describe("CssSyntax minify — the value transforms' rejection paths", () => {
47854785 // A slot taking a length or a color is read the same way, by the classes
47864786 // a sibling's own value is in: neither `solid` nor `red` is a width.
47874787 ["a{border:medium solid red}", "a{border:solid red}"],
4788- ["a{border:medium none currentcolor}", "a{border:0 }"],
4789- ["a{border:none medium}", "a{border:0 }"],
4788+ ["a{border:medium none currentcolor}", "a{border:none }"],
4789+ ["a{border:none medium}", "a{border:none }"],
47904790 ["a{column-rule:medium none currentcolor}", "a{column-rule:none}"],
47914791 // ...and a sibling that is one keeps it.
47924792 ["a{border:medium 1px}", "a{border:medium 1px}"],
@@ -12211,7 +12211,7 @@ describe("CssSyntax minify — a slot holding its own initial", () => {
1221112211 // The slots are read by what each takes, so a width and a color are
1221212212 // answered for as well as a keyword.
1221312213 expect(minify("a{border-left:currentcolor medium none}")).toBe(
12214- "a{border-left:0 }"
12214+ "a{border-left:none }"
1221512215 );
1221612216 expect(minify("a{column-rule:medium none red}")).toBe("a{column-rule:red}");
1221712217 expect(minify("a{outline:medium none currentcolor}")).toBe(
@@ -14690,6 +14690,27 @@ describe("CssSyntax minify — a fallback the target reads past", () => {
1469014690 );
1469114691 });
1469214692
14693+ it.each([
14694+ // Safari read `dvh` from 15.4, so 15 still needs the `vh` gradient.
14695+ ["safari 15", true],
14696+ ["safari 16", false]
14697+ ])("keeps a gradient fallback where %s reads no unit the later one names", (browser, kept) => {
14698+ const css =
14699+ "a{background-image:linear-gradient(red 10vh,blue);background-image:linear-gradient(red 10dvh,blue)}";
14700+ expect(minifyFor(css, [browser])).toBe(
14701+ kept ? css : "a{background-image:linear-gradient(red 10dvh,blue)}"
14702+ );
14703+ });
14704+
14705+ it("reads no unit the tables do not name", () => {
14706+ const css = "a{background:red;background:linear-gradient(red 1foo,blue)}";
14707+ expect(minifyFor(css, MODERN)).toBe(css);
14708+ // An absolute length is read wherever the gradient is.
14709+ expect(
14710+ minifyFor("a{background:red;background:linear-gradient(red 1px,blue 2em)}", MODERN)
14711+ ).toBe("a{background:linear-gradient(red 1px,blue 2em)}");
14712+ });
14713+
1469314714 it("reads a gradient of keywords, amounts and colors every engine names", () => {
1469414715 expect(
1469514716 minifyFor("a{background:red;background:linear-gradient(red,blue)}", MODERN)
@@ -15212,11 +15233,12 @@ describe("CssSyntax minify — what a comparison with other minifiers found", ()
1521215233 });
1521315234
1521415235 it.each([
15215- ["a{border:none}", "a{border:0}"],
15216- ["a{border:NONE!important}", "a{border:0!important}"],
15217- ["a{border-top:none}", "a{border-top:0}"],
15218- ["a{border-block-end:none}", "a{border-block-end:0}"],
15219- // `medium` computes as 3px for these whatever the style, so `0` differs.
15236+ // `none` sets the width to `medium`, which a later style shows as 3px.
15237+ ["a{border:none}", "a{border:none}"],
15238+ ["a{border:NONE!important}", "a{border:none!important}"],
15239+ ["a{border-top:none}", "a{border-top:none}"],
15240+ ["a{border-block-end:none}", "a{border-block-end:none}"],
15241+ [".a{border:none}.a.b{border-style:solid}", ".a{border:none}.a.b{border-style:solid}"],
1522015242 ["a{outline:none}", "a{outline:none}"],
1522115243 ["a{column-rule:none}", "a{column-rule:none}"],
1522215244 // No width beside the style here, so `none` stays the one word.
0 commit comments