&& window.CustomElements.takeRecords) {
        window.CustomElements.takeRecords();
      }
      // 2. ShadyDOM polyfill.
      if (window.ShadyDOM && window.ShadyDOM.flush) {
        window.ShadyDOM.flush();
      }
    },

    collectElementChildren: function (parent) {
      // Note: Safari 7.1 does not support `firstElementChild` or
      // `nextElementSibling`, so we do things the old-fashioned way:
      var elements = [];
      var child = parent.firstChild;

      while (child) {
        if (chil