UNPKG

polyfill-service

Version:
12 lines (10 loc) 434 B
Document.prototype.before = Element.prototype.before = function before() { if (this.parentNode) { this.parentNode.insertBefore(_mutation(arguments), this); } }; // Not all UAs support the Text constructor. Polyfill on the Text constructor only where it exists // TODO: Add a polyfill for the Text constructor, and make it a dependency of this polyfill. if ("Text" in this) { Text.prototype.before = Element.prototype.before; }