forked from alpinejs/alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolyfills.js
More file actions
29 lines (27 loc) · 1.06 KB
/
Copy pathpolyfills.js
File metadata and controls
29 lines (27 loc) · 1.06 KB
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
// For the IE11 build.
import "shim-selected-options"
import "proxy-polyfill/proxy.min.js"
import "element-closest/browser.js"
import "element-remove"
import "classlist-polyfill"
import "@webcomponents/template"
import "events-polyfill/src/constructors/CustomEvent"
import "events-polyfill/src/ListenerOptions"
SVGElement.prototype.contains = SVGElement.prototype.contains || HTMLElement.prototype.contains
// .childElementCount polyfill
// from https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/childElementCount#Polyfill_for_IE8_IE9_Safari
;(function(constructor) {
if (constructor &&
constructor.prototype &&
constructor.prototype.childElementCount == null) {
Object.defineProperty(constructor.prototype, 'childElementCount', {
get: function() {
var i = 0, count = 0, node, nodes = this.childNodes;
while (node = nodes[i++]) {
if (node.nodeType === 1) count++;
}
return count;
}
});
}
})(window.Node || window.Element);