Skip to content

Commit 8b57509

Browse files
test: file what WebKit sees and hold it like the other two engines
The first WebKit run reported 24 differences over 5803 checks, and they are five causes. Each is filed with what was measured, so the row blocks like Chrome's and Firefox's rather than reporting past a CI flag. Three are the harness meeting a third engine. WebKit reads a different `document.compatMode` for the two forms of eleven files and the reverse for two, which a direction that flips per file says is how the document is built rather than what the printer wrote. It lays out in sixty-fourths of a pixel, so `112px` reads back as `111.984375px` in five framework stylesheets. And it serializes a computed number to six significant digits where Blink keeps more — which is the printer's own cap, so the whole-element comparison now reads both sides at that precision, Chromium excepted since the fixtures were measured against it. Two are the engine: no `fetchpriority` reflection, so `high` and `low` both read `auto`; no CSS Painting API, so a `paint()` image is dropped; and `shape-image-threshold` read as the number its percentage means. `attribute-tables` and `minimize-values` are filed by two engines for different causes now, so a reason may name more than one.
1 parent 0488fc9 commit 8b57509

3 files changed

Lines changed: 114 additions & 11 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,9 @@ jobs:
323323
coverage: true
324324
- browser: firefox
325325
script: test:syntax-equivalence
326-
# WebKit reports rather than blocks until its filed set is written
327-
# from what its first runs actually see — the other two engines each
328-
# opened with hundreds of differences, nearly all of them the harness.
329326
- browser: webkit
330327
script: test:syntax-equivalence
331-
optional: true
332328
runs-on: ubuntu-latest
333-
continue-on-error: ${{ matrix.optional == true }}
334329
# Bounded: a hung browser would otherwise hold a runner for the 6h default.
335330
timeout-minutes: 60
336331
steps:

‎cspell.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"astring",
2222
"asyncloader",
2323
"atlaskit",
24+
"autocapitalize",
2425
"autocrlf",
2526
"autospace",
2627
"avivkeller",
@@ -126,6 +127,7 @@
126127
"embedurl",
127128
"Emscripten",
128129
"endregion",
130+
"enterkeyhint",
129131
"entrypoint",
130132
"entrypoints",
131133
"Eoksni",
@@ -194,6 +196,7 @@
194196
"importmap",
195197
"informations",
196198
"inlines",
199+
"inputmode",
197200
"installurl",
198201
"instanceof",
199202
"inversed",
@@ -281,6 +284,7 @@
281284
"mycompany",
282285
"mylibrary",
283286
"mynamespace",
287+
"mypaint",
284288
"Natsu",
285289
"navigations",
286290
"Neue",

‎test/specCases/syntaxEquivalence.spectest.js‎

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,27 @@ const ENGINE = ENGINES.has(String(process.env.EQUIVALENCE_BROWSER))
4545
// viewport varies as text.
4646
const EMULATES_MEDIA = ENGINE === "chrome";
4747

48-
// A filed reason opening `<engine> only:` names the engine that has it.
49-
const ENGINE_ONLY_REGEXP = /^([a-z]+) only:/;
48+
// WHY: The printer caps a number at six significant digits, so a computed value
49+
// that differs past the sixth is the engine's own serialization rather than
50+
// anything the printer wrote — WebKit reads 38.7953px where Blink reads
51+
// 38.795277px for the one declaration. Chromium, whose serialization the
52+
// fixtures were measured against, stays held to the byte.
53+
/**
54+
* A computed declaration with every number read at the precision the printer
55+
* writes, where the engine serializes to fewer digits than Chromium.
56+
* @param {string} line one `property:value` line
57+
* @returns {string} it, at the printed precision
58+
*/
59+
const atPrintedPrecision = (line) =>
60+
ENGINE === "chrome"
61+
? line
62+
: line.replace(/\d+\.\d+/g, (number) =>
63+
String(Number(Number(number).toPrecision(6)))
64+
);
65+
66+
// A filed reason opening `<engine> only:` names the engines that have it, comma
67+
// separated where a file is filed by more than one for different causes.
68+
const ENGINE_ONLY_REGEXP = /^([a-z]+(?:, [a-z]+)*) only:/;
5069

