-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep-undef-no-quirk-iframe-old-doctype.html
152 lines (131 loc) · 3.02 KB
/
step-undef-no-quirk-iframe-old-doctype.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!--
Chrome 69.0.3475.0 (Official Build) canary (64-bit)
Expected: BackCompat
Actual: BackCompat
Expected: true
Actual: true
Expected: true
Actual: true
Expected: null
Actual: null
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: BackCompat
Actual: BackCompat
Expected: BackCompat
Actual: BackCompat
----
Safari Tech Preview Release 59 (Safari 12.0, WebKit 13606.1.21)
Expected: BackCompat
Actual: BackCompat
Expected: true
Actual: true
Expected: true
Actual: true
Expected: null
Actual: null
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: BackCompat
Actual: BackCompat
Expected: BackCompat
Actual: BackCompat
----
Firefox Nightly 63.0a1 (2018-06-27) (64-bit)
Expected: BackCompat
Actual: BackCompat
Expected: true
Actual: true
Expected: true
Actual: true
Expected: null
Actual: null
Expected: CSS1Compat
Actual: BackCompat
Expected: CSS1Compat
Actual: BackCompat
Expected: CSS1Compat
Actual: BackCompat
Expected: BackCompat
Actual: BackCompat
Expected: BackCompat
Actual: BackCompat
----
Microsoft Edge 42.17134.1.0
Microsoft EdgeHTML 17.17134
Expected: BackCompat
Actual: BackCompat
Expected: true
Actual: true
Expected: true
Actual: true
Expected: null
Actual: null
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: CSS1Compat
Actual: CSS1Compat
Expected: BackCompat
Actual: BackCompat
Expected: BackCompat
Actual: BackCompa
-->
<!doctype html>
<meta charset="utf-8">
<pre id=output></pre>
<script>
const buf = [];
function log(thing) {
buf.push(`${thing}\n`);
}
function flush() {
let output = document.getElementById("output");
if (!output) {
document.write('<meta charset="utf-8"><pre id=output></pre>');
flush();
return;
}
for (const message of buf)
output.appendChild(document.createTextNode(message));
}
function compare(expected, fn) {
const sentinel = {};
let ret = sentinel;
try {
ret = fn();
} catch (err) {
log(`Expected: ${expected}`);
log(`Thrown: ${err}`);
}
if (ret !== sentinel) {
log(`Expected: ${expected}`);
log(`Actual: ${ret}`);
}
}
const frame = document.body.appendChild(document.createElement("iframe"));
compare("BackCompat", () => frame.contentDocument.compatMode);
const doc = frame.contentDocument;
compare(true, () => frame.contentDocument.open() === doc);
compare(true, () => frame.contentDocument === doc);
compare(null, () => frame.contentDocument.body);
compare("CSS1Compat", () => frame.contentDocument.compatMode);
frame.contentDocument.write("<!doctype html public");
compare("CSS1Compat", () => frame.contentDocument.compatMode);
frame.contentDocument.write(" \"-//IETF//DTD HTML 3//\"");
compare("CSS1Compat", () => frame.contentDocument.compatMode);
frame.contentDocument.write(">");
compare("BackCompat", () => frame.contentDocument.compatMode);
frame.contentDocument.close();
compare("BackCompat", () => frame.contentDocument.compatMode);
flush();
</script>