Skip to content

Commit 9f612ba

Browse files
committed
test: part a pixel from a name that begins outside ASCII
The separator after a painted color tested only ASCII name characters, so a value the printer wrote tight against a non-ASCII ident compared unequal to the source it came from — a divergence the printer had not made. CSS Syntax 4.2 counts anything non-ASCII as a name code point.
1 parent e3a7343 commit 9f612ba

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎test/helpers/syntaxEquivalence.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ const installHelpers = () => {
275275
// One word, so a number with its unit is read whole rather than as an ident.
276276
const WORD_RE = /[\w-]/;
277277

278+
// CSS Syntax §4.2: a name code point is also anything non-ASCII, which the
279+
// token after a color can start with.
280+
const NAME_RE = /[\w-]|[\u0080-\uFFFF]/;
281+
278282
/**
279283
* Every color a value holds, as the pixel it paints. A color the engine hands
280284
* back as written — a `var()` fallback, the one `image()` carries — is a color
@@ -302,7 +306,7 @@ const installHelpers = () => {
302306
COLOR_TOKEN_RE,
303307
(color, at, whole) =>
304308
`${painted(color)}${
305-
WORD_RE.test(whole[at + color.length] || "") ? " " : ""
309+
NAME_RE.test(whole[at + color.length] || "") ? " " : ""
306310
}`
307311
);
308312
for (const ch of painting) {

‎tooling/compare-html-minifiers.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ const load = (name) => require(path.join(MODULES, name));
134134
// form markup. Neither installed fixture carries an inline `<style>`, a
135135
// `srcset` or a boolean attribute, so without this the comparison cannot see
136136
// what a minifier does with any of them.
137-
// Whether a tool minifies, passes through or mangles a large `<style>` is what
138-
// the inlined sheets decide.
139137
/** @type {[string, string][]} */
140138
const INSTALLED_DOCUMENTS = [
141139
["HTML5 Boilerplate 9", "html5-boilerplate/dist/index.html"],

0 commit comments

Comments
 (0)