You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 381e7ff
Browse filesBrowse the repository at this point in the historyBrowse files
test: read quirks mode off the doctype rather than off the parse (#22164)
The twelve WebKit differences filed as `compatMode` are one cause, and it is
not a printer defect: every one of those files is a fragment carrying no
doctype, and with none `document.compatMode` reports what the engine defaults
a parsed document to rather than anything webpack printed.
Measured in Chrome 147: the mode is a function of the doctype alone, so where
a doctype exists the facet already carried it and the mode was a second
reading of the same line — which is why it masked the cause, reporting
`CSS1Compat vs BackCompat` for a dropped doctype and for a shortened one
alike. The doctype now comes first and the mode is compared only beside it.
A page that loses its doctype or has it rewritten still fails, in every
engine, and the new case pins both directions.
"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"
"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"
"firefox only: the unimplemented `blocking` IDL again — see `attribute-tables`"
@@ -801,6 +753,45 @@ describe(`printer output in real ${ENGINE}`, () => {
801
753
);
802
754
}
803
755
756
+
// WHY: `compatMode` is a function of the doctype alone — measured in
757
+
// Chrome 147, any two that read back as the same doctype compute the same
758
+
// mode — so with none it reports what the engine defaults a parsed document
759
+
// to, which WebKit and Blink answer differently. Only the doctype is the
760
+
// printer's to keep, so a page carrying one is still held to its effect.
761
+
it(
762
+
"reads quirks mode off the doctype rather than off the parse",
763
+
async()=>{
764
+
constdifferences=awaitcomparePages(
765
+
[
766
+
{
767
+
name: "doctype-absent",
768
+
raw: '<p class="a">a<b>b<i>c</p>d</i>e</b>f',
769
+
min: "<p class=a>a<b>b<i>c</p>d</i>e</b>f"
770
+
},
771
+
{
772
+
name: "doctype-dropped",
773
+
raw: "<!DOCTYPE html><p>x</p>",
774
+
min: "<p>x</p>"
775
+
},
776
+
{
777
+
name: "doctype-shortened",
778
+
raw: '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><p>x</p>',
779
+
min: '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><p>x</p>'
780
+
}
781
+
],
782
+
false
783
+
);
784
+
expect(differences).toEqual([
785
+
{name: "doctype-dropped",why: "document: 2 vs 1"},
786
+
{
787
+
name: "doctype-shortened",
788
+
why: "document 0: html|-//W3C//DTD HTML 4.01 Transitional//EN|http://www.w3.org/TR/html4/loose.dtd vs html|-//W3C//DTD HTML 4.01 Transitional//EN|"
789
+
}
790
+
]);
791
+
},
792
+
FILE_TIMEOUT
793
+
);
794
+
804
795
// A `)` inside a quoted `url()` belongs to the address; one met after an
805
796
// illegal quote ends the bad url, and the rest is a color again.
0 commit comments