5170
/**
5271
* A tier's filed defects as they stand in this engine. A reason opening
@@ -60,7 +79,7 @@ const forEngine = (filed) =>
6079
new Map(
6180
[...filed].filter(([, why]) => {
6281
const named = ENGINE_ONLY_REGEXP.exec(why);
63-
return named === null || named[1] === ENGINE;
82+
return named === null || named[1].split(", ").includes(ENGINE);
6483
})
6584
);
6685

@@ -134,7 +153,7 @@ const CUSTOM_PROPERTY = "--webpack-probe";
134153
const FILED_CONFIG_CSS_DEFECTS = new Map([
135154
[
136155
"test/configCases/css/minimize-values/style.css",
137-
"firefox only: not a printer defect — Blink folds a `calc()` inside a `var()` fallback as it parses, so both spellings read alike there; Gecko echoes the fallback as written. Measured in Firefox 156: `width:var(--foo,calc(10px + 10px))` reads back whole, while both engines compute `20px`"
156+
"firefox, webkit only: not a printer defect — Gecko echoes a `calc()` inside a `var()` fallback as written where Blink folds it as it parses, so both spellings read alike there. Measured in Firefox 156: `width:var(--foo,calc(10px + 10px))` reads back whole, while both engines compute `20px`. WebKit drops a `shape-image-threshold` the others keep, which shifts every rule index after it"
138157
],
139158
[
140159
"test/configCases/css/minimize-cssnano-custom-properties/style.css",
@@ -149,7 +168,55 @@ const FILED_CONFIG_CSS_DEFECTS = new Map([
149168
const FILED_CONFIG_HTML_DEFECTS = new Map([
150169
[
151170
"test/configCases/html/attribute-tables/page.html",
152-
"firefox only: not a printer defect — Gecko implements neither `writingSuggestions` nor `blocking` as an IDL attribute, so the comparison falls back to the attribute as written and reads a normalization as a difference. Measured in Firefox 156: both read `undefined`, where Chrome 147 reflects `false` and `render`"
171+
"firefox, webkit only: not a printer defect — an IDL attribute the engine does not implement falls back to the attribute as written, so a normalization reads as a difference. Measured in Firefox 156: `writingSuggestions` and `blocking` both read `undefined` where Chrome 147 reflects `false` and `render`; WebKit reads `autofocus`, `enterkeyhint` and `inputmode` apart from Blink the same way"
172+
],
173+
[
174+
"test/configCases/html/parser-as-fragment/div.html",
175+
"webkit only: not a printer defect, not yet diagnosed — WebKit reads a different `document.compatMode` for the source and the printed form where Blink and Gecko read one. Measured in the first WebKit run: eleven files report `BackCompat vs CSS1Compat` and two the reverse, and a direction that flips per file points at how the harness builds the document rather than at what the printer wrote"
176+
],
177+
[
178+
"test/configCases/asset-modules/minimize-embedded-asset-source/text.html",
179+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
180+
],
181+
[
182+
"test/configCases/embedded/everything/inline.html",
183+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
184+
],
185+
[
186+
"test/configCases/embedded/everything/source.html",
187+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
188+
],
189+
[
190+
"test/configCases/html/fragment-context-select/page.html",
191+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
192+
],
193+
[
194+
"test/configCases/html/minify-embedded-html-in-js/page.html",
195+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
196+
],
197+
[
198+
"test/configCases/html/minimize-embedded-in-js/page.html",
199+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
200+
],
201+
[
202+
"test/configCases/html/minimize-round-trip/cases/adoption.html",
203+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
204+
],
205+
[
206+
"test/configCases/html/minimize-round-trip/cases/attributes.html",
207+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
208+
],
209+
[
210+
"test/configCases/html/parser-as-fragment/document.html",
211+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
212+
],
213+
[
214+
"test/configCases/html/parser-as-fragment/tbody.html",
215+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
216+
],
217+
[
218+
"test/configCases/html/parser-as-fragment/template.html",
219+
"webkit only: the `compatMode` the harness reads again — see `parser-as-fragment/div.html`"
153220
],
154221
[
155222
"test/configCases/html/minimize-round-trip/cases/reflected.html",
@@ -161,7 +228,13 @@ const FILED_CONFIG_HTML_DEFECTS = new Map([
161228
]
162229
]);
163230

164-
const FILED_BENCHMARK_CSS_DEFECTS = new Map();
231+
const FILED_BENCHMARK_CSS_DEFECTS = new Map([
232+
["Fomantic-UI 2", "webkit only: not a printer defect — WebKit lays out in units of a sixty-fourth of a pixel, so a width the others compute whole lands one step below it. Measured in the first WebKit run: `112px` against `111.984375px`, which is `112 - 1/64`"],
233+
["Foundation 6", "webkit only: the sixty-fourth of a pixel again — see `Fomantic-UI 2`"],
234+
["Radix Themes 3 (components)", "webkit only: the sixty-fourth of a pixel again — see `Fomantic-UI 2`"],
235+
["Semantic UI 2", "webkit only: the sixty-fourth of a pixel again — see `Fomantic-UI 2`"],
236+
["Tailwind 4 + daisyUI 5", "webkit only: the sixty-fourth of a pixel again — see `Fomantic-UI 2`"]
237+
]);
165238

166239
const FILED_BENCHMARK_HTML_DEFECTS = new Map();
167240

@@ -190,6 +263,12 @@ const FILED_COLOR_REWRITES = new Map([
190263
// Enumerated values the printer lower-cases that one engine does not read
191264
// case-insensitively, keyed as the check reports them.
192265
const FILED_ENUMERATED_FOLDS = new Map([
266+
['img fetchpriority=high: "auto" vs "high"', "webkit only: WebKit reflects no `fetchpriority`, so `high` and `low` both read `auto` and lower-casing one cannot be told from folding it away"],
267+
['img fetchpriority=low: "auto" vs "low"', "webkit only: the unreflected `fetchpriority` again — see `img fetchpriority=high`"],
268+
['link fetchpriority=high: "auto" vs "high"', "webkit only: the unreflected `fetchpriority` again — see `img fetchpriority=high`"],
269+
['link fetchpriority=low: "auto" vs "low"', "webkit only: the unreflected `fetchpriority` again — see `img fetchpriority=high`"],
270+
['script fetchpriority=high: "auto" vs "high"', "webkit only: the unreflected `fetchpriority` again — see `img fetchpriority=high`"],
271+
['script fetchpriority=low: "auto" vs "low"', "webkit only: the unreflected `fetchpriority` again — see `img fetchpriority=high`"],
193272
[
194273
'* spellcheck=true: "false" vs "true"',
195274
"firefox only: a printer defect, not yet decided — HTML makes an enumerated attribute ASCII case-insensitive and Gecko does not read `spellcheck` that way, so lower-casing it turns spellchecking on where the page had it off. Measured in Firefox 156: `spellcheck=\"TRUE\"` reflects `false` and `spellcheck=\"true\"` reflects `true`; Chrome 147 reflects `true` for both"
@@ -208,6 +287,30 @@ const FILED_WPT_VALUE_DEFECTS = new Map([
208287
"-webkit-perspective:calc(25)",
209288
"firefox only: the unitless `calc()` again — see `calc(1000)`"
210289
],
290+
[
291+
"shape-image-threshold:50%",
292+
"webkit only: WebKit reads a `shape-image-threshold` percentage as the number it means and the others keep the percentage, so a spelling neither reads differently still reads as a difference"
293+
],
294+
[
295+
"shape-image-threshold:300%",
296+
"webkit only: the `shape-image-threshold` percentage again \u2014 see `50%`"
297+
],
298+
[
299+
"shape-image-threshold:-100%",
300+
"webkit only: the `shape-image-threshold` percentage again \u2014 see `50%`"
301+
],
302+
[
303+
"background-image:paint( mypaint",
304+
"webkit only: WebKit implements no CSS Painting API, so a `paint()` image is dropped rather than echoed and the two spellings both read as absent"
305+
],
306+
[
307+
"background-image:paint(mypaint ",
308+
"webkit only: the unimplemented `paint()` again \u2014 see `paint( mypaint`"
309+
],
310+
[
311+
"animation-timing-function:steps(calc(1), jump-none)",
312+
"webkit only: a printer defect, not yet decided \u2014 WebKit reads the step count through a `calc()` where the printed form drops it. Measured in the first WebKit run"
313+
],
211314
[
212315
"font-family:\"New Century Schoolbook\", serif",
213316
"firefox only: not a printer defect — Gecko carries the source's quoting into the computed family where Blink drops it, so unquoting a name neither engine reads differently still reads as a difference there"
@@ -1990,6 +2093,7 @@ describe("a lowering computes as the spelling it replaces", () => {
19902093
text
19912094
.split("\n")
19922095
.filter((line) => !loose.has(line.slice(0, line.indexOf(":"))))
2096+
.map(atPrintedPrecision)
19932097
.join("\n");
19942098
expect(wholeAfter.map(kept)).toEqual(wholeBefore.map(kept));
19952099
}

0 commit comments

Comments
 (0)