|
@@ -149,6 +149,38 @@ function _visitNode(node, callback) {
|
149
|
149
|
document.cookie = '';
|
150
|
150
|
}
|
151
|
151
|
|
|
152
|
+ // document.implementation
|
|
153
|
+ //
|
|
154
|
+ // Required by:
|
|
155
|
+ // - jQuery
|
|
156
|
+ if (typeof document.implementation === 'undefined') {
|
|
157
|
+ document.implementation = {};
|
|
158
|
+ }
|
|
159
|
+
|
|
160
|
+ // document.implementation.createHTMLDocument
|
|
161
|
+ //
|
|
162
|
+ // Required by:
|
|
163
|
+ // - jQuery
|
|
164
|
+ if (typeof document.implementation.createHTMLDocument === 'undefined') {
|
|
165
|
+ document.implementation.createHTMLDocument = function(title = '') {
|
|
166
|
+ const htmlDocument
|
|
167
|
+ = new DOMParser().parseFromString(
|
|
168
|
+ `<html>
|
|
169
|
+ <head><title>${title}</title></head>
|
|
170
|
+ <body></body>
|
|
171
|
+ </html>`,
|
|
172
|
+ 'text/xml');
|
|
173
|
+
|
|
174
|
+ Object.defineProperty(htmlDocument, 'body', {
|
|
175
|
+ get() {
|
|
176
|
+ return htmlDocument.getElementsByTagName('body')[0];
|
|
177
|
+ }
|
|
178
|
+ });
|
|
179
|
+
|
|
180
|
+ return htmlDocument;
|
|
181
|
+ };
|
|
182
|
+ }
|
|
183
|
+
|
152
|
184
|
// Element.querySelector
|
153
|
185
|
//
|
154
|
186
|
// Required by:
|