lib/wed/polyfills/firstElementChild_etc.js
function addParentNodeInterfaceToPrototype(p) {
    Object.defineProperty(p, "firstElementChild", {
      get: function firstElementChild() {
        var el = this.firstChild;
        while (el && el.nodeType !== 1) {
          el = el.nextSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "lastElementChild", {
      get: function lastElementChild() {
        var el = this.lastChild;
        while (el && el.nodeType !== 1) {
          el = el.previousSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "childElementCount", {
      get: function childElementCount() {
        var el = this.firstElementChild;
        var count = 0;
        while (el) {
          count++;
          el = el.nextElementSibling;
        }
        return count;
      },
    });
  }
function addParentNodeInterfaceToPrototype(p) {
    Object.defineProperty(p, "firstElementChild", {
      get: function firstElementChild() {
        var el = this.firstChild;
        while (el && el.nodeType !== 1) {
          el = el.nextSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "lastElementChild", {
      get: function lastElementChild() {
        var el = this.lastChild;
        while (el && el.nodeType !== 1) {
          el = el.previousSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "childElementCount", {
      get: function childElementCount() {
        var el = this.firstElementChild;
        var count = 0;
        while (el) {
          count++;
          el = el.nextElementSibling;
        }
        return count;
      },
    });
  }
function addParentNodeInterfaceToPrototype ( p ) { Object . defineProperty ( p , "firstElementChild" , { get : function firstElementChild ( ) { var el = this . firstChild ; while ( el && el . nodeType !== 1 ) { el = el . nextSibling ; } return el ; } , } ) ; Object . defineProperty ( p , "lastElementChild" , { get : function lastElementChild ( ) { var el = this . lastChild ; while ( el && el . nodeType !== 1 ) { el = el . previousSibling ; } return el ; } , } ) ; Object . defineProperty ( p , "childElementCount" , { get : function childElementCount ( ) { var el = this . firstElementChild ; var count = 0 ; while ( el ) { count ++ ; el = el . nextElementSibling ; } return count ; } , } ) ; }
This polyfill has been tested with IE 11 and 10. It has not been tested with older versions of IE because we do not support them.
This polyfill has been tested with IE 11 and 10 . It has not been tested with older versions of IE because we do not support them .