Spaces:
Running
Running
tmp
Browse files- dist/index.html +8 -5
dist/index.html
CHANGED
@@ -2,11 +2,14 @@
|
|
2 |
// Block rendering until we ensure DOCTYPE is present
|
3 |
if (document.doctype === null) {
|
4 |
const doctypeNode = document.implementation.createDocumentType('html', '', '');
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
}
|
11 |
else {
|
12 |
console.log('DOCTYPE is present');
|
|
|
2 |
// Block rendering until we ensure DOCTYPE is present
|
3 |
if (document.doctype === null) {
|
4 |
const doctypeNode = document.implementation.createDocumentType('html', '', '');
|
5 |
+
document.insertBefore(doctypeNode, document.documentElement || document.firstChild);
|
6 |
+
// Force browser to reparse in standards mode
|
7 |
+
const htmlElement = document.documentElement;
|
8 |
+
const newHtmlElement = htmlElement.cloneNode(true);
|
9 |
+
htmlElement.parentNode.replaceChild(newHtmlElement, htmlElement);
|
10 |
+
// Force a reflow
|
11 |
+
void document.body.offsetWidth;
|
12 |
+
console.log('DOCTYPE is present');
|
13 |
}
|
14 |
else {
|
15 |
console.log('DOCTYPE is present');
|