Skip to content

Commit 9c5f6de

Browse files
test(css): update the percentage outputs the config cases record
1 parent d5d73c9 commit 9c5f6de

9 files changed

Lines changed: 52 additions & 52 deletions

File tree

‎test/configCases/css/minimize-corpus/__snapshots__/ConfigCacheTest.snap‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Array [
5151
"/*! declined: division by zero is not a number */.d05{width:calc(1px/0)}",
5252
"/*! declined: past the range the rounding covers every digit carries, and all of
5353
them are longer than the expression */.d06{width:calc(123456px/1.1)}",
54-
"/*! the fold prints a double back, so its result is rounded to six digits */.f20{width:33.3333%}",
54+
"/*! the fold prints a double back, so its result is rounded to six digits, a percentage to the float Firefox parses */.f20{width:33.333333%}",
5555
"/*! an angle rounds to six digits too, as lightningcss rounds it */.f21{rotate:.333333turn}",
5656
"/*! declined: a math function other than calc() */.d07{width:3px}",
5757
"/*! two angle units add in degrees, as lightningcss adds them */.d08{rotate:90deg}",
@@ -179,14 +179,14 @@ Array [
179179
"/*! width: calc(3 * 2px) — same as lightningcss: 6px */.k004{width:6px}",
180180
"/*! width: calc(10px / 4) — same as lightningcss: 2.5px */.k005{width:2.5px}",
181181
"/*! width: calc(10px / 3) — same as lightningcss: 3.33333px */.k006{width:3.33333px}",
182-
"/*! width: calc(100% / 3) — same as lightningcss: 33.3333% */.k007{width:33.3333%}",
182+
"/*! width: calc(100% / 3) — lightningcss: 33.3333% — ours keeps the digits Firefox lays a percentage out with */.k007{width:33.333333%}",
183183
"/*! width: calc(100% / 4) — same as lightningcss: 25% */.k008{width:25%}",
184-
"/*! width: calc(100% / 6) — same as lightningcss: 16.6667% */.k009{width:16.6667%}",
185-
"/*! width: calc(100% / 7) — same as lightningcss: 14.2857% */.k010{width:14.2857%}",
184+
"/*! width: calc(100% / 6) — lightningcss: 16.6667% — ours keeps the digits Firefox lays a percentage out with */.k009{width:16.6666667%}",
185+
"/*! width: calc(100% / 7) — lightningcss: 14.2857% — ours keeps the digits Firefox lays a percentage out with */.k010{width:14.285714%}",
186186
"/*! width: calc(100% / 8) — same as lightningcss: 12.5% */.k011{width:12.5%}",
187-
"/*! width: calc(100% / 9) — same as lightningcss: 11.1111% */.k012{width:11.1111%}",
188-
"/*! width: calc(100% / 12) — same as lightningcss: 8.33333% */.k013{width:8.33333%}",
189-
"/*! width: calc(100% * 2 / 3) — same as lightningcss: 66.6667% */.k014{width:66.6667%}",
187+
"/*! width: calc(100% / 9) — lightningcss: 11.1111% — ours keeps the digits Firefox lays a percentage out with */.k012{width:11.111111%}",
188+
"/*! width: calc(100% / 12) — lightningcss: 8.33333% — ours keeps the digits Firefox lays a percentage out with */.k013{width:8.333333%}",
189+
"/*! width: calc(100% * 2 / 3) — lightningcss: 66.6667% — ours keeps the digits Firefox lays a percentage out with */.k014{width:66.666667%}",
190190
"/*! width: calc(200px / 3) — same as lightningcss: 66.6667px */.k015{width:66.6667px}",
191191
"/*! width: calc(1px / 3) — same as lightningcss: .333333px */.k016{width:.333333px}",
192192
"/*! width: calc(-1px / 3) — lightningcss: -.333333px — a bare negative is invalid here, where calc() clamps it to 0 */.k017{width:calc(-1px/3)}",
@@ -225,7 +225,7 @@ Array [
225225
"/*! width: calc(100% - (10px - 5px)) — same as lightningcss: calc(100% - 5px) */.k050{width:calc(100% - 5px)}",
226226
"/*! width: calc(-1 * (100% - 10px)) — same as lightningcss: calc(-100% + 10px) */.k051{width:calc(-100% + 10px)}",
227227
"/*! width: calc(100% / 3 - 10px) — lightningcss: calc(33.3333% - 10px) — ours is shorter */.k052{width:calc(100%/3 - 10px)}",
228-
"/*! width: calc(100% / 3 + 100% / 3) — same as lightningcss: 66.6667% */.k053{width:66.6667%}",
228+
"/*! width: calc(100% / 3 + 100% / 3) — lightningcss: 66.6667% — ours keeps the digits Firefox lays a percentage out with */.k053{width:66.666667%}",
229229
"/*! opacity: calc(1 / 3) — same as lightningcss: .333333 */.k054{opacity:.333333}",
230230
"/*! opacity: calc(1 / 2) — same as lightningcss: .5 */.k055{opacity:.5}",
231231
"/*! opacity: calc(0.5 + 0.25) — same as lightningcss: .75 */.k056{opacity:.75}",
@@ -309,20 +309,20 @@ Array [
309309
"/*! width: -moz-calc(1px + 2px) — same as lightningcss: -moz-calc(1px + 2px) */.k134{width:-moz-calc(1px + 2px)}",
310310
"/*! margin: calc(1px + 1px) calc(2px * 2) — same as lightningcss: 2px 4px */.k135{margin:2px 4px}",
311311
"/*! margin: calc(10px / 3) 0 — same as lightningcss: 3.33333px 0 */.k136{margin:3.33333px 0}",
312-
"/*! transform: translateX(calc(100% / 3)) — same as lightningcss: translate(33.3333%) */.k137{transform:translate(33.3333%)}",
313-
"/*! transform: translate(calc(10px + 5px), calc(100% / 3)) — same as lightningcss: translate(15px,33.3333%) */.k138{transform:translate(15px,33.3333%)}",
312+
"/*! transform: translateX(calc(100% / 3)) — lightningcss: translate(33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k137{transform:translate(33.333333%)}",
313+
"/*! transform: translate(calc(10px + 5px), calc(100% / 3)) — lightningcss: translate(15px,33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k138{transform:translate(15px,33.333333%)}",
314314
"/*! transform: rotate(calc(45deg * 2)) — same as lightningcss: rotate(90deg) */.k139{transform:rotate(90deg)}",
315315
"/*! transform: scale(calc(1 / 3)) — same as lightningcss: scale(.333333) */.k140{transform:scale(.333333)}",
316-
"/*! background-position: calc(100% / 3) calc(50% + 10px) — lightningcss: 33.3333% calc(50% + 10px) — the same value, ours dropping a space the tokens do not need */.k141{background-position:33.3333%calc(50% + 10px)}",
317-
"/*! grid-template-columns: repeat(3, calc(100% / 3)) — same as lightningcss: repeat(3,33.3333%) */.k142{grid-template-columns:repeat(3,33.3333%)}",
316+
"/*! background-position: calc(100% / 3) calc(50% + 10px) — lightningcss: 33.3333% calc(50% + 10px) — ours keeps the digits Firefox lays a percentage out with */.k141{background-position:33.333333%calc(50% + 10px)}",
317+
"/*! grid-template-columns: repeat(3, calc(100% / 3)) — lightningcss: repeat(3,33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k142{grid-template-columns:repeat(3,33.333333%)}",
318318
"/*! box-shadow: calc(1px + 1px) 0 calc(4px / 3) #000 — lightningcss: 2px 0 1.33333px #000 — the same value, ours dropping a space the tokens do not need */.k143{box-shadow:2px 0 1.33333px#000}",
319319
"/*! color: rgb(calc(255 / 3) 0 0) — same as lightningcss: #500 */.k144{color:#500}",
320320
"/*! color: rgb(calc(100 + 55) 0 0) — same as lightningcss: #9b0000 */.k145{color:#9b0000}",
321321
"/*! color: hsl(calc(360 / 7) 50% 50%) — same as lightningcss: #bfad40 */.k146{color:#bfad40}",
322322
"/*! color: rgb(0 0 0 / calc(1 / 3)) — same as lightningcss: #0005 */.k147{color:#0005}",
323323
"/*! font: calc(10px + 2px)/1.5 serif — same as lightningcss: 12px/1.5 serif */.k148{font:12px/1.5 serif}",
324-
"/*! border-radius: calc(100% / 3) — same as lightningcss: 33.3333% */.k149{border-radius:33.3333%}",
325-
"/*! inset: calc(100% / 3) 0 0 0 — lightningcss: 33.3333% 0 0 — the same value, ours dropping a space the tokens do not need */.k150{inset:33.3333%0 0}",
324+
"/*! border-radius: calc(100% / 3) — lightningcss: 33.3333% — ours keeps the digits Firefox lays a percentage out with */.k149{border-radius:33.333333%}",
325+
"/*! inset: calc(100% / 3) 0 0 0 — lightningcss: 33.3333% 0 0 — ours keeps the digits Firefox lays a percentage out with */.k150{inset:33.333333%0 0}",
326326
"/*! width: calc(100% / 3 * 3) — same as lightningcss: 100% */.k151{width:100%}",
327327
"/*! width: calc(1px * 3 / 3) — same as lightningcss: 1px */.k152{width:1px}",
328328
"/*! width: calc(1 / 3 * 3px) — same as lightningcss: 1px */.k153{width:1px}",
@@ -348,7 +348,7 @@ Array [
348348
"/*! rotate: calc(1turn - 90deg) — same as lightningcss: 270deg */.k173{rotate:270deg}",
349349
"/*! aspect-ratio: 16 / 9 — same as lightningcss: 16/9 */.k174{aspect-ratio:16/9}",
350350
"/*! aspect-ratio: auto 16 / 9 — same as lightningcss: auto 16/9 */.k175{aspect-ratio:auto 16/9}",
351-
"/*! background: linear-gradient(red calc(100% / 3), blue) — lightningcss: linear-gradient(red 33.3333%,#00f) — the same length either way */.k176{background:linear-gradient(red 33.3333%,blue)}",
351+
"/*! background: linear-gradient(red calc(100% / 3), blue) — lightningcss: linear-gradient(red 33.3333%,#00f) — ours keeps the digits Firefox lays a percentage out with */.k176{background:linear-gradient(red 33.333333%,blue)}",
352352
]
353353
`;
354354

@@ -1537,7 +1537,7 @@ Array [
15371537
"/*! webpack: \`@container\` carries media features too, name and all */@container card (width>=1px){.t69{color:red}}",
15381538
"/*! declined: a plain feature has no range spelling to reach for */@media (width:100px){.t70{color:red}}",
15391539
"/*! declined: a \`@supports\` condition is a declaration, not a media feature */@supports (min-width:1px){.t71{color:red}}",
1540-
"/*! webpack: 6 significant digits is below what the engine reports */.t72{width:33.3333%}",
1540+
"/*! webpack: a percentage keeps the digits of the float Firefox parses */.t72{width:33.333333%}",
15411541
"/*! webpack: ...and below the 1/64px it lays a length out in */.t73{width:1px}",
15421542
"/*! webpack: ...for a unitless number too */.t74{opacity:.123457}",
15431543
"/*! webpack: declined: an angle is amplified by the trig in rotate() */.t75{transform:rotate(33.33333333deg)}",

‎test/configCases/css/minimize-corpus/__snapshots__/ConfigTest.snap‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Array [
5151
"/*! declined: division by zero is not a number */.d05{width:calc(1px/0)}",
5252
"/*! declined: past the range the rounding covers every digit carries, and all of
5353
them are longer than the expression */.d06{width:calc(123456px/1.1)}",
54-
"/*! the fold prints a double back, so its result is rounded to six digits */.f20{width:33.3333%}",
54+
"/*! the fold prints a double back, so its result is rounded to six digits, a percentage to the float Firefox parses */.f20{width:33.333333%}",
5555
"/*! an angle rounds to six digits too, as lightningcss rounds it */.f21{rotate:.333333turn}",
5656
"/*! declined: a math function other than calc() */.d07{width:3px}",
5757
"/*! two angle units add in degrees, as lightningcss adds them */.d08{rotate:90deg}",
@@ -179,14 +179,14 @@ Array [
179179
"/*! width: calc(3 * 2px) — same as lightningcss: 6px */.k004{width:6px}",
180180
"/*! width: calc(10px / 4) — same as lightningcss: 2.5px */.k005{width:2.5px}",
181181
"/*! width: calc(10px / 3) — same as lightningcss: 3.33333px */.k006{width:3.33333px}",
182-
"/*! width: calc(100% / 3) — same as lightningcss: 33.3333% */.k007{width:33.3333%}",
182+
"/*! width: calc(100% / 3) — lightningcss: 33.3333% — ours keeps the digits Firefox lays a percentage out with */.k007{width:33.333333%}",
183183
"/*! width: calc(100% / 4) — same as lightningcss: 25% */.k008{width:25%}",
184-
"/*! width: calc(100% / 6) — same as lightningcss: 16.6667% */.k009{width:16.6667%}",
185-
"/*! width: calc(100% / 7) — same as lightningcss: 14.2857% */.k010{width:14.2857%}",
184+
"/*! width: calc(100% / 6) — lightningcss: 16.6667% — ours keeps the digits Firefox lays a percentage out with */.k009{width:16.6666667%}",
185+
"/*! width: calc(100% / 7) — lightningcss: 14.2857% — ours keeps the digits Firefox lays a percentage out with */.k010{width:14.285714%}",
186186
"/*! width: calc(100% / 8) — same as lightningcss: 12.5% */.k011{width:12.5%}",
187-
"/*! width: calc(100% / 9) — same as lightningcss: 11.1111% */.k012{width:11.1111%}",
188-
"/*! width: calc(100% / 12) — same as lightningcss: 8.33333% */.k013{width:8.33333%}",
189-
"/*! width: calc(100% * 2 / 3) — same as lightningcss: 66.6667% */.k014{width:66.6667%}",
187+
"/*! width: calc(100% / 9) — lightningcss: 11.1111% — ours keeps the digits Firefox lays a percentage out with */.k012{width:11.111111%}",
188+
"/*! width: calc(100% / 12) — lightningcss: 8.33333% — ours keeps the digits Firefox lays a percentage out with */.k013{width:8.333333%}",
189+
"/*! width: calc(100% * 2 / 3) — lightningcss: 66.6667% — ours keeps the digits Firefox lays a percentage out with */.k014{width:66.666667%}",
190190
"/*! width: calc(200px / 3) — same as lightningcss: 66.6667px */.k015{width:66.6667px}",
191191
"/*! width: calc(1px / 3) — same as lightningcss: .333333px */.k016{width:.333333px}",
192192
"/*! width: calc(-1px / 3) — lightningcss: -.333333px — a bare negative is invalid here, where calc() clamps it to 0 */.k017{width:calc(-1px/3)}",
@@ -225,7 +225,7 @@ Array [
225225
"/*! width: calc(100% - (10px - 5px)) — same as lightningcss: calc(100% - 5px) */.k050{width:calc(100% - 5px)}",
226226
"/*! width: calc(-1 * (100% - 10px)) — same as lightningcss: calc(-100% + 10px) */.k051{width:calc(-100% + 10px)}",
227227
"/*! width: calc(100% / 3 - 10px) — lightningcss: calc(33.3333% - 10px) — ours is shorter */.k052{width:calc(100%/3 - 10px)}",
228-
"/*! width: calc(100% / 3 + 100% / 3) — same as lightningcss: 66.6667% */.k053{width:66.6667%}",
228+
"/*! width: calc(100% / 3 + 100% / 3) — lightningcss: 66.6667% — ours keeps the digits Firefox lays a percentage out with */.k053{width:66.666667%}",
229229
"/*! opacity: calc(1 / 3) — same as lightningcss: .333333 */.k054{opacity:.333333}",
230230
"/*! opacity: calc(1 / 2) — same as lightningcss: .5 */.k055{opacity:.5}",
231231
"/*! opacity: calc(0.5 + 0.25) — same as lightningcss: .75 */.k056{opacity:.75}",
@@ -309,20 +309,20 @@ Array [
309309
"/*! width: -moz-calc(1px + 2px) — same as lightningcss: -moz-calc(1px + 2px) */.k134{width:-moz-calc(1px + 2px)}",
310310
"/*! margin: calc(1px + 1px) calc(2px * 2) — same as lightningcss: 2px 4px */.k135{margin:2px 4px}",
311311
"/*! margin: calc(10px / 3) 0 — same as lightningcss: 3.33333px 0 */.k136{margin:3.33333px 0}",
312-
"/*! transform: translateX(calc(100% / 3)) — same as lightningcss: translate(33.3333%) */.k137{transform:translate(33.3333%)}",
313-
"/*! transform: translate(calc(10px + 5px), calc(100% / 3)) — same as lightningcss: translate(15px,33.3333%) */.k138{transform:translate(15px,33.3333%)}",
312+
"/*! transform: translateX(calc(100% / 3)) — lightningcss: translate(33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k137{transform:translate(33.333333%)}",
313+
"/*! transform: translate(calc(10px + 5px), calc(100% / 3)) — lightningcss: translate(15px,33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k138{transform:translate(15px,33.333333%)}",
314314
"/*! transform: rotate(calc(45deg * 2)) — same as lightningcss: rotate(90deg) */.k139{transform:rotate(90deg)}",
315315
"/*! transform: scale(calc(1 / 3)) — same as lightningcss: scale(.333333) */.k140{transform:scale(.333333)}",
316-
"/*! background-position: calc(100% / 3) calc(50% + 10px) — lightningcss: 33.3333% calc(50% + 10px) — the same value, ours dropping a space the tokens do not need */.k141{background-position:33.3333%calc(50% + 10px)}",
317-
"/*! grid-template-columns: repeat(3, calc(100% / 3)) — same as lightningcss: repeat(3,33.3333%) */.k142{grid-template-columns:repeat(3,33.3333%)}",
316+
"/*! background-position: calc(100% / 3) calc(50% + 10px) — lightningcss: 33.3333% calc(50% + 10px) — ours keeps the digits Firefox lays a percentage out with */.k141{background-position:33.333333%calc(50% + 10px)}",
317+
"/*! grid-template-columns: repeat(3, calc(100% / 3)) — lightningcss: repeat(3,33.3333%) — ours keeps the digits Firefox lays a percentage out with */.k142{grid-template-columns:repeat(3,33.333333%)}",
318318
"/*! box-shadow: calc(1px + 1px) 0 calc(4px / 3) #000 — lightningcss: 2px 0 1.33333px #000 — the same value, ours dropping a space the tokens do not need */.k143{box-shadow:2px 0 1.33333px#000}",
319319
"/*! color: rgb(calc(255 / 3) 0 0) — same as lightningcss: #500 */.k144{color:#500}",
320320
"/*! color: rgb(calc(100 + 55) 0 0) — same as lightningcss: #9b0000 */.k145{color:#9b0000}",
321321
"/*! color: hsl(calc(360 / 7) 50% 50%) — same as lightningcss: #bfad40 */.k146{color:#bfad40}",
322322
"/*! color: rgb(0 0 0 / calc(1 / 3)) — same as lightningcss: #0005 */.k147{color:#0005}",
323323
"/*! font: calc(10px + 2px)/1.5 serif — same as lightningcss: 12px/1.5 serif */.k148{font:12px/1.5 serif}",
324-
"/*! border-radius: calc(100% / 3) — same as lightningcss: 33.3333% */.k149{border-radius:33.3333%}",
325-
"/*! inset: calc(100% / 3) 0 0 0 — lightningcss: 33.3333% 0 0 — the same value, ours dropping a space the tokens do not need */.k150{inset:33.3333%0 0}",
324+
"/*! border-radius: calc(100% / 3) — lightningcss: 33.3333% — ours keeps the digits Firefox lays a percentage out with */.k149{border-radius:33.333333%}",
325+
"/*! inset: calc(100% / 3) 0 0 0 — lightningcss: 33.3333% 0 0 — ours keeps the digits Firefox lays a percentage out with */.k150{inset:33.333333%0 0}",
326326
"/*! width: calc(100% / 3 * 3) — same as lightningcss: 100% */.k151{width:100%}",
327327
"/*! width: calc(1px * 3 / 3) — same as lightningcss: 1px */.k152{width:1px}",
328328
"/*! width: calc(1 / 3 * 3px) — same as lightningcss: 1px */.k153{width:1px}",
@@ -348,7 +348,7 @@ Array [
348348
"/*! rotate: calc(1turn - 90deg) — same as lightningcss: 270deg */.k173{rotate:270deg}",
349349
"/*! aspect-ratio: 16 / 9 — same as lightningcss: 16/9 */.k174{aspect-ratio:16/9}",
350350
"/*! aspect-ratio: auto 16 / 9 — same as lightningcss: auto 16/9 */.k175{aspect-ratio:auto 16/9}",
351-
"/*! background: linear-gradient(red calc(100% / 3), blue) — lightningcss: linear-gradient(red 33.3333%,#00f) — the same length either way */.k176{background:linear-gradient(red 33.3333%,blue)}",
351+
"/*! background: linear-gradient(red calc(100% / 3), blue) — lightningcss: linear-gradient(red 33.3333%,#00f) — ours keeps the digits Firefox lays a percentage out with */.k176{background:linear-gradient(red 33.333333%,blue)}",
352352
]
353353
`;
354354

@@ -1537,7 +1537,7 @@ Array [
15371537
"/*! webpack: \`@container\` carries media features too, name and all */@container card (width>=1px){.t69{color:red}}",
15381538
"/*! declined: a plain feature has no range spelling to reach for */@media (width:100px){.t70{color:red}}",
15391539
"/*! declined: a \`@supports\` condition is a declaration, not a media feature */@supports (min-width:1px){.t71{color:red}}",
1540-
"/*! webpack: 6 significant digits is below what the engine reports */.t72{width:33.3333%}",
1540+
"/*! webpack: a percentage keeps the digits of the float Firefox parses */.t72{width:33.333333%}",
15411541
"/*! webpack: ...and below the 1/64px it lays a length out in */.t73{width:1px}",
15421542
"/*! webpack: ...for a unitless number too */.t74{opacity:.123457}",
15431543
"/*! webpack: declined: an angle is amplified by the trig in rotate() */.t75{transform:rotate(33.33333333deg)}",

0 commit comments

Comments
 (0)