2019-04-04 17:40:33 +02:00
|
|
|
import './polyfills/dataset';
|
2022-04-29 18:13:59 +02:00
|
|
|
|
2022-04-30 11:48:51 +02:00
|
|
|
// IE 11 has no baseURI (required by turbo)
|
2022-04-29 18:13:59 +02:00
|
|
|
if (document.baseURI == undefined) {
|
|
|
|
document.baseURI = document.URL;
|
|
|
|
}
|
2022-04-30 11:48:51 +02:00
|
|
|
|
|
|
|
// IE 11 has no children on DocumentFragment (required by turbo)
|
|
|
|
function polyfillChildren(proto) {
|
|
|
|
Object.defineProperty(proto, 'children', {
|
|
|
|
get: function () {
|
|
|
|
const children = [];
|
|
|
|
for (const node of this.childNodes) {
|
|
|
|
if (node.nodeType == 1) {
|
|
|
|
children.push(node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return children;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const fragment = document.createDocumentFragment();
|
|
|
|
if (fragment.children == undefined) {
|
|
|
|
polyfillChildren(DocumentFragment.prototype);
|
|
|
|
}
|
2022-05-11 11:46:06 +02:00
|
|
|
|
|
|
|
// IE 11 has no isConnected on Node
|
|
|
|
function polyfillIsConnected(proto) {
|
|
|
|
Object.defineProperty(proto, 'isConnected', {
|
|
|
|
get: function () {
|
|
|
|
return document.documentElement.contains(this);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!('isConnected' in Node.prototype)) {
|
|
|
|
polyfillIsConnected(Node.prototype);
|
|
|
|
}
|