GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(css): fix the CSS printer bugs the syntax fuzzer found (#23499) · webpack/webpack@a1ad02f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .changeset
    • 050-html-syntax-fuzz-fixes.md
  • lib/css
    • syntax-parser.js
    • syntax-printer.js
  • test
    • configCases/css/minify-css
      • __snapshots__
        • ConfigCacheTest.snap
        • ConfigTest.snap
      • minify-chrome-100/minify-nested-idempotent
        • style.css
    • fixtures
      • css
        • css-syntax-beautifying-keeps-a-replacement-in-an-at-rule-prelude
          • index.css
          • options.json
        • css-syntax-minify-keeps-a-condition-mixing-and-with-or-whole
          • index.css
        • css-syntax-minify-keeps-a-layered-value-with-an-empty-layer
          • index.css
        • css-syntax-minify-lowering-a-rule-nested-in-one-with-an-empty-prelude
          • README.md
        • syntax-fuzz-a-layered-background-drops-each-layers-boxes
          • index.css
        • syntax-fuzz-a-supports-condition-drops-a-repeat-its-doubled-parentheses-hid
          • index.css
        • syntax-fuzz-an-unclosed-legal-comment-prints-once
          • expected.json
          • index.css
        • syntax-fuzz-an-unclosed-legal-comment-prints-twice
          • expected.json
        • syntax-fuzz-an-unclosed-style-query-keeps-its-parenthesis
          • index.css
        • syntax-fuzz-an-unclosed-style-query-loses-its-parenthesis
          • expected.json
        • syntax-fuzz-beautify-drops-the-space-in-an-empty-media-condition
          • expected.json
        • syntax-fuzz-beautify-keeps-a-comment-between-two-tokens
          • index.css
          • options.json
        • syntax-fuzz-beautify-keeps-an-at-rule-condition-as-written
          • index.css
          • options.json
        • syntax-fuzz-beautify-keeps-the-space-in-an-empty-media-condition
          • index.css
          • options.json
        • syntax-fuzz-beautify-writes-a-space-for-a-comment
          • expected.json
        • syntax-fuzz-keeps-a-string-in-an-unknown-supports-condition
          • index.css
        • syntax-fuzz-lowering-drops-what-an-invalid-selector-list-holds
          • index.css
          • options.json
        • syntax-fuzz-unquotes-a-string-in-an-unknown-supports-condition
          • expected.json
        • syntax-fuzz-unquotes-an-attribute-value-only-in-a-selector
          • index.css
      • html
        • syntax-fuzz-an-embedded-supports-condition-drops-a-repeat-its-doubled-parentheses-hid
          • index.html
        • syntax-fuzz-an-embedded-supports-condition-loses-parentheses
          • expected.json
    • unitCases
      • css/__snapshots__
        • invariants.unittest.js.snap
        • printer.unittest.js.snap
      • html/__snapshots__
        • invariants.unittest.js.snap
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.changeset/050-html-syntax-fuzz-fixes.md‎

Copy file name to clipboardExpand all lines: .changeset/050-html-syntax-fuzz-fixes.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"webpack": patch
33
---
44

5-
Fix HTML parser and minifier bugs the syntax fuzzer found.
5+
Fix CSS and HTML parser and minifier bugs the syntax fuzzer found.
Collapse file

‎lib/css/syntax-parser.js‎

Copy file name to clipboardExpand all lines: lib/css/syntax-parser.js
+28-13Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,7 @@ const setupParse = (input, lc, parseError, originalInput = input) => {
22442244
S._inSupportsSelector = false;
22452245
S._inStyleAttribute = false;
22462246
S._inMediaConditionPrelude = false;
2247+
S._inAtRulePrelude = false;
22472248
S._inPropertyRule = false;
22482249
S._inFunctionRule = false;
22492250
S._inFeatureValuesRule = false;
@@ -5010,6 +5011,8 @@ const readsColorsAsNumbers = (i0, vs, ve) => {
50105011
*/
50115012
const enterAtRulePrelude = (i0) => {
50125013
const atName = atKeyword(S._input.slice(S._starts[i0] + 1, S._aux0[i0]));
5014+
// Tokens rather than a selector, but for `@scope`'s.
5015+
S._inAtRulePrelude = atName !== "scope";
50135016
if (atName === "property") {
50145017
S._inPropertyRule = true;
50155018
} else if (atName === "function") {
@@ -5138,6 +5141,7 @@ const walkRule = (node, parent, index, writer) => {
51385141
// the recursion, since the conditions nest.
51395142
const prevSupports = S._inSupportsPrelude;
51405143
const prevMedia = S._inMediaConditionPrelude;
5144+
const prevAtRule = S._inAtRulePrelude;
51415145
const prevProperty = S._inPropertyRule;
51425146
const prevFunction = S._inFunctionRule;
51435147
const prevFeatureValues = S._inFeatureValuesRule;
@@ -5152,6 +5156,7 @@ const walkRule = (node, parent, index, writer) => {
51525156
}
51535157
S._inSupportsPrelude = prevSupports;
51545158
S._inMediaConditionPrelude = prevMedia;
5159+
S._inAtRulePrelude = prevAtRule;
51555160
if (S._recurseBlocks) {
51565161
// Declarations then child rules - downstream consumers don't need them strictly interleaved in source order.
51575162
const bi = S._bodyIdx[i0];
@@ -6105,7 +6110,8 @@ const streamEnterRule = (rule, parent, index, d) => {
61056110
const pe = ps + S._listLengths[i0];
61066111
const prevSupports = S._inSupportsPrelude;
61076112
const prevMedia = S._inMediaConditionPrelude;
6108-
// Body-scoped, unlike the two prelude flags: the block streams past this call,
6113+
const prevAtRule = S._inAtRulePrelude;
6114+
// Body-scoped, unlike the prelude flags: the block streams past this call,
61096115
// so `streamConsumeBlock` puts them back once its `}` is reached.
61106116
S._framePrevProperty[d] = S._inPropertyRule ? 1 : 0;
61116117
S._framePrevFunction[d] = S._inFunctionRule ? 1 : 0;
@@ -6116,6 +6122,7 @@ const streamEnterRule = (rule, parent, index, d) => {
61166122
}
61176123
S._inSupportsPrelude = prevSupports;
61186124
S._inMediaConditionPrelude = prevMedia;
6125+
S._inAtRulePrelude = prevAtRule;
61196126
return false;
61206127
};
61216128

@@ -9692,9 +9699,10 @@ const isSign = (fragment) => fragment === "+" || fragment === "-";
96929699
* @param {string[]} parts printed fragments in source order
96939700
* @param {boolean} beautify whether every separator is kept
96949701
* @param {number} trim one of the `_TRIM_*` modes
9702+
* @param {boolean=} tokens whether whitespace here is a token a reader keeps
96959703
* @returns {string} the joined text
96969704
*/
9697-
const join = (parts, beautify, trim) => {
9705+
const join = (parts, beautify, trim, tokens) => {
96989706
let out = "";
96999707
let last = -1;
97009708
// The last code unit of `out` as written, which `last` may stand in for.
@@ -9727,10 +9735,10 @@ const join = (parts, beautify, trim) => {
97279735
pending = false;
97289736
} else if (out.length !== 0 && wouldFuseTokens(last, f, out)) {
97299737
// Nothing separated these in source, yet joining them would read back as
9730-
// one token. Whitespace is a combinator in a selector and makes a sign a
9731-
// math operator, so there only an empty comment parts them (§9).
9738+
// one token. Whitespace is a selector's combinator, a sign's operator and
9739+
// a token where `tokens` says so: only an empty comment parts them (§9).
97329740
const separator =
9733-
trim === TRIM_COMBINATORS || isSign(previous) || isSign(f)
9741+
tokens || trim === TRIM_COMBINATORS || isSign(previous) || isSign(f)
97349742
? "/**/"
97359743
: separatorAfter(out);
97369744
out += separator;
@@ -12987,20 +12995,22 @@ const dropImpliedMediaType = (parts) => {
1298712995
* @returns {void}
1298812996
*/
1298912997
const dropRepeatedConditions = (parts) => {
12998+
// A chain of one operator only, checked whole before anything goes: a mix is
12999+
// invalid, and dropping an operand of it could leave a valid condition.
13000+
let operator = "";
13001+
for (let i = 1; i < parts.length; i++) {
13002+
const lowered = asciiLowercaseName(parts[i]);
13003+
if (lowered !== "and" && lowered !== "or") continue;
13004+
if (operator !== "" && operator !== lowered) return;
13005+
operator = lowered;
13006+
}
1299013007
/** @type {Set<string>} */
1299113008
const stated = new Set();
12992-
let operator = "";
1299313009
for (let i = 1; i < parts.length; i++) {
1299413010
const part = parts[i];
1299513011
if (part.length === 0 || part === " ") continue;
1299613012
const lowered = asciiLowercaseName(part);
12997-
if (lowered === "and" || lowered === "or") {
12998-
// A chain of one operator only: anything else and the operands are no
12999-
// longer a flat list of this one's.
13000-
if (operator !== "" && operator !== lowered) return;
13001-
operator = lowered;
13002-
continue;
13003-
}
13013+
if (lowered === "and" || lowered === "or") continue;
1300413014
// Only a parenthesized operand is one this can compare whole; a bare
1300513015
// `not` or a declaration's own tokens are parts of one.
1300613016
if (part.charCodeAt(0) !== CC_LEFT_PARENTHESIS) return;
@@ -19288,6 +19298,8 @@ const rulePrelude = (path, writer, minify, outParts) => {
1928819298
if (supports && S._transforms.shortenMediaQueries) {
1928919299
if (S._prefixBrowsers !== null) dropDeadPrefixedTests(parts);
1929019300
dropRedundantSupportsParens(parts);
19301+
// Again: `((A)) or (A)` only repeats `(A)` once its doubled pair is gone.
19302+
dropRepeatedConditions(parts);
1929119303
}
1929219304
if (media || container) {
1929319305
minifyMediaQueryParts(parts, media);
@@ -21270,6 +21282,9 @@ class CssSyntaxTree {
2127021282
// Set by the walk while inside a `@supports` prelude: the declaration there is
2127121283
// the subject of a feature test, so a value rewrite would change the question.
2127221284
this._inSupportsPrelude = false;
21285+
// Set by the walk while inside an at-rule prelude that is no selector, where a
21286+
// `[...]` is a block of tokens rather than an attribute selector.
21287+
this._inAtRulePrelude = false;
2127321288
// Set for a `block-contents` print, which is a `style=""` value: a string is
2127421289
// quoted so the list holds one quote kind, and the attribute escapes none.
2127521290
this._inStyleAttribute = false;
Collapse file

‎lib/css/syntax-printer.js‎

Copy file name to clipboardExpand all lines: lib/css/syntax-printer.js
+110-20Lines changed: 110 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,14 @@ const namesParent = (selector) => {
26062606
return false;
26072607
};
26082608

2609+
/**
2610+
* Whether a selector list holds an empty selector, which makes it invalid.
2611+
* @param {string} prelude a printed selector list
2612+
* @returns {boolean} true when one of its selectors is empty
2613+
*/
2614+
const holdsEmptySelector = (prelude) =>
2615+
splitSelectorList(prelude).some((one) => trimCssWhiteSpace(one).length === 0);
2616+
26092617
/**
26102618
* The prelude a rule nested in one written `parent` says on its own, with every
26112619
* `&` written out and a selector naming none made the descendant it means.
@@ -2785,8 +2793,17 @@ const writeNested = (
27852793
// Read only once a rule written in this one asks.
27862794
/** @type {string | undefined} */
27872795
let against;
2796+
// An empty selector makes a list invalid, and with it every rule written in
2797+
// it, which no hoisted copy may bring back to life.
2798+
/** @type {boolean | undefined} */
2799+
let invalid;
27882800
for (let i = S._pendingNested.length - 1; i >= 0; i--) {
27892801
if (S._pendingNested[i].owner !== node) continue;
2802+
if (invalid === undefined) invalid = holdsEmptySelector(prelude);
2803+
if (invalid || holdsEmptySelector(S._pendingNested[i].prelude)) {
2804+
S._pendingNested.splice(i, 1);
2805+
continue;
2806+
}
27902807
if (against === undefined) {
27912808
against =
27922809
path.parent !== null && path.type(path.parent) !== NodeType.Stylesheet
@@ -4522,6 +4539,40 @@ const positionPercentage = (written, axis) => {
45224539
return lower.endsWith("%") ? lower : null;
45234540
};
45244541

4542+
/**
4543+
* `dropLayerInitials` over each layer a comma parts, whose position and boxes say
4544+
* nothing of the next one's. A layer it would empty is kept as written.
4545+
* @param {string} property the declaration's lowercased property name
4546+
* @param {string[]} components the value's top-level components
4547+
* @returns {string[] | null} the fragments to join, or `null` to keep the value
4548+
*/
4549+
const dropEachLayerInitials = (property, components) => {
4550+
const layers = valueLayers(components);
4551+
if (layers.length === 1) return dropLayerInitials(property, components);
4552+
// A quoted string could carry a comma the layer split would part.
4553+
for (const component of components) {
4554+
if (component.includes('"') || component.includes("'")) return null;
4555+
}
4556+
/** @type {string[]} */
4557+
const out = [];
4558+
let changed = false;
4559+
for (let i = 0; i < layers.length; i++) {
4560+
let layer = layers[i];
4561+
// An empty layer makes the value invalid, which no rewrite may make valid.
4562+
if (layer.length === 0) return null;
4563+
const dropped = dropLayerInitials(property, layer);
4564+
if (dropped !== null && dropped.length !== 0) {
4565+
layer = dropped;
4566+
changed = true;
4567+
}
4568+
for (let j = 0; j < layer.length; j++) {
4569+
const last = j === layer.length - 1 && i !== layers.length - 1;
4570+
out.push(last ? `${layer[j]},` : layer[j]);
4571+
}
4572+
}
4573+
return changed ? out : null;
4574+
};
4575+
45254576
// The spellings of the transparent black a `background` color starts as.
45264577
const TRANSPARENT_SPELLINGS = new Set(["transparent", "#0000", "#00000000"]);
45274578

@@ -4860,7 +4911,7 @@ const collapseShorthand = (path, property, node, writer) => {
48604911
// A family's slots are read by what each takes rather than by an enumerated
48614912
// list, answering for a color and a length where the keyword table cannot. A
48624913
// layered shorthand reads position, size and boxes positionally.
4863-
const layered = dropLayerInitials(property, written);
4914+
const layered = dropEachLayerInitials(property, written);
48644915
let dropped = readable
48654916
? dropFamilyInitials(property, written) ||
48664917
dropInitialKeywords(property, layered || written) ||
@@ -5396,6 +5447,28 @@ const printAttributeSelector = (path, children, writer) => {
53965447
return parts;
53975448
};
53985449

5450+
/**
5451+
* A block or function as written, its comments' queued copies claimed, where its
5452+
* source closes it; one the input ran out in prints as usual, so the walk closes it.
5453+
* @param {CssPath} path the accessor positioned on the node
5454+
* @param {PrintContext} writer the print context
5455+
* @param {string} close the token that closes it
5456+
* @returns {string | null} the source, or null where the input left it open
5457+
*/
5458+
const writtenWhole = (path, writer, close) => {
5459+
// A node holding a visitor's replacement prints as its children printed.
5460+
if (S._transforms === S._plainTransforms) return null;
5461+
const source = printedSource(path.node);
5462+
if (!source.endsWith(close)) return null;
5463+
// A last child ending where the node does holds the closing token that is there.
5464+
const count = path.childCount();
5465+
if (count !== 0 && path.end(path.child(count - 1)) === path.end()) {
5466+
return null;
5467+
}
5468+
writer.takeInserts(path.start(), path.end());
5469+
return source;
5470+
};
5471+
53995472
/**
54005473
* The `printer` case for a function.
54015474
* @param {CssPath} path the accessor positioned on the finished node
@@ -5408,24 +5481,17 @@ const printFunctionNode = (path, writer, minify) => {
54085481
// An escape spells the same name (§4.3.7): `c\61 lc(` is `calc()`, so
54095482
// every table below reads what it spells.
54105483
const name = written.includes("\\") ? unescapeIdentifier(written) : written;
5411-
// A container style query asks whether a custom property's value is the one
5412-
// written here, comparing token streams as written (CSS Conditional 5 §5),
5413-
// so a squeezed whitespace run asks another question. Nothing is rewritten.
5484+
// A style query compares token streams as written (CSS Conditional 5 §5), and a
5485+
// beautified at-rule prelude keeps each function as written, as its blocks.
54145486
if (
5415-
minify &&
5416-
!path.within(NODE_TYPE_DECLARATION) &&
5417-
S._inMediaConditionPrelude &&
5418-
asciiCaseInsensitiveMatch(name, "style")
5487+
minify
5488+
? !path.within(NODE_TYPE_DECLARATION) &&
5489+
S._inMediaConditionPrelude &&
5490+
asciiCaseInsensitiveMatch(name, "style")
5491+
: S._inAtRulePrelude && !S._inSupportsSelector
54195492
) {
5420-
const source = printedSource(path.node);
5421-
// Unclosed at EOF, the source carries no `)` for the walk to have
5422-
// closed - printed as usual so the parenthesis is written back.
5423-
if (source.endsWith(")")) {
5424-
// Written whole, comments included, so the queued copies are claimed
5425-
// here rather than flushed a second time after the rule.
5426-
writer.takeInserts(path.start(), path.end());
5427-
return source;
5428-
}
5493+
const whole = writtenWhole(path, writer, ")");
5494+
if (whole !== null) return whole;
54295495
}
54305496
let inner;
54315497
if (path.childCount() === 1) {
@@ -5463,7 +5529,13 @@ const printFunctionNode = (path, writer, minify) => {
54635529
}
54645530
dropImpliedUniversalSelector(parts);
54655531
}
5466-
inner = join(parts, !minify, minify ? trim : TRIM_NOTHING);
5532+
// Beautified, a selector's function keeps its tokens as its blocks do.
5533+
inner = join(
5534+
parts,
5535+
!minify,
5536+
minify ? trim : TRIM_NOTHING,
5537+
!minify && !path.within(NODE_TYPE_DECLARATION)
5538+
);
54675539
// A leading `+` in An+B is a sign, not a combinator: `+ n` is no
54685540
// argument an engine reads, and `+n` would be one.
54695541
if (minify && NTH_PSEUDO_FUNCTIONS.has(lower)) {
@@ -5921,13 +5993,23 @@ const printIdentNode = (path, minify) => {
59215993
const printSimpleBlockNode = (path, writer, minify) => {
59225994
const open = blockTokenOf(path.node);
59235995
const close = open === "(" ? ")" : open === "[" ? "]" : "}";
5996+
// Beautified, an at-rule prelude's block prints as written: an engine keeps the
5997+
// text of a condition it does not know, whitespace and comments included.
5998+
if (!minify && S._inAtRulePrelude && !S._inSupportsSelector) {
5999+
const whole = writtenWhole(path, writer, close);
6000+
if (whole !== null) return whole;
6001+
}
59246002
// Outside a declaration value a `[...]` is an attribute selector and a `(...)`
59256003
// a query condition. Inside one they are a grid line-name list and a
59266004
// `calc()` sub-expression, where neither of those rewrites holds.
59276005
const structural = minify && !path.within(NODE_TYPE_DECLARATION);
59286006
/** @type {string[]} */
59296007
let parts;
5930-
if (structural && open === "[") {
6008+
if (
6009+
structural &&
6010+
open === "[" &&
6011+
(!S._inAtRulePrelude || S._inSupportsSelector)
6012+
) {
59316013
parts = printAttributeSelector(path, path.children(), writer);
59326014
} else {
59336015
// One array, rather than a child list and a mapped copy of it.
@@ -5954,7 +6036,13 @@ const printSimpleBlockNode = (path, writer, minify) => {
59546036
trim = inScopePrelude(path) ? TRIM_COMBINATORS : TRIM_CONDITIONS;
59556037
if (trim === TRIM_COMBINATORS) foldPseudoNames(parts);
59566038
}
5957-
const inner = join(parts, !minify, trim);
6039+
// Beautified, a selector's block keeps its tokens: no space where a comment was.
6040+
const inner = join(
6041+
parts,
6042+
!minify,
6043+
trim,
6044+
!minify && !path.within(NODE_TYPE_DECLARATION)
6045+
);
59586046
return `${open}${inner}${close}`;
59596047
};
59606048

@@ -6629,6 +6717,8 @@ const printer = (path, writer) => {
66296717
if (minify) S._blockSpans.push(NO_BLOCK_ENTRY);
66306718
{
66316719
const raw = printedSource(path.node);
6720+
// Written whole, comments included, so the queued copies are claimed.
6721+
writer.takeInserts(path.start(), path.end());
66326722
let rest = path.end();
66336723
while (
66346724
rest < S._input.length &&
Collapse file

‎test/configCases/css/minify-css/__snapshots__/ConfigCacheTest.snap‎

Copy file name to clipboardExpand all lines: test/configCases/css/minify-css/__snapshots__/ConfigCacheTest.snap
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ exports[`ConfigCacheTestCases css minify-css minify-css should compile: minify-m
474474
475475
exports[`ConfigCacheTestCases css minify-css minify-css should compile: minify-nested-combinator 1`] = `".a>.child{top:0}.b+.next{top:1px}.c~.later{top:2px}.d>.child{top:3px}.e || .col{top:4px}.f .inside{top:5px}:is(.g,.h)>.child{top:6px}.i>.child{top:7px}.j .z,.j+.y,.j>.x{left:0}"`;
476476
477-
exports[`ConfigCacheTestCases css minify-css minify-css should compile: minify-nested-idempotent 1`] = `".a{width:1px}.mid{color:teal}.a{height:2px}.a .x{color:red}.p,.q .r{color:blue}.q .s{color:green}.t{--c:1;color:navy}.t .u{color:navy}.v,.v .w{top:0}.z{top:1px}.y{.y{color:olive}--c:1;color:olive}.k .l,.l .m{left:0}@media print{.k .l{left:0}}.e,.e f: (1) [2]{g:h}.e .i{top:0}"`;
477+
exports[`ConfigCacheTestCases css minify-css minify-css should compile: minify-nested-idempotent 1`] = `".a{width:1px}.mid{color:teal}.a{height:2px}.a .x{color:red}.p,.q .r{color:blue}.q .s{color:green}.t{--c:1;color:navy}.t .u{color:navy}.v,.v .w{top:0}.z{top:1px}.y{.y{color:olive}--c:1;color:olive}.k .l,.l .m{left:0}@media print{.k .l{left:0}}.e .i{top:0}"`;
478478
479479
exports[`ConfigCacheTestCases css minify-css minify-css should compile: minify-selectors-and-functions 1`] = `".s0::checkmark{order:1}.s1::highlight(x){order:2}.s2::selection{order:3}.s3:buffering{order:4}.s4:defined{order:5}.s5:enabled{order:6}.s6:has-slotted{order:7}.s7:in-range{order:8}.s8:muted{order:9}.s9:optional{order:10}.s10:out-of-range{order:11}.s11:paused{order:12}.s12:picture-in-picture{order:13}.s13:playing{order:14}.s14:read-write{order:15}.s15:required{order:16}.s16:seeking{order:17}.s17:stalled{order:18}.s18:volume-locked{order:19}.p:-moz-read-write{color:red}.k0{-webkit-ruby-position:over}.k1{-webkit-ruby-position:under}.k2{-webkit-text-orientation:mixed}.k3{-webkit-text-orientation:upright}.k4{-webkit-text-orientation:sideways}.r{width:random-item(--k,1px,2px)}"`;
480480
Collapse file

‎test/configCases/css/minify-css/__snapshots__/ConfigTest.snap‎

Copy file name to clipboardExpand all lines: test/configCases/css/minify-css/__snapshots__/ConfigTest.snap
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ exports[`ConfigTestCases css minify-css minify-css should compile: minify-modern
474474
475475
exports[`ConfigTestCases css minify-css minify-css should compile: minify-nested-combinator 1`] = `".a>.child{top:0}.b+.next{top:1px}.c~.later{top:2px}.d>.child{top:3px}.e || .col{top:4px}.f .inside{top:5px}:is(.g,.h)>.child{top:6px}.i>.child{top:7px}.j .z,.j+.y,.j>.x{left:0}"`;
476476
477-
exports[`ConfigTestCases css minify-css minify-css should compile: minify-nested-idempotent 1`] = `".a{width:1px}.mid{color:teal}.a{height:2px}.a .x{color:red}.p,.q .r{color:blue}.q .s{color:green}.t{--c:1;color:navy}.t .u{color:navy}.v,.v .w{top:0}.z{top:1px}.y{.y{color:olive}--c:1;color:olive}.k .l,.l .m{left:0}@media print{.k .l{left:0}}.e,.e f: (1) [2]{g:h}.e .i{top:0}"`;
477+
exports[`ConfigTestCases css minify-css minify-css should compile: minify-nested-idempotent 1`] = `".a{width:1px}.mid{color:teal}.a{height:2px}.a .x{color:red}.p,.q .r{color:blue}.q .s{color:green}.t{--c:1;color:navy}.t .u{color:navy}.v,.v .w{top:0}.z{top:1px}.y{.y{color:olive}--c:1;color:olive}.k .l,.l .m{left:0}@media print{.k .l{left:0}}.e .i{top:0}"`;
478478
479479
exports[`ConfigTestCases css minify-css minify-css should compile: minify-selectors-and-functions 1`] = `".s0::checkmark{order:1}.s1::highlight(x){order:2}.s2::selection{order:3}.s3:buffering{order:4}.s4:defined{order:5}.s5:enabled{order:6}.s6:has-slotted{order:7}.s7:in-range{order:8}.s8:muted{order:9}.s9:optional{order:10}.s10:out-of-range{order:11}.s11:paused{order:12}.s12:picture-in-picture{order:13}.s13:playing{order:14}.s14:read-write{order:15}.s15:required{order:16}.s16:seeking{order:17}.s17:stalled{order:18}.s18:volume-locked{order:19}.p:-moz-read-write{color:red}.k0{-webkit-ruby-position:over}.k1{-webkit-ruby-position:under}.k2{-webkit-text-orientation:mixed}.k3{-webkit-text-orientation:upright}.k4{-webkit-text-orientation:sideways}.r{width:random-item(--k,1px,2px)}"`;
480480
Collapse file

‎test/configCases/css/minify-css/minify-chrome-100/minify-nested-idempotent/style.css‎

Copy file name to clipboardExpand all lines: test/configCases/css/minify-css/minify-chrome-100/minify-nested-idempotent/style.css
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
.l .m { left: 0 }
2626
@media print { .k .l { left: 0 } }
2727

28-
/* An empty selector in a list the printer keeps has no descendant to part. */
28+
/* An empty selector makes the list invalid, so lowering drops its rule. */
2929
.e { f: (1) [2], { g: h }; .i { top: 0 } }
Collapse file

‎test/fixtures/css/css-syntax-beautifying-keeps-a-replacement-in-an-at-rule-prelude/index.css‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@media (width:1px){a{color:red}}@container style(--a:1px){a{color:red}}
Collapse file

‎test/fixtures/css/css-syntax-beautifying-keeps-a-replacement-in-an-at-rule-prelude/options.json‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"mode": "beautify",
4+
"visit": {
5+
"types": ["Dimension"],
6+
"at": [{ "type": "Dimension", "source": "1px", "do": "replace", "with": "2px" }]
7+
}
8+
}
9+
]
Collapse file

‎test/fixtures/css/css-syntax-minify-keeps-a-condition-mixing-and-with-or-whole/index.css‎

Copy file name to clipboardExpand all lines: test/fixtures/css/css-syntax-minify-keeps-a-condition-mixing-and-with-or-whole/index.css
+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎test/fixtures/css/css-syntax-minify-keeps-a-layered-value-with-an-empty-layer/index.css‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a{background:,none padding-box border-box}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.