diff --git a/shadydom.min.js b/shadydom.min.js index db271ab..04fab7f 100644 --- a/shadydom.min.js +++ b/shadydom.min.js @@ -1606,7 +1606,7 @@ var mixinImpl = { var ownerRoot = this.ownerShadyRootForNode(container); if (ownerRoot) { // optimization: special insertion point tracking - if (node.__noInsertionPoint) { + if (node.__noInsertionPoint && ownerRoot._clean) { ownerRoot._skipUpdateInsertionPoints = true; } // note: we always need to see if an insertion point is added @@ -1617,7 +1617,6 @@ var mixinImpl = { if (ipAdded) { ownerRoot._skipUpdateInsertionPoints = false; } - this._addedNode(node, ownerRoot); } if (tree.Logical.hasChildNodes(container)) { tree.Logical.recordInsertBefore(node, container, ref_node); @@ -1650,9 +1649,6 @@ var mixinImpl = { } } this._removeOwnerShadyRoot(node); - if (ownerRoot) { - this._removedNode(node, ownerRoot); - } return distributed; }, @@ -1786,23 +1782,6 @@ var mixinImpl = { node.shadyRoot.hasInsertionPoint(); }, - // TODO(sorvell): needed for style scoping, use MO? - _addedNode: function _addedNode() {}, - _removedNode: function _removedNode() {}, - /* - _addedNode(node, root) { - // if (ShadyDOM.addedNode) { - // ShadyDOM.addedNode(node, root); - // } - }, - - _removedNode(node, root) { - if (ShadyDOM.removedNode) { - ShadyDOM.removedNode(node, root); - } - }, - */ - _removeDistributedChildren: function _removeDistributedChildren(root, container) { var this$1 = this; @@ -1876,10 +1855,11 @@ var mixinImpl = { }, maybeDistributeAttributeChange: function maybeDistributeAttributeChange(node, name) { - var distribute = (node.localName === 'slot' && name === 'name'); - if (distribute) { - var root = this.getRootNode(node); - if (root.update) { + if (name === 'slot') { + this.maybeDistributeParent(node); + } else if (node.localName === 'slot' && name === 'name') { + var root = this.ownerShadyRootForNode(node); + if (root) { root.update(); } } @@ -1965,6 +1945,14 @@ var nativeImportNode = Document.prototype.importNode; var nativeSetAttribute = Element.prototype.setAttribute; var nativeRemoveAttribute = Element.prototype.removeAttribute; +var setAttribute = function(attr, value) { + if (window.ShadyCSS && attr === 'class') { + window.ShadyCSS.setElementClass(this, value); + } else { + nativeSetAttribute.call(this, attr, value); + } +} + var NodeMixin = {}; Object.defineProperties(NodeMixin, { @@ -2251,18 +2239,14 @@ var ElementMixin = { }, - setAttribute: function setAttribute(name, value) { - nativeSetAttribute.call(this, name, value); - if (!mixinImpl.maybeDistributeParent(this)) { - mixinImpl.maybeDistributeAttributeChange(this, name); - } + setAttribute: function setAttribute$1(name, value) { + setAttribute.call(this, name, value); + mixinImpl.maybeDistributeAttributeChange(this, name); }, removeAttribute: function removeAttribute(name) { nativeRemoveAttribute.call(this, name); - if (!mixinImpl.maybeDistributeParent(this)) { - mixinImpl.maybeDistributeAttributeChange(this, name); - } + mixinImpl.maybeDistributeAttributeChange(this, name); } }; @@ -2976,6 +2960,18 @@ if (settings.inUse) { configurable: true }); + Element.prototype.setAttribute = setAttribute; + + Object.defineProperty(Element.prototype, 'className', { + get: function get$3() { + return this.getAttribute('class'); + }, + set: function set$1(value) { + this.setAttribute('class', value); + }, + configurable: true + }); + // TODO(sorvell): super experimental auto patching of document fragment // via appendChild. This either needs to be expanded or contracted. // DocumentFragment.prototype.appendChild = function(node) { diff --git a/shadydom.min.js.map b/shadydom.min.js.map index 650acac..a7ac2d1 100644 --- a/shadydom.min.js.map +++ b/shadydom.min.js.map @@ -1 +1 @@ -{"version":3,"file":"shadydom.min.js","sources":["utils.js","array-splice.js","tree.js","distributor.js","shady.js","innerHTML.js","element-mixin.js","patch.js","event-mixin.js","env.js"],"sourcesContent":["/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let settings = window.ShadyDOM || {};\n\nsettings.hasNativeShadowDOM = Boolean(Element.prototype.attachShadow && Node.prototype.getRootNode);\n\nsettings.inUse = settings.force || !settings.hasNativeShadowDOM;\n\nexport function isShadyRoot(obj) {\n return Boolean(obj.__localName === 'ShadyRoot');\n}\n\nlet p = Element.prototype;\nlet matches = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nexport function matchesSelector(element, selector) {\n return matches.call(element, selector);\n}\n\nfunction copyOwnProperty(name, source, target) {\n let pd = Object.getOwnPropertyDescriptor(source, name);\n if (pd) {\n Object.defineProperty(target, name, pd);\n }\n}\n\nexport function extend(target, source) {\n if (target && source) {\n let n$ = Object.getOwnPropertyNames(source);\n for (let i=0, n; (i '123yyyy'\n //\n // With 1-edit updates, the shortest path would be just to update all seven\n // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n // leaves the substring '123' intact.\n calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n },\n\n // This starts at the final weight, and walks \"backward\" by finding\n // the minimum previous weight recursively until the origin of the weight\n // matrix.\n spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n },\n\n /**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * \n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n /**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\n calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = this.sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n let ops = this.spliceOperationsFromEditDistances(\n this.calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n },\n\n sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++)\n if (!this.equals(current[i], old[i]))\n return i;\n return searchLength;\n },\n\n sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && this.equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n },\n\n calculateSplices(current, previous) {\n return this.calcSplices(current, 0, current.length, previous, 0,\n previous.length);\n },\n\n equals(currentValue, previousValue) {\n return currentValue === previousValue;\n }\n\n};\n\nexport let calculateSplices = (current, previous) =>\n ArraySplice.calculateSplices(current, previous);\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n// TODO(sorvell): circular (patch loads tree and tree loads patch)\n// for now this is stuck on `utils`\n//import {patchNode} from './patch'\nimport * as utils from './utils'\n\n// native add/remove\nlet nativeInsertBefore = Element.prototype.insertBefore;\nlet nativeAppendChild = Element.prototype.appendChild;\nlet nativeRemoveChild = Element.prototype.removeChild;\n\n/**\n * `tree` is a dom manipulation library used by ShadyDom to\n * manipulate composed and logical trees.\n */\nexport let tree = {\n\n // sad but faster than slice...\n arrayCopyChildNodes(parent) {\n let copy=[], i=0;\n for (let n=parent.firstChild; n; n=n.nextSibling) {\n copy[i++] = n;\n }\n return copy;\n },\n\n arrayCopyChildren(parent) {\n let copy=[], i=0;\n for (let n=parent.firstElementChild; n; n=n.nextElementSibling) {\n copy[i++] = n;\n }\n return copy;\n },\n\n arrayCopy(a$) {\n let l = a$.length;\n let copy = new Array(l);\n for (let i=0; i < l; i++) {\n copy[i] = a$[i];\n }\n return copy;\n },\n\n saveChildNodes(node) {\n tree.Logical.saveChildNodes(node);\n if (!tree.Composed.hasParentNode(node)) {\n tree.Composed.saveComposedData(node);\n //tree.Composed.saveParentNode(node);\n }\n tree.Composed.saveChildNodes(node);\n }\n\n};\n\ntree.Logical = {\n\n hasParentNode(node) {\n return Boolean(node.__dom && node.__dom.parentNode);\n },\n\n hasChildNodes(node) {\n return Boolean(node.__dom && node.__dom.childNodes !== undefined);\n },\n\n getChildNodes(node) {\n // note: we're distinguishing here between undefined and false-y:\n // hasChildNodes uses undefined check to see if this element has logical\n // children; the false-y check indicates whether or not we should rebuild\n // the cached childNodes array.\n return this.hasChildNodes(node) ? this._getChildNodes(node) :\n tree.Composed.getChildNodes(node);\n },\n\n _getChildNodes(node) {\n if (!node.__dom.childNodes) {\n node.__dom.childNodes = [];\n for (let n=this.getFirstChild(node); n; n=this.getNextSibling(n)) {\n node.__dom.childNodes.push(n);\n }\n }\n return node.__dom.childNodes;\n },\n\n // NOTE: __dom can be created under 2 conditions: (1) an element has a\n // logical tree, or (2) an element is in a logical tree. In case (1), the\n // element will store firstChild/lastChild, and in case (2), the element\n // will store parentNode, nextSibling, previousSibling. This means that\n // the mere existence of __dom is not enough to know if the requested\n // logical data is available and instead we do an explicit undefined check.\n getParentNode(node) {\n return node.__dom && node.__dom.parentNode !== undefined ?\n node.__dom.parentNode : tree.Composed.getParentNode(node);\n },\n\n getFirstChild(node) {\n return node.__dom && node.__dom.firstChild !== undefined ?\n node.__dom.firstChild : tree.Composed.getFirstChild(node);\n },\n\n getLastChild(node) {\n return node.__dom && node.__dom.lastChild !== undefined ?\n node.__dom.lastChild : tree.Composed.getLastChild(node);\n },\n\n getNextSibling(node) {\n return node.__dom && node.__dom.nextSibling !== undefined ?\n node.__dom.nextSibling : tree.Composed.getNextSibling(node);\n },\n\n getPreviousSibling(node) {\n return node.__dom && node.__dom.previousSibling !== undefined ?\n node.__dom.previousSibling : tree.Composed.getPreviousSibling(node);\n },\n\n getFirstElementChild(node) {\n return node.__dom && node.__dom.firstChild !== undefined ?\n this._getFirstElementChild(node) :\n tree.Composed.getFirstElementChild(node);\n },\n\n _getFirstElementChild(node) {\n let n = node.__dom.firstChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.nextSibling;\n }\n return n;\n },\n\n getLastElementChild(node) {\n return node.__dom && node.__dom.lastChild !== undefined ?\n this._getLastElementChild(node) :\n tree.Composed.getLastElementChild(node);\n },\n\n _getLastElementChild(node) {\n let n = node.__dom.lastChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.previousSibling;\n }\n return n;\n },\n\n getNextElementSibling(node) {\n return node.__dom && node.__dom.nextSibling !== undefined ?\n this._getNextElementSibling(node) :\n tree.Composed.getNextElementSibling(node);\n },\n\n _getNextElementSibling(node) {\n let n = node.__dom.nextSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getNextSibling(n);\n }\n return n;\n },\n\n getPreviousElementSibling(node) {\n return node.__dom && node.__dom.previousSibling !== undefined ?\n this._getPreviousElementSibling(node) :\n tree.Composed.getPreviousElementSibling(node);\n },\n\n _getPreviousElementSibling(node) {\n let n = node.__dom.previousSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getPreviousSibling(n);\n }\n return n;\n },\n\n // Capture the list of light children. It's important to do this before we\n // start transforming the DOM into \"rendered\" state.\n // Children may be added to this list dynamically. It will be treated as the\n // source of truth for the light children of the element. This element's\n // actual children will be treated as the rendered state once this function\n // has been called.\n saveChildNodes(node) {\n if (!this.hasChildNodes(node)) {\n node.__dom = node.__dom || {};\n node.__dom.firstChild = node.firstChild;\n node.__dom.lastChild = node.lastChild;\n let c$ = node.__dom.childNodes = tree.arrayCopyChildNodes(node);\n for (let i=0, n; (i node\n node.__dom.previousSibling = ref_node ? ref_node.__dom.previousSibling :\n container.__dom.lastChild;\n if (node.__dom.previousSibling) {\n node.__dom.previousSibling.__dom.nextSibling = node;\n }\n // update node <-> ref_node\n node.__dom.nextSibling = ref_node;\n if (node.__dom.nextSibling) {\n node.__dom.nextSibling.__dom.previousSibling = node;\n }\n // update node <-> container\n node.__dom.parentNode = container;\n if (ref_node) {\n if (ref_node === container.__dom.firstChild) {\n container.__dom.firstChild = node;\n }\n } else {\n container.__dom.lastChild = node;\n if (!container.__dom.firstChild) {\n container.__dom.firstChild = node;\n }\n }\n // remove caching of childNodes\n container.__dom.childNodes = null;\n },\n\n recordRemoveChild(node, container) {\n node.__dom = node.__dom || {};\n container.__dom = container.__dom || {};\n if (node === container.__dom.firstChild) {\n container.__dom.firstChild = node.__dom.nextSibling;\n }\n if (node === container.__dom.lastChild) {\n container.__dom.lastChild = node.__dom.previousSibling;\n }\n let p = node.__dom.previousSibling;\n let n = node.__dom.nextSibling;\n if (p) {\n p.__dom = p.__dom || {};\n p.__dom.nextSibling = n;\n }\n if (n) {\n n.__dom = n.__dom || {};\n n.__dom.previousSibling = p;\n }\n // When an element is removed, logical data is no longer tracked.\n // Explicitly set `undefined` here to indicate this. This is disginguished\n // from `null` which is set if info is null.\n node.__dom.parentNode = node.__dom.previousSibling =\n node.__dom.nextSibling = null;\n // remove caching of childNodes\n container.__dom.childNodes = null;\n }\n\n}\n\n\n// TODO(sorvell): composed tree manipulation is made available\n// (1) to maninpulate the composed tree, and (2) to track changes\n// to the tree for optional patching pluggability.\ntree.Composed = {\n\n hasParentNode(node) {\n return Boolean(node.__dom && node.__dom.$parentNode !== undefined);\n },\n\n hasChildNodes(node) {\n return Boolean(node.__dom && node.__dom.$childNodes !== undefined);\n },\n\n getChildNodes(node) {\n return this.hasChildNodes(node) ? this._getChildNodes(node) :\n (!node.__patched && tree.arrayCopy(node.childNodes));\n },\n\n _getChildNodes(node) {\n if (!node.__dom.$childNodes) {\n node.__dom.$childNodes = [];\n for (let n=node.__dom.$firstChild; n; n=n.__dom.$nextSibling) {\n node.__dom.$childNodes.push(n);\n }\n }\n return node.__dom.$childNodes;\n },\n\n getComposedChildNodes(node) {\n return node.__dom.$childNodes;\n },\n\n getParentNode(node) {\n return this.hasParentNode(node) ? node.__dom.$parentNode :\n (!node.__patched && node.parentNode);\n },\n\n getFirstChild(node) {\n return node.__patched ? node.__dom.$firstChild : node.firstChild;\n },\n\n getLastChild(node) {\n return node.__patched ? node.__dom.$lastChild : node.lastChild;\n },\n\n getNextSibling(node) {\n return node.__patched ? node.__dom.$nextSibling : node.nextSibling;\n },\n\n getPreviousSibling(node) {\n return node.__patched ? node.__dom.$previousSibling : node.previousSibling;\n },\n\n getFirstElementChild(node) {\n return node.__patched ? this._getFirstElementChild(node) :\n node.firstElementChild;\n },\n\n _getFirstElementChild(node) {\n let n = node.__dom.$firstChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.$nextSibling;\n }\n return n;\n },\n\n getLastElementChild(node) {\n return node.__patched ? this._getLastElementChild(node) :\n node.lastElementChild;\n },\n\n _getLastElementChild(node) {\n let n = node.__dom.$lastChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.$previousSibling;\n }\n return n;\n },\n\n getNextElementSibling(node) {\n return node.__patched ? this._getNextElementSibling(node) :\n node.nextElementSibling;\n },\n\n _getNextElementSibling(node) {\n let n = node.__dom.$nextSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getNextSibling(n);\n }\n return n;\n },\n\n getPreviousElementSibling(node) {\n return node.__patched ? this._getPreviousElementSibling(node) :\n node.previousElementSibling;\n },\n\n _getPreviousElementSibling(node) {\n let n = node.__dom.$previousSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getPreviousSibling(n);\n }\n return n;\n },\n\n saveChildNodes(node) {\n if (!this.hasChildNodes(node)) {\n node.__dom = node.__dom || {};\n node.__dom.$firstChild = node.firstChild;\n node.__dom.$lastChild = node.lastChild;\n let c$ = node.__dom.$childNodes = tree.arrayCopyChildNodes(node);\n for (let i=0, n; (i node\n node.__dom.$previousSibling = ref_node ? ref_node.__dom.$previousSibling :\n container.__dom.$lastChild;\n if (node.__dom.$previousSibling) {\n node.__dom.$previousSibling.__dom.$nextSibling = node;\n }\n // update node <-> ref_node\n node.__dom.$nextSibling = ref_node;\n if (node.__dom.$nextSibling) {\n node.__dom.$nextSibling.__dom.$previousSibling = node;\n }\n // update node <-> container\n node.__dom.$parentNode = container;\n if (ref_node) {\n if (ref_node === container.__dom.$firstChild) {\n container.__dom.$firstChild = node;\n }\n } else {\n container.__dom.$lastChild = node;\n if (!container.__dom.$firstChild) {\n container.__dom.$firstChild = node;\n }\n }\n // remove caching of childNodes\n container.__dom.$childNodes = null;\n },\n\n recordRemoveChild(node, container) {\n node.__dom = node.__dom || {};\n container.__dom = container.__dom || {};\n if (node === container.__dom.$firstChild) {\n container.__dom.$firstChild = node.__dom.$nextSibling;\n }\n if (node === container.__dom.$lastChild) {\n container.__dom.$lastChild = node.__dom.$previousSibling;\n }\n let p = node.__dom.$previousSibling;\n let n = node.__dom.$nextSibling;\n if (p) {\n p.__dom = p.__dom || {};\n p.__dom.$nextSibling = n;\n }\n if (n) {\n n.__dom = n.__dom || {};\n n.__dom.$previousSibling = p;\n }\n node.__dom.$parentNode = node.__dom.$previousSibling =\n node.__dom.$nextSibling = null;\n // remove caching of childNodes\n container.__dom.$childNodes = null;\n },\n\n clearChildNodes(node) {\n let c$ = this.getChildNodes(node);\n for (let i=0, c; i < c$.length; i++) {\n c = c$[i];\n this.recordRemoveChild(c, node);\n nativeRemoveChild.call(node, c)\n }\n },\n\n saveParentNode(node) {\n node.__dom = node.__dom || {};\n node.__dom.$parentNode = node.parentNode;\n },\n\n insertBefore(parentNode, newChild, refChild) {\n this.saveChildNodes(parentNode);\n // remove from current location.\n this._addChild(parentNode, newChild, refChild);\n return nativeInsertBefore.call(parentNode, newChild, refChild || null);\n },\n\n appendChild(parentNode, newChild) {\n this.saveChildNodes(parentNode);\n this._addChild(parentNode, newChild);\n return nativeAppendChild.call(parentNode, newChild);\n },\n\n removeChild(parentNode, node) {\n let currentParent = this.getParentNode(node);\n this.saveChildNodes(parentNode);\n this._removeChild(parentNode, node);\n if (currentParent === parentNode) {\n return nativeRemoveChild.call(parentNode, node);\n }\n },\n\n _addChild(parentNode, newChild, refChild) {\n let isFrag = (newChild.nodeType === Node.DOCUMENT_FRAGMENT_NODE);\n let oldParent = this.getParentNode(newChild);\n if (oldParent) {\n this._removeChild(oldParent, newChild);\n }\n if (isFrag) {\n let c$ = this.getChildNodes(newChild);\n for (let i=0; i < c$.length; i++) {\n let c = c$[i];\n // unlink document fragment children\n this._removeChild(newChild, c);\n this.recordInsertBefore(c, parentNode, refChild);\n }\n } else {\n this.recordInsertBefore(newChild, parentNode, refChild);\n }\n },\n\n _removeChild(parentNode, node) {\n this.recordRemoveChild(node, parentNode);\n }\n\n};\n\n// for testing...\nlet descriptors = {};\nexport function getNativeProperty(element, property) {\n if (!descriptors[property]) {\n descriptors[property] = Object.getOwnPropertyDescriptor(\n HTMLElement.prototype, property) ||\n Object.getOwnPropertyDescriptor(\n Element.prototype, property) ||\n Object.getOwnPropertyDescriptor(\n Node.prototype, property);\n }\n return descriptors[property].get.call(element);\n}\n\n// for testing...\nfunction assertNative(element, property, tracked) {\n let native = getNativeProperty(element, property);\n if (native != tracked && element.__patched) {\n window.console.warn('tracked', tracked, 'native', native);\n }\n return tracked;\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {tree} from './tree'\n\n// NOTE: normalize event contruction where necessary (IE11)\nlet NormalizedEvent = typeof Event === 'function' ? Event :\n function(inType, params) {\n params = params || {};\n var e = document.createEvent('Event');\n e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n return e;\n };\n\nexport default class {\n\n constructor(root) {\n this.root = root;\n this.insertionPointTag = 'slot';\n }\n\n getInsertionPoints() {\n return this.root.querySelectorAll(this.insertionPointTag);\n }\n\n hasInsertionPoint() {\n return Boolean(this.root._insertionPoints &&\n this.root._insertionPoints.length);\n }\n\n isInsertionPoint(node) {\n return node.localName && node.localName == this.insertionPointTag;\n }\n\n distribute() {\n if (this.hasInsertionPoint()) {\n return this.distributePool(this.root, this.collectPool());\n }\n return [];\n }\n\n // Gather the pool of nodes that should be distributed. We will combine\n // these with the \"content root\" to arrive at the composed tree.\n collectPool() {\n return tree.arrayCopy(\n tree.Logical.getChildNodes(this.root.host));\n }\n\n // perform \"logical\" distribution; note, no actual dom is moved here,\n // instead elements are distributed into storage\n // array where applicable.\n distributePool(node, pool) {\n let dirtyRoots = [];\n let p$ = this.root._insertionPoints;\n for (let i=0, l=p$.length, p; (i host\n host.shadyRoot = this;\n this.host = host;\n // logical dom setup\n tree.Logical.saveChildNodes(host);\n tree.Logical.saveChildNodes(this);\n // state flags\n this._clean = true;\n this._hasRendered = false;\n this._distributor = new Distributor(this);\n this.update();\n },\n\n // async render the \"top\" distributor (this is all that is needed to\n // distribute this host).\n update() {\n // TODO(sorvell): instead the root should always be enqueued to helps record that it is dirty.\n // Then, in `render`, the top most (in the distribution tree) \"dirty\" root should be rendered.\n let distributionRoot = this._findDistributionRoot(this.host);\n //console.log('update from', this.host, 'root', distributionRoot.host, distributionRoot._clean);\n if (distributionRoot._clean) {\n distributionRoot._clean = false;\n enqueue(function() {\n distributionRoot.render();\n });\n }\n },\n\n // TODO(sorvell): this may not return a shadowRoot (for example if the element is in a docFragment)\n // this should only return a shadowRoot.\n // returns the host that's the top of this host's distribution tree\n _findDistributionRoot(element) {\n let root = element.shadyRoot;\n while (element && this._elementNeedsDistribution(element)) {\n root = element.getRootNode();\n element = root && root.host;\n }\n return root;\n },\n\n // Return true if a host's children includes\n // an insertion point that selects selectively\n _elementNeedsDistribution(element) {\n let c$ = tree.Logical.getChildNodes(element);\n for (let i=0, c; i < c$.length; i++) {\n c = c$[i];\n if (this._distributor.isInsertionPoint(c)) {\n return element.getRootNode();\n }\n }\n },\n\n render() {\n if (!this._clean) {\n this._clean = true;\n if (!this._skipUpdateInsertionPoints) {\n this.updateInsertionPoints();\n } else if (!this._hasRendered) {\n this._insertionPoints = [];\n }\n this._skipUpdateInsertionPoints = false;\n // TODO(sorvell): previous ShadyDom had a fast path here\n // that would avoid distribution for initial render if\n // no insertion points exist. We cannot currently do this because\n // it relies on elements being in the physical shadowRoot element\n // so that native methods will be used. The current append code\n // simply provokes distribution in this case and does not put the\n // nodes in the shadowRoot. This could be done but we'll need to\n // consider if the special processing is worth the perf gain.\n // if (!this._hasRendered && !this._insertionPoints.length) {\n // tree.Composed.clearChildNodes(this.host);\n // tree.Composed.appendChild(this.host, this);\n // } else {\n // logical\n this.distribute();\n // physical\n this.compose();\n this._hasRendered = true;\n }\n },\n\n forceRender() {\n this._clean = false;\n this.render();\n },\n\n distribute() {\n let dirtyRoots = this._distributor.distribute();\n for (let i=0; i flushMax);\n if (flushList.length && !isFlushedMaxed) {\n flush();\n }\n flushCount = 0;\n if (isFlushedMaxed) {\n throw new Error('Loop detected in ShadyDOM distribution, aborting.')\n }\n}\n\nflush.list = flushList;","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n// Cribbed from ShadowDOM polyfill\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/ShadowDOM/wrappers/HTMLElement.js#L28\n/////////////////////////////////////////////////////////////////////////////\n// innerHTML and outerHTML\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nlet escapeAttrRegExp = /[&\\u00A0\"]/g;\nlet escapeDataRegExp = /[&\\u00A0<>]/g;\n\nfunction escapeReplace(c) {\n switch (c) {\n case '&':\n return '&';\n case '<':\n return '<';\n case '>':\n return '>';\n case '\"':\n return '"';\n case '\\u00A0':\n return ' ';\n }\n}\n\nfunction escapeAttr(s) {\n return s.replace(escapeAttrRegExp, escapeReplace);\n}\n\nfunction escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n}\n\nfunction makeSet(arr) {\n let set = {};\n for (let i = 0; i < arr.length; i++) {\n set[arr[i]] = true;\n }\n return set;\n}\n\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nlet voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]);\n\nlet plaintextParents = makeSet([\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'noframes',\n 'plaintext',\n 'noscript'\n]);\n\nexport function getOuterHTML(node, parentNode, composed) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE: {\n let tagName = node.localName;\n let s = '<' + tagName;\n let attrs = node.attributes;\n for (let i = 0, attr; (attr = attrs[i]); i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName]) {\n return s;\n }\n return s + getInnerHTML(node, composed) + '';\n }\n case Node.TEXT_NODE: {\n let data = node.data;\n if (parentNode && plaintextParents[parentNode.localName]) {\n return data;\n }\n return escapeData(data);\n }\n case Node.COMMENT_NODE: {\n return '';\n }\n default: {\n window.console.error(node);\n throw new Error('not implemented');\n }\n }\n}\n\nexport function getInnerHTML(node, composed) {\n if (node.localName === 'template') {\n node = node.content;\n }\n let s = '';\n let c$ = composed ? composed(node) : node.childNodes;\n for (let i=0, l=c$.length, child; (i children but since this case is assumed to be exceedingly\n // rare, we avoid the cost and will address with some specific api\n // when the need arises. For now, the user must call\n // distributeContent(true), which updates insertion points manually\n // and forces distribution.\n let insertionPointTag = ownerRoot && ownerRoot.getInsertionPointTag() || '';\n let fragContent = (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) &&\n !node.__noInsertionPoint &&\n insertionPointTag && node.querySelector(insertionPointTag);\n let wrappedContent = fragContent &&\n (tree.Logical.getParentNode(fragContent).nodeType !==\n Node.DOCUMENT_FRAGMENT_NODE);\n let hasContent = fragContent || (node.localName === insertionPointTag);\n // There are 3 possible cases where a distribution may need to occur:\n // 1. being inserted (the host of the shady root where\n // content is inserted needs distribution)\n // 2. children being inserted into parent with a shady root (parent\n // needs distribution)\n // 3. container is an insertionPoint\n if (hasContent || (container.localName === insertionPointTag)) {\n if (ownerRoot) {\n // note, insertion point list update is handled after node\n // mutations are complete\n ownerRoot.update();\n }\n }\n let needsDist = this._nodeNeedsDistribution(container);\n if (needsDist) {\n container.shadyRoot.update();\n }\n // Return true when distribution will fully handle the composition\n // Note that if a content was being inserted that was wrapped by a node,\n // and the parent does not need distribution, return false to allow\n // the nodes to be added directly, after which children may be\n // distributed and composed into the wrapping node(s)\n return needsDist || (hasContent && !wrappedContent);\n },\n\n /* note: parent argument is required since node may have an out\n of date parent at this point; returns true if a is being added */\n _maybeAddInsertionPoint(node, parent, root) {\n let added;\n let insertionPointTag = root.getInsertionPointTag();\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n !node.__noInsertionPoint) {\n let c$ = node.querySelectorAll(insertionPointTag);\n for (let i=0, n, np, na; (i (host of container needs distribution)\n insertBefore(node, ref_node) {\n if (ref_node && tree.Logical.getParentNode(ref_node) !== this) {\n throw Error('The ref_node to be inserted before is not a child ' +\n 'of this node');\n }\n // remove node from its current position iff it's in a tree.\n if (node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {\n let parent = tree.Logical.getParentNode(node);\n mixinImpl.removeNodeFromParent(node, parent);\n }\n if (!mixinImpl.addNode(this, node, ref_node)) {\n if (ref_node) {\n // if ref_node is an insertion point replace with first distributed node\n let root = mixinImpl.ownerShadyRootForNode(ref_node);\n if (root) {\n ref_node = ref_node.localName === root.getInsertionPointTag() ?\n mixinImpl.firstComposedNode(ref_node) : ref_node;\n }\n }\n // if adding to a shadyRoot, add to host instead\n let container = utils.isShadyRoot(this) ?\n this.host : this;\n if (ref_node) {\n tree.Composed.insertBefore(container, node, ref_node);\n } else {\n tree.Composed.appendChild(container, node);\n }\n }\n mixinImpl._scheduleObserver(this, node);\n return node;\n },\n\n /**\n Removes the given `node` from the element's `lightChildren`.\n This method also performs dom composition.\n */\n removeChild(node) {\n if (tree.Logical.getParentNode(node) !== this) {\n throw Error('The node to be removed is not a child of this node: ' +\n node);\n }\n if (!mixinImpl.removeNode(node)) {\n // if removing from a shadyRoot, remove form host instead\n let container = utils.isShadyRoot(this) ?\n this.host :\n this;\n // not guaranteed to physically be in container; e.g.\n // undistributed nodes.\n let parent = tree.Composed.getParentNode(node);\n if (container === parent) {\n tree.Composed.removeChild(container, node);\n }\n }\n mixinImpl._scheduleObserver(this, null, node);\n return node;\n },\n\n replaceChild(node, ref_node) {\n this.insertBefore(node, ref_node);\n this.removeChild(ref_node);\n return node;\n },\n\n // TODO(sorvell): consider doing native QSA and filtering results.\n querySelector(selector) {\n // match selector and halt on first result.\n let result = mixinImpl.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n }, function(n) {\n return Boolean(n);\n })[0];\n return result || null;\n },\n\n querySelectorAll(selector) {\n return mixinImpl.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n });\n },\n\n cloneNode(deep) {\n if (this.localName == 'template') {\n return nativeCloneNode.call(this, deep);\n } else {\n let n = nativeCloneNode.call(this, false);\n if (deep) {\n let c$ = this.childNodes;\n for (let i=0, nc; i < c$.length; i++) {\n nc = c$[i].cloneNode(true);\n n.appendChild(nc);\n }\n }\n return n;\n }\n },\n\n importNode(externalNode, deep) {\n // for convenience use this node's ownerDoc if the node isn't a document\n let doc = this instanceof Document ? this :\n this.ownerDocument;\n let n = nativeImportNode.call(doc, externalNode, false);\n if (deep) {\n let c$ = tree.Logical.getChildNodes(externalNode);\n utils.common.patchNode(n);\n for (let i=0, nc; i < c$.length; i++) {\n nc = doc.importNode(c$[i], true);\n n.appendChild(nc);\n }\n }\n return n;\n }\n};\n\nObject.defineProperties(FragmentMixin, {\n\n childNodes: {\n get() {\n let c$ = tree.Logical.getChildNodes(this);\n return Array.isArray(c$) ? c$ : tree.arrayCopyChildNodes(this);\n },\n configurable: true\n },\n\n children: {\n get() {\n if (tree.Logical.hasChildNodes(this)) {\n return Array.prototype.filter.call(this.childNodes, function(n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n });\n } else {\n return tree.arrayCopyChildren(this);\n }\n },\n configurable: true\n },\n\n firstChild: {\n get() {\n return tree.Logical.getFirstChild(this);\n },\n configurable: true\n },\n\n lastChild: {\n get() {\n return tree.Logical.getLastChild(this);\n },\n configurable: true\n },\n\n firstElementChild: {\n get() {\n return tree.Logical.getFirstElementChild(this);\n },\n configurable: true\n },\n\n lastElementChild: {\n get() {\n return tree.Logical.getLastElementChild(this);\n },\n configurable: true\n },\n\n // TODO(srovell): strictly speaking fragments do not have textContent\n // or innerHTML but ShadowRoots do and are not easily distinguishable.\n // textContent / innerHTML\n textContent: {\n get() {\n if (this.childNodes) {\n let tc = [];\n for (let i = 0, cn = this.childNodes, c; (c = cn[i]); i++) {\n if (c.nodeType !== Node.COMMENT_NODE) {\n tc.push(c.textContent);\n }\n }\n return tc.join('');\n }\n return '';\n },\n set(text) {\n mixinImpl.clearNode(this);\n if (text) {\n this.appendChild(document.createTextNode(text));\n }\n },\n configurable: true\n },\n\n innerHTML: {\n get() {\n return getInnerHTML(this);\n },\n set(text) {\n mixinImpl.clearNode(this);\n let d = document.createElement('div');\n d.innerHTML = text;\n // here, appendChild may move nodes async so we cannot rely\n // on node position when copying\n let c$ = tree.arrayCopyChildNodes(d);\n for (let i=0; i < c$.length; i++) {\n this.appendChild(c$[i]);\n }\n },\n configurable: true\n }\n\n});\n\nlet ElementMixin = {\n\n // TODO(sorvell): should only exist on \n assignedNodes(options) {\n return (options && options.flatten ? this._distributedNodes :\n this._assignedNodes) || [];\n },\n\n\n setAttribute(name, value) {\n nativeSetAttribute.call(this, name, value);\n if (!mixinImpl.maybeDistributeParent(this)) {\n mixinImpl.maybeDistributeAttributeChange(this, name);\n }\n },\n\n removeAttribute(name) {\n nativeRemoveAttribute.call(this, name);\n if (!mixinImpl.maybeDistributeParent(this)) {\n mixinImpl.maybeDistributeAttributeChange(this, name);\n }\n }\n\n};\n\nObject.defineProperties(ElementMixin, {\n\n shadowRoot: {\n get() {\n return this.shadyRoot;\n }\n },\n\n slot: {\n get() {\n return this.getAttribute('slot');\n },\n set(value) {\n this.setAttribute('slot', value);\n }\n }\n\n});\n\nlet activeElementDescriptor = {\n get() {\n return mixinImpl.activeElementForNode(this);\n }\n}\n\nlet ActiveElementMixin = {};\nObject.defineProperties(ActiveElementMixin, {\n activeElement: activeElementDescriptor\n});\n\nlet UnderActiveElementMixin = {};\nObject.defineProperties(UnderActiveElementMixin, {\n _activeElement: activeElementDescriptor\n});\n\nexport let Mixins = {\n\n Node: utils.extendAll({__patched: 'Node'}, NodeMixin),\n\n Fragment: utils.extendAll({__patched: 'Fragment'},\n NodeMixin, FragmentMixin, ActiveElementMixin),\n\n Element: utils.extendAll({__patched: 'Element'},\n NodeMixin, FragmentMixin, ElementMixin, ActiveElementMixin),\n\n // Note: activeElement cannot be patched on document!\n Document: utils.extendAll({__patched: 'Document'},\n NodeMixin, FragmentMixin, ElementMixin, UnderActiveElementMixin)\n\n};\n\nexport let getRootNode = function(node) {\n return mixinImpl.getRootNode(node);\n}\n\nexport function filterMutations(mutations, target) {\n const targetRootNode = getRootNode(target);\n return mutations.filter(function(mutation) {\n const mutationInScope = (targetRootNode === getRootNode(mutation.target));\n if (mutationInScope && mutation.addedNodes) {\n let nodes = Array.from(mutation.addedNodes).filter(function(n) {\n return (targetRootNode === getRootNode(n));\n });\n Object.defineProperty(mutation, 'addedNodes', {\n value: nodes,\n configurable: true\n });\n }\n return mutationInScope &&\n (!mutation.addedNodes || mutation.addedNodes.length);\n });\n}\n\n// const promise = Promise.resolve();\n\nclass AsyncObserver {\n\n constructor() {\n this._scheduled = false;\n this.addedNodes = [];\n this.removedNodes = [];\n this.callbacks = new Set();\n }\n\n schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n utils.promish.then(() => {\n this.flush();\n });\n }\n }\n\n flush() {\n if (this._scheduled) {\n this._scheduled = false;\n let mutations = this.takeRecords();\n if (mutations.length) {\n this.callbacks.forEach(function(cb) {\n cb(mutations);\n });\n }\n }\n }\n\n takeRecords() {\n if (this.addedNodes.length || this.removedNodes.length) {\n let mutations = [{\n addedNodes: this.addedNodes,\n removedNodes: this.removedNodes\n }];\n this.addedNodes = [];\n this.removedNodes = [];\n return mutations;\n }\n return [];\n }\n\n}\n\n// TODO(sorvell): consider instead polyfilling MutationObserver\n// directly so that users do not have to fork their code.\n// Supporting the entire api may be challenging: e.g. filtering out\n// removed nodes in the wrong scope and seeing non-distributing\n// subtree child mutations.\nexport let observeChildren = function(node, callback) {\n utils.common.patchNode(node);\n if (!node.__dom.observer) {\n node.__dom.observer = new AsyncObserver();\n }\n node.__dom.observer.callbacks.add(callback);\n let observer = node.__dom.observer;\n return {\n _callback: callback,\n _observer: observer,\n _node: node,\n takeRecords() {\n return observer.takeRecords()\n }\n };\n}\n\nexport let unobserveChildren = function(handle) {\n let observer = handle && handle._observer;\n if (observer) {\n observer.callbacks.delete(handle._callback);\n if (!observer.callbacks.size) {\n handle._node.__dom.observer = null;\n }\n }\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\n'use strict';\nimport {tree} from './tree'\nimport * as utils from './utils'\nimport {Mixins} from './element-mixin'\n\nexport let patchedCount = 0;\n\nlet log = false;\n\nlet patchImpl = {\n\n canPatchNode: function(node) {\n switch (node) {\n case document.head:\n case document.documentElement:\n return false;\n default:\n return true;\n }\n },\n\n hasPrototypeDescriptors: Boolean(Object.getOwnPropertyDescriptor(\n window.Node.prototype, 'textContent')),\n\n patch: function(node) {\n patchedCount++;\n log && window.console.warn('patch node', node);\n if (this.hasPrototypeDescriptors) {\n utils.patchPrototype(node, this.mixinForObject(node));\n } else {\n window.console.warn('Patching instance rather than prototype', node);\n utils.extend(node, this.mixinForNode(node));\n }\n },\n\n mixinForObject: function(obj) {\n switch (obj.nodeType) {\n case Node.ELEMENT_NODE:\n return Mixins.Element;\n case Node.DOCUMENT_FRAGMENT_NODE:\n return Mixins.Fragment;\n case Node.DOCUMENT_NODE:\n return Mixins.Document;\n case Node.TEXT_NODE:\n case Node.COMMENT_NODE:\n return Mixins.Node;\n }\n },\n\n unpatch: function(obj) {\n if (obj.__sourceProto) {\n obj.__proto__ = obj.__sourceProto;\n\n }\n // TODO(sorvell): implement unpatching for non-proto patchable browsers\n }\n\n};\n\nexport function patchNode(node) {\n if (!utils.settings.inUse) {\n return;\n }\n if (!isNodePatched(node) && patchImpl.canPatchNode(node)) {\n tree.saveChildNodes(node);\n patchImpl.patch(node);\n }\n}\n\nexport function unpatchNode(node) {\n patchImpl.unpatch(node);\n}\n\nexport function isNodePatched(node) {\n return Boolean(node.__patched);\n}\n\n// TODO(sorvell): fake export\nutils.common.patchNode = patchNode;\nutils.common.isNodePatched = isNodePatched;","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport * as utils from './utils'\n\nlet origAddEventListener = Element.prototype.addEventListener;\nlet origRemoveEventListener = Element.prototype.removeEventListener;\n\n// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937\nlet alwaysComposed = {\n blur: true,\n focus: true,\n focusin: true,\n focusout: true,\n click: true,\n dblclick: true,\n mousedown: true,\n mouseenter: true,\n mouseleave: true,\n mousemove: true,\n mouseout: true,\n mouseover: true,\n mouseup: true,\n wheel: true,\n beforeinput: true,\n input: true,\n keydown: true,\n keyup: true,\n compositionstart: true,\n compositionupdate: true,\n compositionend: true,\n touchstart: true,\n touchend: true,\n touchmove: true,\n touchcancel: true,\n pointerover: true,\n pointerenter: true,\n pointerdown: true,\n pointermove: true,\n pointerup: true,\n pointercancel: true,\n pointerout: true,\n pointerleave: true,\n gotpointercapture: true,\n lostpointercapture: true,\n dragstart: true,\n drag: true,\n dragenter: true,\n dragleave: true,\n dragover: true,\n drop: true,\n dragend: true,\n DOMActivate: true,\n DOMFocusIn: true,\n DOMFocusOut: true,\n keypress: true\n};\n\nfunction pathComposer(startNode, composed) {\n let composedPath = [];\n let current = startNode;\n let startRoot = startNode === window ? window : startNode.getRootNode();\n while (current) {\n composedPath.push(current);\n if (current.assignedSlot) {\n current = current.assignedSlot;\n } else if (current.nodeType === Node.DOCUMENT_FRAGMENT_NODE && current.host && (composed || current !== startRoot)) {\n current = current.host;\n } else {\n current = current.parentNode;\n }\n }\n // event composedPath includes window when startNode's ownerRoot is document\n if (composedPath[composedPath.length - 1] === document) {\n composedPath.push(window);\n }\n return composedPath;\n}\n\nfunction retarget(refNode, path) {\n if (!utils.isShadyRoot) {\n return refNode;\n }\n // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n // shadow-including inclusive ancestor, return ANCESTOR.\n let refNodePath = pathComposer(refNode, true);\n let p$ = path;\n for (let i=0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n ancestor = p$[i];\n root = ancestor === window ? window : ancestor.getRootNode();\n if (root !== lastRoot) {\n rootIdx = refNodePath.indexOf(root);\n lastRoot = root;\n }\n if (!utils.isShadyRoot(root) || rootIdx > -1) {\n return ancestor;\n }\n }\n}\n\nlet EventMixin = {\n\n __patched: 'Event',\n\n get composed() {\n if (this.isTrusted && this.__composed === undefined) {\n this.__composed = alwaysComposed[this.type];\n }\n return this.__composed || false;\n },\n\n composedPath() {\n if (!this.__composedPath) {\n this.__composedPath = pathComposer(this.__target, this.composed);\n }\n return this.__composedPath;\n },\n\n get target() {\n return retarget(this.currentTarget, this.composedPath());\n },\n\n // http://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting\n get relatedTarget() {\n if (!this.__relatedTarget) {\n return null;\n }\n if (!this.__relatedTargetComposedPath) {\n this.__relatedTargetComposedPath = pathComposer(this.__relatedTarget, true);\n }\n // find the deepest node in relatedTarget composed path that is in the same root with the currentTarget\n return retarget(this.currentTarget, this.__relatedTargetComposedPath);\n },\n stopPropagation() {\n Event.prototype.stopPropagation.call(this);\n this.__propagationStopped = true;\n },\n stopImmediatePropagation() {\n Event.prototype.stopImmediatePropagation.call(this);\n this.__immediatePropagationStopped = true;\n this.__propagationStopped = true;\n }\n\n};\n\nfunction mixinComposedFlag(Base) {\n // NOTE: avoiding use of `class` here so that transpiled output does not\n // try to do `Base.call` with a dom construtor.\n let klazz = function(type, options) {\n let event = new Base(type, options);\n event.__composed = options && Boolean(options.composed);\n return event;\n }\n // put constructor properties on subclass\n utils.mixin(klazz, Base);\n klazz.prototype = Base.prototype;\n return klazz;\n}\n\nlet nonBubblingEventsToRetarget = {\n focus: true,\n blur: true\n};\n\nfunction fireHandlers(event, node, phase) {\n let hs = node.__handlers && node.__handlers[event.type] &&\n node.__handlers[event.type][phase];\n if (hs) {\n for (let i = 0, fn; (fn = hs[i]); i++) {\n fn.call(node, event);\n if (event.__immediatePropagationStopped) {\n return;\n }\n }\n }\n}\n\nfunction retargetNonBubblingEvent(e) {\n let path = e.composedPath();\n let node;\n // override `currentTarget` to let patched `target` calculate correctly\n Object.defineProperty(e, 'currentTarget', {\n get: function() {\n return node;\n },\n configurable: true\n });\n for (let i = path.length - 1; i >= 0; i--) {\n node = path[i];\n // capture phase fires all capture handlers\n fireHandlers(e, node, 'capture');\n if (e.__propagationStopped) {\n return;\n }\n }\n\n // set the event phase to `AT_TARGET` as in spec\n Object.defineProperty(e, 'eventPhase', {value: Event.AT_TARGET});\n\n // the event only needs to be fired when owner roots change when iterating the event path\n // keep track of the last seen owner root\n let lastFiredRoot;\n for (let i = 0; i < path.length; i++) {\n node = path[i];\n if (i === 0 || (node.shadowRoot && node.shadowRoot === lastFiredRoot)) {\n fireHandlers(e, node, 'bubble');\n // don't bother with window, it doesn't have `getRootNode` and will be last in the path anyway\n if (node !== window) {\n lastFiredRoot = node.getRootNode();\n }\n if (e.__propagationStopped) {\n return;\n }\n }\n }\n}\n\nexport function addEventListener(type, fn, optionsOrCapture) {\n if (!fn) {\n return;\n }\n\n // The callback `fn` might be used for multiple nodes/events. Since we generate\n // a wrapper function, we need to keep track of it when we remove the listener.\n // It's more efficient to store the node/type/options information as Array in\n // `fn` itself rather than the node (we assume that the same callback is used\n // for few nodes at most, whereas a node will likely have many event listeners).\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n if (fn.__eventWrappers) {\n // Stop if the wrapper function has already been created.\n for (let i = 0; i < fn.__eventWrappers.length; i++) {\n if (fn.__eventWrappers[i].node === this &&\n fn.__eventWrappers[i].type === type &&\n fn.__eventWrappers[i].capture === capture &&\n fn.__eventWrappers[i].once === once &&\n fn.__eventWrappers[i].passive === passive) {\n return;\n }\n }\n } else {\n fn.__eventWrappers = [];\n }\n\n const wrapperFn = function(e) {\n // Support `once` option.\n if (once) {\n this.removeEventListener(type, fn, optionsOrCapture);\n }\n if (!e.__target) {\n e.__target = e.target;\n e.__relatedTarget = e.relatedTarget;\n utils.patchPrototype(e, EventMixin);\n }\n // There are two critera that should stop events from firing on this node\n // 1. the event is not composed and the current node is not in the same root as the target\n // 2. when bubbling, if after retargeting, relatedTarget and target point to the same node\n if (e.composed || e.composedPath().indexOf(this) > -1) {\n if (e.eventPhase === Event.BUBBLING_PHASE) {\n if (e.target === e.relatedTarget) {\n e.stopImmediatePropagation();\n return;\n }\n }\n return fn(e);\n }\n };\n // Store the wrapper information.\n fn.__eventWrappers.push({\n node: this,\n type: type,\n capture: capture,\n once: once,\n passive: passive,\n wrapperFn: wrapperFn\n });\n\n if (nonBubblingEventsToRetarget[type]) {\n this.__handlers = this.__handlers || {};\n this.__handlers[type] = this.__handlers[type] || {capture: [], bubble: []};\n this.__handlers[type][capture ? 'capture' : 'bubble'].push(wrapperFn);\n } else {\n origAddEventListener.call(this, type, wrapperFn, optionsOrCapture);\n }\n}\n\nexport function removeEventListener(type, fn, optionsOrCapture) {\n if (!fn) {\n return;\n }\n\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n // Search the wrapped function.\n let wrapperFn = undefined;\n if (fn.__eventWrappers) {\n for (let i = 0; i < fn.__eventWrappers.length; i++) {\n if (fn.__eventWrappers[i].node === this &&\n fn.__eventWrappers[i].type === type &&\n fn.__eventWrappers[i].capture === capture &&\n fn.__eventWrappers[i].once === once &&\n fn.__eventWrappers[i].passive === passive) {\n wrapperFn = fn.__eventWrappers.splice(i, 1)[0].wrapperFn;\n // Cleanup.\n if (!fn.__eventWrappers.length) {\n fn.__eventWrappers = undefined;\n }\n break;\n }\n }\n }\n\n origRemoveEventListener.call(this, type, wrapperFn || fn, optionsOrCapture);\n if (wrapperFn && nonBubblingEventsToRetarget[type] &&\n this.__handlers && this.__handlers[type]) {\n const arr = this.__handlers[type][capture ? 'capture' : 'bubble'];\n const idx = arr.indexOf(wrapperFn);\n if (idx > -1) {\n arr.splice(idx, 1);\n }\n }\n}\n\nexport function activateFocusEventOverrides() {\n for (let ev in nonBubblingEventsToRetarget) {\n window.addEventListener(ev, function(e) {\n if (!e.__target) {\n e.__target = e.target;\n e.__relatedTarget = e.relatedTarget;\n utils.patchPrototype(e, EventMixin);\n retargetNonBubblingEvent(e);\n e.stopImmediatePropagation();\n }\n }, true);\n }\n}\n\nexport let OriginalEvent = Event;\nexport let PatchedEvent = mixinComposedFlag(Event);\nexport let PatchedCustomEvent = mixinComposedFlag(CustomEvent);\nexport let PatchedMouseEvent = mixinComposedFlag(MouseEvent);\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\n'use strict';\nimport * as utils from './utils'\nimport {ShadyRoot, flush, enqueue} from './shady'\nimport * as patch from './patch'\nimport {getRootNode, filterMutations, observeChildren, unobserveChildren}\n from './element-mixin'\nimport * as events from './event-mixin'\nimport {tree, getNativeProperty} from './tree'\n\nif (utils.settings.inUse) {\n\n window.ShadyDOM = {\n tree: tree,\n getNativeProperty: getNativeProperty,\n patch: patch.patchNode,\n isPatched: patch.isNodePatched,\n unpatch: patch.unpatchNode,\n isShadyRoot: utils.isShadyRoot,\n enqueue: enqueue,\n flush: flush,\n inUse: utils.settings.inUse,\n filterMutations: filterMutations,\n observeChildren: observeChildren,\n unobserveChildren: unobserveChildren\n };\n\n let createRootAndEnsurePatched = function(node) {\n // TODO(sorvell): need to ensure ancestors are patched but this introduces\n // a timing problem with gathering composed children.\n // (1) currently the child list is crawled and patched when patching occurs\n // (this needs to change)\n // (2) we can only patch when an element has received its parsed children\n // because we cannot detect them when inserted by parser.\n // let ancestor = node;\n // while (ancestor) {\n // patchNode(ancestor);\n // ancestor = ancestor.parentNode || ancestor.host;\n // }\n patch.patchNode(node);\n let root = new ShadyRoot(node);\n patch.patchNode(root);\n return root;\n }\n\n Element.prototype.attachShadow = function() {\n return createRootAndEnsurePatched(this);\n }\n\n Node.prototype.addEventListener = events.addEventListener;\n Node.prototype.removeEventListener = events.removeEventListener;\n Event = events.PatchedEvent;\n CustomEvent = events.PatchedCustomEvent;\n MouseEvent = events.PatchedMouseEvent;\n events.activateFocusEventOverrides();\n\n Object.defineProperty(Node.prototype, 'isConnected', {\n get() {\n return document.documentElement.contains(this);\n },\n configurable: true\n });\n\n Node.prototype.getRootNode = function(options) {\n return getRootNode(this, options);\n }\n\n Object.defineProperty(Element.prototype, 'slot', {\n get() {\n return this.getAttribute('slot');\n },\n set(value) {\n this.setAttribute('slot', value);\n },\n configurable: true\n });\n\n Object.defineProperty(Node.prototype, 'assignedSlot', {\n get() {\n return this._assignedSlot || null;\n },\n configurable: true\n });\n\n // TODO(sorvell): super experimental auto patching of document fragment\n // via appendChild. This either needs to be expanded or contracted.\n // DocumentFragment.prototype.appendChild = function(node) {\n // patchNode(this);\n // return this.appendChild(node);\n // }\n\n}\n"],"names":["let","const","i","j","this","utils.common","p","parent","node","c","s","n","utils.extend","utils.promish","flush","utils.isShadyRoot","isShadyRoot","utils.matchesSelector","utils.extendAll","utils.patchPrototype","utils.settings","utils.mixin","patch.patchNode","patch.isNodePatched","patch.unpatchNode","events.addEventListener","events.removeEventListener","events.PatchedEvent","events.PatchedCustomEvent","events.PatchedMouseEvent","events.activateFocusEventOverrides"],"mappings":";;;AAAA;;;;;;;;;;AAUA,AAEA,AAAOA,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;;AAE5C,QAAQ,CAAC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;;AAEpG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CA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C,SAAS,CAAC,WAAW,GAAG,SAAS,OAAO,EAAE;IAC7C,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;GACnC;;EAED,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE;IAC/C,GAAG,gBAAA,GAAG;MACJ,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;KAClC;IACD,GAAG,cAAA,CAAC,KAAK,EAAE;MACT,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAClC;IACD,YAAY,EAAE,IAAI;GACnB,CAAC,CAAC;;EAEH,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE;IACpD,GAAG,gBAAA,GAAG;MACJ,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC;KACnC;IACD,YAAY,EAAE,IAAI;GACnB,CAAC,CAAC;;;;;;;;;CASJ;;","sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"shadydom.min.js","sources":["utils.js","array-splice.js","tree.js","distributor.js","shady.js","innerHTML.js","element-mixin.js","patch.js","event-mixin.js","env.js"],"sourcesContent":["/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let settings = window.ShadyDOM || {};\n\nsettings.hasNativeShadowDOM = Boolean(Element.prototype.attachShadow && Node.prototype.getRootNode);\n\nsettings.inUse = settings.force || !settings.hasNativeShadowDOM;\n\nexport function isShadyRoot(obj) {\n return Boolean(obj.__localName === 'ShadyRoot');\n}\n\nlet p = Element.prototype;\nlet matches = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nexport function matchesSelector(element, selector) {\n return matches.call(element, selector);\n}\n\nfunction copyOwnProperty(name, source, target) {\n let pd = Object.getOwnPropertyDescriptor(source, name);\n if (pd) {\n Object.defineProperty(target, name, pd);\n }\n}\n\nexport function extend(target, source) {\n if (target && source) {\n let n$ = Object.getOwnPropertyNames(source);\n for (let i=0, n; (i '123yyyy'\n //\n // With 1-edit updates, the shortest path would be just to update all seven\n // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n // leaves the substring '123' intact.\n calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n },\n\n // This starts at the final weight, and walks \"backward\" by finding\n // the minimum previous weight recursively until the origin of the weight\n // matrix.\n spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n },\n\n /**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * \n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n /**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\n calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = this.sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n let ops = this.spliceOperationsFromEditDistances(\n this.calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n },\n\n sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++)\n if (!this.equals(current[i], old[i]))\n return i;\n return searchLength;\n },\n\n sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && this.equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n },\n\n calculateSplices(current, previous) {\n return this.calcSplices(current, 0, current.length, previous, 0,\n previous.length);\n },\n\n equals(currentValue, previousValue) {\n return currentValue === previousValue;\n }\n\n};\n\nexport let calculateSplices = (current, previous) =>\n ArraySplice.calculateSplices(current, previous);\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n// TODO(sorvell): circular (patch loads tree and tree loads patch)\n// for now this is stuck on `utils`\n//import {patchNode} from './patch'\nimport * as utils from './utils'\n\n// native add/remove\nlet nativeInsertBefore = Element.prototype.insertBefore;\nlet nativeAppendChild = Element.prototype.appendChild;\nlet nativeRemoveChild = Element.prototype.removeChild;\n\n/**\n * `tree` is a dom manipulation library used by ShadyDom to\n * manipulate composed and logical trees.\n */\nexport let tree = {\n\n // sad but faster than slice...\n arrayCopyChildNodes(parent) {\n let copy=[], i=0;\n for (let n=parent.firstChild; n; n=n.nextSibling) {\n copy[i++] = n;\n }\n return copy;\n },\n\n arrayCopyChildren(parent) {\n let copy=[], i=0;\n for (let n=parent.firstElementChild; n; n=n.nextElementSibling) {\n copy[i++] = n;\n }\n return copy;\n },\n\n arrayCopy(a$) {\n let l = a$.length;\n let copy = new Array(l);\n for (let i=0; i < l; i++) {\n copy[i] = a$[i];\n }\n return copy;\n },\n\n saveChildNodes(node) {\n tree.Logical.saveChildNodes(node);\n if (!tree.Composed.hasParentNode(node)) {\n tree.Composed.saveComposedData(node);\n //tree.Composed.saveParentNode(node);\n }\n tree.Composed.saveChildNodes(node);\n }\n\n};\n\ntree.Logical = {\n\n hasParentNode(node) {\n return Boolean(node.__dom && node.__dom.parentNode);\n },\n\n hasChildNodes(node) {\n return Boolean(node.__dom && node.__dom.childNodes !== undefined);\n },\n\n getChildNodes(node) {\n // note: we're distinguishing here between undefined and false-y:\n // hasChildNodes uses undefined check to see if this element has logical\n // children; the false-y check indicates whether or not we should rebuild\n // the cached childNodes array.\n return this.hasChildNodes(node) ? this._getChildNodes(node) :\n tree.Composed.getChildNodes(node);\n },\n\n _getChildNodes(node) {\n if (!node.__dom.childNodes) {\n node.__dom.childNodes = [];\n for (let n=this.getFirstChild(node); n; n=this.getNextSibling(n)) {\n node.__dom.childNodes.push(n);\n }\n }\n return node.__dom.childNodes;\n },\n\n // NOTE: __dom can be created under 2 conditions: (1) an element has a\n // logical tree, or (2) an element is in a logical tree. In case (1), the\n // element will store firstChild/lastChild, and in case (2), the element\n // will store parentNode, nextSibling, previousSibling. This means that\n // the mere existence of __dom is not enough to know if the requested\n // logical data is available and instead we do an explicit undefined check.\n getParentNode(node) {\n return node.__dom && node.__dom.parentNode !== undefined ?\n node.__dom.parentNode : tree.Composed.getParentNode(node);\n },\n\n getFirstChild(node) {\n return node.__dom && node.__dom.firstChild !== undefined ?\n node.__dom.firstChild : tree.Composed.getFirstChild(node);\n },\n\n getLastChild(node) {\n return node.__dom && node.__dom.lastChild !== undefined ?\n node.__dom.lastChild : tree.Composed.getLastChild(node);\n },\n\n getNextSibling(node) {\n return node.__dom && node.__dom.nextSibling !== undefined ?\n node.__dom.nextSibling : tree.Composed.getNextSibling(node);\n },\n\n getPreviousSibling(node) {\n return node.__dom && node.__dom.previousSibling !== undefined ?\n node.__dom.previousSibling : tree.Composed.getPreviousSibling(node);\n },\n\n getFirstElementChild(node) {\n return node.__dom && node.__dom.firstChild !== undefined ?\n this._getFirstElementChild(node) :\n tree.Composed.getFirstElementChild(node);\n },\n\n _getFirstElementChild(node) {\n let n = node.__dom.firstChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.nextSibling;\n }\n return n;\n },\n\n getLastElementChild(node) {\n return node.__dom && node.__dom.lastChild !== undefined ?\n this._getLastElementChild(node) :\n tree.Composed.getLastElementChild(node);\n },\n\n _getLastElementChild(node) {\n let n = node.__dom.lastChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.previousSibling;\n }\n return n;\n },\n\n getNextElementSibling(node) {\n return node.__dom && node.__dom.nextSibling !== undefined ?\n this._getNextElementSibling(node) :\n tree.Composed.getNextElementSibling(node);\n },\n\n _getNextElementSibling(node) {\n let n = node.__dom.nextSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getNextSibling(n);\n }\n return n;\n },\n\n getPreviousElementSibling(node) {\n return node.__dom && node.__dom.previousSibling !== undefined ?\n this._getPreviousElementSibling(node) :\n tree.Composed.getPreviousElementSibling(node);\n },\n\n _getPreviousElementSibling(node) {\n let n = node.__dom.previousSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getPreviousSibling(n);\n }\n return n;\n },\n\n // Capture the list of light children. It's important to do this before we\n // start transforming the DOM into \"rendered\" state.\n // Children may be added to this list dynamically. It will be treated as the\n // source of truth for the light children of the element. This element's\n // actual children will be treated as the rendered state once this function\n // has been called.\n saveChildNodes(node) {\n if (!this.hasChildNodes(node)) {\n node.__dom = node.__dom || {};\n node.__dom.firstChild = node.firstChild;\n node.__dom.lastChild = node.lastChild;\n let c$ = node.__dom.childNodes = tree.arrayCopyChildNodes(node);\n for (let i=0, n; (i node\n node.__dom.previousSibling = ref_node ? ref_node.__dom.previousSibling :\n container.__dom.lastChild;\n if (node.__dom.previousSibling) {\n node.__dom.previousSibling.__dom.nextSibling = node;\n }\n // update node <-> ref_node\n node.__dom.nextSibling = ref_node;\n if (node.__dom.nextSibling) {\n node.__dom.nextSibling.__dom.previousSibling = node;\n }\n // update node <-> container\n node.__dom.parentNode = container;\n if (ref_node) {\n if (ref_node === container.__dom.firstChild) {\n container.__dom.firstChild = node;\n }\n } else {\n container.__dom.lastChild = node;\n if (!container.__dom.firstChild) {\n container.__dom.firstChild = node;\n }\n }\n // remove caching of childNodes\n container.__dom.childNodes = null;\n },\n\n recordRemoveChild(node, container) {\n node.__dom = node.__dom || {};\n container.__dom = container.__dom || {};\n if (node === container.__dom.firstChild) {\n container.__dom.firstChild = node.__dom.nextSibling;\n }\n if (node === container.__dom.lastChild) {\n container.__dom.lastChild = node.__dom.previousSibling;\n }\n let p = node.__dom.previousSibling;\n let n = node.__dom.nextSibling;\n if (p) {\n p.__dom = p.__dom || {};\n p.__dom.nextSibling = n;\n }\n if (n) {\n n.__dom = n.__dom || {};\n n.__dom.previousSibling = p;\n }\n // When an element is removed, logical data is no longer tracked.\n // Explicitly set `undefined` here to indicate this. This is disginguished\n // from `null` which is set if info is null.\n node.__dom.parentNode = node.__dom.previousSibling =\n node.__dom.nextSibling = null;\n // remove caching of childNodes\n container.__dom.childNodes = null;\n }\n\n}\n\n\n// TODO(sorvell): composed tree manipulation is made available\n// (1) to maninpulate the composed tree, and (2) to track changes\n// to the tree for optional patching pluggability.\ntree.Composed = {\n\n hasParentNode(node) {\n return Boolean(node.__dom && node.__dom.$parentNode !== undefined);\n },\n\n hasChildNodes(node) {\n return Boolean(node.__dom && node.__dom.$childNodes !== undefined);\n },\n\n getChildNodes(node) {\n return this.hasChildNodes(node) ? this._getChildNodes(node) :\n (!node.__patched && tree.arrayCopy(node.childNodes));\n },\n\n _getChildNodes(node) {\n if (!node.__dom.$childNodes) {\n node.__dom.$childNodes = [];\n for (let n=node.__dom.$firstChild; n; n=n.__dom.$nextSibling) {\n node.__dom.$childNodes.push(n);\n }\n }\n return node.__dom.$childNodes;\n },\n\n getComposedChildNodes(node) {\n return node.__dom.$childNodes;\n },\n\n getParentNode(node) {\n return this.hasParentNode(node) ? node.__dom.$parentNode :\n (!node.__patched && node.parentNode);\n },\n\n getFirstChild(node) {\n return node.__patched ? node.__dom.$firstChild : node.firstChild;\n },\n\n getLastChild(node) {\n return node.__patched ? node.__dom.$lastChild : node.lastChild;\n },\n\n getNextSibling(node) {\n return node.__patched ? node.__dom.$nextSibling : node.nextSibling;\n },\n\n getPreviousSibling(node) {\n return node.__patched ? node.__dom.$previousSibling : node.previousSibling;\n },\n\n getFirstElementChild(node) {\n return node.__patched ? this._getFirstElementChild(node) :\n node.firstElementChild;\n },\n\n _getFirstElementChild(node) {\n let n = node.__dom.$firstChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.$nextSibling;\n }\n return n;\n },\n\n getLastElementChild(node) {\n return node.__patched ? this._getLastElementChild(node) :\n node.lastElementChild;\n },\n\n _getLastElementChild(node) {\n let n = node.__dom.$lastChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.__dom.$previousSibling;\n }\n return n;\n },\n\n getNextElementSibling(node) {\n return node.__patched ? this._getNextElementSibling(node) :\n node.nextElementSibling;\n },\n\n _getNextElementSibling(node) {\n let n = node.__dom.$nextSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getNextSibling(n);\n }\n return n;\n },\n\n getPreviousElementSibling(node) {\n return node.__patched ? this._getPreviousElementSibling(node) :\n node.previousElementSibling;\n },\n\n _getPreviousElementSibling(node) {\n let n = node.__dom.$previousSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = this.getPreviousSibling(n);\n }\n return n;\n },\n\n saveChildNodes(node) {\n if (!this.hasChildNodes(node)) {\n node.__dom = node.__dom || {};\n node.__dom.$firstChild = node.firstChild;\n node.__dom.$lastChild = node.lastChild;\n let c$ = node.__dom.$childNodes = tree.arrayCopyChildNodes(node);\n for (let i=0, n; (i node\n node.__dom.$previousSibling = ref_node ? ref_node.__dom.$previousSibling :\n container.__dom.$lastChild;\n if (node.__dom.$previousSibling) {\n node.__dom.$previousSibling.__dom.$nextSibling = node;\n }\n // update node <-> ref_node\n node.__dom.$nextSibling = ref_node;\n if (node.__dom.$nextSibling) {\n node.__dom.$nextSibling.__dom.$previousSibling = node;\n }\n // update node <-> container\n node.__dom.$parentNode = container;\n if (ref_node) {\n if (ref_node === container.__dom.$firstChild) {\n container.__dom.$firstChild = node;\n }\n } else {\n container.__dom.$lastChild = node;\n if (!container.__dom.$firstChild) {\n container.__dom.$firstChild = node;\n }\n }\n // remove caching of childNodes\n container.__dom.$childNodes = null;\n },\n\n recordRemoveChild(node, container) {\n node.__dom = node.__dom || {};\n container.__dom = container.__dom || {};\n if (node === container.__dom.$firstChild) {\n container.__dom.$firstChild = node.__dom.$nextSibling;\n }\n if (node === container.__dom.$lastChild) {\n container.__dom.$lastChild = node.__dom.$previousSibling;\n }\n let p = node.__dom.$previousSibling;\n let n = node.__dom.$nextSibling;\n if (p) {\n p.__dom = p.__dom || {};\n p.__dom.$nextSibling = n;\n }\n if (n) {\n n.__dom = n.__dom || {};\n n.__dom.$previousSibling = p;\n }\n node.__dom.$parentNode = node.__dom.$previousSibling =\n node.__dom.$nextSibling = null;\n // remove caching of childNodes\n container.__dom.$childNodes = null;\n },\n\n clearChildNodes(node) {\n let c$ = this.getChildNodes(node);\n for (let i=0, c; i < c$.length; i++) {\n c = c$[i];\n this.recordRemoveChild(c, node);\n nativeRemoveChild.call(node, c)\n }\n },\n\n saveParentNode(node) {\n node.__dom = node.__dom || {};\n node.__dom.$parentNode = node.parentNode;\n },\n\n insertBefore(parentNode, newChild, refChild) {\n this.saveChildNodes(parentNode);\n // remove from current location.\n this._addChild(parentNode, newChild, refChild);\n return nativeInsertBefore.call(parentNode, newChild, refChild || null);\n },\n\n appendChild(parentNode, newChild) {\n this.saveChildNodes(parentNode);\n this._addChild(parentNode, newChild);\n return nativeAppendChild.call(parentNode, newChild);\n },\n\n removeChild(parentNode, node) {\n let currentParent = this.getParentNode(node);\n this.saveChildNodes(parentNode);\n this._removeChild(parentNode, node);\n if (currentParent === parentNode) {\n return nativeRemoveChild.call(parentNode, node);\n }\n },\n\n _addChild(parentNode, newChild, refChild) {\n let isFrag = (newChild.nodeType === Node.DOCUMENT_FRAGMENT_NODE);\n let oldParent = this.getParentNode(newChild);\n if (oldParent) {\n this._removeChild(oldParent, newChild);\n }\n if (isFrag) {\n let c$ = this.getChildNodes(newChild);\n for (let i=0; i < c$.length; i++) {\n let c = c$[i];\n // unlink document fragment children\n this._removeChild(newChild, c);\n this.recordInsertBefore(c, parentNode, refChild);\n }\n } else {\n this.recordInsertBefore(newChild, parentNode, refChild);\n }\n },\n\n _removeChild(parentNode, node) {\n this.recordRemoveChild(node, parentNode);\n }\n\n};\n\n// for testing...\nlet descriptors = {};\nexport function getNativeProperty(element, property) {\n if (!descriptors[property]) {\n descriptors[property] = Object.getOwnPropertyDescriptor(\n HTMLElement.prototype, property) ||\n Object.getOwnPropertyDescriptor(\n Element.prototype, property) ||\n Object.getOwnPropertyDescriptor(\n Node.prototype, property);\n }\n return descriptors[property].get.call(element);\n}\n\n// for testing...\nfunction assertNative(element, property, tracked) {\n let native = getNativeProperty(element, property);\n if (native != tracked && element.__patched) {\n window.console.warn('tracked', tracked, 'native', native);\n }\n return tracked;\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {tree} from './tree'\n\n// NOTE: normalize event contruction where necessary (IE11)\nlet NormalizedEvent = typeof Event === 'function' ? Event :\n function(inType, params) {\n params = params || {};\n var e = document.createEvent('Event');\n e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n return e;\n };\n\nexport default class {\n\n constructor(root) {\n this.root = root;\n this.insertionPointTag = 'slot';\n }\n\n getInsertionPoints() {\n return this.root.querySelectorAll(this.insertionPointTag);\n }\n\n hasInsertionPoint() {\n return Boolean(this.root._insertionPoints &&\n this.root._insertionPoints.length);\n }\n\n isInsertionPoint(node) {\n return node.localName && node.localName == this.insertionPointTag;\n }\n\n distribute() {\n if (this.hasInsertionPoint()) {\n return this.distributePool(this.root, this.collectPool());\n }\n return [];\n }\n\n // Gather the pool of nodes that should be distributed. We will combine\n // these with the \"content root\" to arrive at the composed tree.\n collectPool() {\n return tree.arrayCopy(\n tree.Logical.getChildNodes(this.root.host));\n }\n\n // perform \"logical\" distribution; note, no actual dom is moved here,\n // instead elements are distributed into storage\n // array where applicable.\n distributePool(node, pool) {\n let dirtyRoots = [];\n let p$ = this.root._insertionPoints;\n for (let i=0, l=p$.length, p; (i host\n host.shadyRoot = this;\n this.host = host;\n // logical dom setup\n tree.Logical.saveChildNodes(host);\n tree.Logical.saveChildNodes(this);\n // state flags\n this._clean = true;\n this._hasRendered = false;\n this._distributor = new Distributor(this);\n this.update();\n },\n\n // async render the \"top\" distributor (this is all that is needed to\n // distribute this host).\n update() {\n // TODO(sorvell): instead the root should always be enqueued to helps record that it is dirty.\n // Then, in `render`, the top most (in the distribution tree) \"dirty\" root should be rendered.\n let distributionRoot = this._findDistributionRoot(this.host);\n //console.log('update from', this.host, 'root', distributionRoot.host, distributionRoot._clean);\n if (distributionRoot._clean) {\n distributionRoot._clean = false;\n enqueue(function() {\n distributionRoot.render();\n });\n }\n },\n\n // TODO(sorvell): this may not return a shadowRoot (for example if the element is in a docFragment)\n // this should only return a shadowRoot.\n // returns the host that's the top of this host's distribution tree\n _findDistributionRoot(element) {\n let root = element.shadyRoot;\n while (element && this._elementNeedsDistribution(element)) {\n root = element.getRootNode();\n element = root && root.host;\n }\n return root;\n },\n\n // Return true if a host's children includes\n // an insertion point that selects selectively\n _elementNeedsDistribution(element) {\n let c$ = tree.Logical.getChildNodes(element);\n for (let i=0, c; i < c$.length; i++) {\n c = c$[i];\n if (this._distributor.isInsertionPoint(c)) {\n return element.getRootNode();\n }\n }\n },\n\n render() {\n if (!this._clean) {\n this._clean = true;\n if (!this._skipUpdateInsertionPoints) {\n this.updateInsertionPoints();\n } else if (!this._hasRendered) {\n this._insertionPoints = [];\n }\n this._skipUpdateInsertionPoints = false;\n // TODO(sorvell): previous ShadyDom had a fast path here\n // that would avoid distribution for initial render if\n // no insertion points exist. We cannot currently do this because\n // it relies on elements being in the physical shadowRoot element\n // so that native methods will be used. The current append code\n // simply provokes distribution in this case and does not put the\n // nodes in the shadowRoot. This could be done but we'll need to\n // consider if the special processing is worth the perf gain.\n // if (!this._hasRendered && !this._insertionPoints.length) {\n // tree.Composed.clearChildNodes(this.host);\n // tree.Composed.appendChild(this.host, this);\n // } else {\n // logical\n this.distribute();\n // physical\n this.compose();\n this._hasRendered = true;\n }\n },\n\n forceRender() {\n this._clean = false;\n this.render();\n },\n\n distribute() {\n let dirtyRoots = this._distributor.distribute();\n for (let i=0; i flushMax);\n if (flushList.length && !isFlushedMaxed) {\n flush();\n }\n flushCount = 0;\n if (isFlushedMaxed) {\n throw new Error('Loop detected in ShadyDOM distribution, aborting.')\n }\n}\n\nflush.list = flushList;","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n// Cribbed from ShadowDOM polyfill\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/ShadowDOM/wrappers/HTMLElement.js#L28\n/////////////////////////////////////////////////////////////////////////////\n// innerHTML and outerHTML\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nlet escapeAttrRegExp = /[&\\u00A0\"]/g;\nlet escapeDataRegExp = /[&\\u00A0<>]/g;\n\nfunction escapeReplace(c) {\n switch (c) {\n case '&':\n return '&';\n case '<':\n return '<';\n case '>':\n return '>';\n case '\"':\n return '"';\n case '\\u00A0':\n return ' ';\n }\n}\n\nfunction escapeAttr(s) {\n return s.replace(escapeAttrRegExp, escapeReplace);\n}\n\nfunction escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n}\n\nfunction makeSet(arr) {\n let set = {};\n for (let i = 0; i < arr.length; i++) {\n set[arr[i]] = true;\n }\n return set;\n}\n\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nlet voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]);\n\nlet plaintextParents = makeSet([\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'noframes',\n 'plaintext',\n 'noscript'\n]);\n\nexport function getOuterHTML(node, parentNode, composed) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE: {\n let tagName = node.localName;\n let s = '<' + tagName;\n let attrs = node.attributes;\n for (let i = 0, attr; (attr = attrs[i]); i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName]) {\n return s;\n }\n return s + getInnerHTML(node, composed) + '';\n }\n case Node.TEXT_NODE: {\n let data = node.data;\n if (parentNode && plaintextParents[parentNode.localName]) {\n return data;\n }\n return escapeData(data);\n }\n case Node.COMMENT_NODE: {\n return '';\n }\n default: {\n window.console.error(node);\n throw new Error('not implemented');\n }\n }\n}\n\nexport function getInnerHTML(node, composed) {\n if (node.localName === 'template') {\n node = node.content;\n }\n let s = '';\n let c$ = composed ? composed(node) : node.childNodes;\n for (let i=0, l=c$.length, child; (i children but since this case is assumed to be exceedingly\n // rare, we avoid the cost and will address with some specific api\n // when the need arises. For now, the user must call\n // distributeContent(true), which updates insertion points manually\n // and forces distribution.\n let insertionPointTag = ownerRoot && ownerRoot.getInsertionPointTag() || '';\n let fragContent = (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) &&\n !node.__noInsertionPoint &&\n insertionPointTag && node.querySelector(insertionPointTag);\n let wrappedContent = fragContent &&\n (tree.Logical.getParentNode(fragContent).nodeType !==\n Node.DOCUMENT_FRAGMENT_NODE);\n let hasContent = fragContent || (node.localName === insertionPointTag);\n // There are 3 possible cases where a distribution may need to occur:\n // 1. being inserted (the host of the shady root where\n // content is inserted needs distribution)\n // 2. children being inserted into parent with a shady root (parent\n // needs distribution)\n // 3. container is an insertionPoint\n if (hasContent || (container.localName === insertionPointTag)) {\n if (ownerRoot) {\n // note, insertion point list update is handled after node\n // mutations are complete\n ownerRoot.update();\n }\n }\n let needsDist = this._nodeNeedsDistribution(container);\n if (needsDist) {\n container.shadyRoot.update();\n }\n // Return true when distribution will fully handle the composition\n // Note that if a content was being inserted that was wrapped by a node,\n // and the parent does not need distribution, return false to allow\n // the nodes to be added directly, after which children may be\n // distributed and composed into the wrapping node(s)\n return needsDist || (hasContent && !wrappedContent);\n },\n\n /* note: parent argument is required since node may have an out\n of date parent at this point; returns true if a is being added */\n _maybeAddInsertionPoint(node, parent, root) {\n let added;\n let insertionPointTag = root.getInsertionPointTag();\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n !node.__noInsertionPoint) {\n let c$ = node.querySelectorAll(insertionPointTag);\n for (let i=0, n, np, na; (i (host of container needs distribution)\n insertBefore(node, ref_node) {\n if (ref_node && tree.Logical.getParentNode(ref_node) !== this) {\n throw Error('The ref_node to be inserted before is not a child ' +\n 'of this node');\n }\n // remove node from its current position iff it's in a tree.\n if (node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {\n let parent = tree.Logical.getParentNode(node);\n mixinImpl.removeNodeFromParent(node, parent);\n }\n if (!mixinImpl.addNode(this, node, ref_node)) {\n if (ref_node) {\n // if ref_node is an insertion point replace with first distributed node\n let root = mixinImpl.ownerShadyRootForNode(ref_node);\n if (root) {\n ref_node = ref_node.localName === root.getInsertionPointTag() ?\n mixinImpl.firstComposedNode(ref_node) : ref_node;\n }\n }\n // if adding to a shadyRoot, add to host instead\n let container = utils.isShadyRoot(this) ?\n this.host : this;\n if (ref_node) {\n tree.Composed.insertBefore(container, node, ref_node);\n } else {\n tree.Composed.appendChild(container, node);\n }\n }\n mixinImpl._scheduleObserver(this, node);\n return node;\n },\n\n /**\n Removes the given `node` from the element's `lightChildren`.\n This method also performs dom composition.\n */\n removeChild(node) {\n if (tree.Logical.getParentNode(node) !== this) {\n throw Error('The node to be removed is not a child of this node: ' +\n node);\n }\n if (!mixinImpl.removeNode(node)) {\n // if removing from a shadyRoot, remove form host instead\n let container = utils.isShadyRoot(this) ?\n this.host :\n this;\n // not guaranteed to physically be in container; e.g.\n // undistributed nodes.\n let parent = tree.Composed.getParentNode(node);\n if (container === parent) {\n tree.Composed.removeChild(container, node);\n }\n }\n mixinImpl._scheduleObserver(this, null, node);\n return node;\n },\n\n replaceChild(node, ref_node) {\n this.insertBefore(node, ref_node);\n this.removeChild(ref_node);\n return node;\n },\n\n // TODO(sorvell): consider doing native QSA and filtering results.\n querySelector(selector) {\n // match selector and halt on first result.\n let result = mixinImpl.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n }, function(n) {\n return Boolean(n);\n })[0];\n return result || null;\n },\n\n querySelectorAll(selector) {\n return mixinImpl.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n });\n },\n\n cloneNode(deep) {\n if (this.localName == 'template') {\n return nativeCloneNode.call(this, deep);\n } else {\n let n = nativeCloneNode.call(this, false);\n if (deep) {\n let c$ = this.childNodes;\n for (let i=0, nc; i < c$.length; i++) {\n nc = c$[i].cloneNode(true);\n n.appendChild(nc);\n }\n }\n return n;\n }\n },\n\n importNode(externalNode, deep) {\n // for convenience use this node's ownerDoc if the node isn't a document\n let doc = this instanceof Document ? this :\n this.ownerDocument;\n let n = nativeImportNode.call(doc, externalNode, false);\n if (deep) {\n let c$ = tree.Logical.getChildNodes(externalNode);\n utils.common.patchNode(n);\n for (let i=0, nc; i < c$.length; i++) {\n nc = doc.importNode(c$[i], true);\n n.appendChild(nc);\n }\n }\n return n;\n }\n};\n\nObject.defineProperties(FragmentMixin, {\n\n childNodes: {\n get() {\n let c$ = tree.Logical.getChildNodes(this);\n return Array.isArray(c$) ? c$ : tree.arrayCopyChildNodes(this);\n },\n configurable: true\n },\n\n children: {\n get() {\n if (tree.Logical.hasChildNodes(this)) {\n return Array.prototype.filter.call(this.childNodes, function(n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n });\n } else {\n return tree.arrayCopyChildren(this);\n }\n },\n configurable: true\n },\n\n firstChild: {\n get() {\n return tree.Logical.getFirstChild(this);\n },\n configurable: true\n },\n\n lastChild: {\n get() {\n return tree.Logical.getLastChild(this);\n },\n configurable: true\n },\n\n firstElementChild: {\n get() {\n return tree.Logical.getFirstElementChild(this);\n },\n configurable: true\n },\n\n lastElementChild: {\n get() {\n return tree.Logical.getLastElementChild(this);\n },\n configurable: true\n },\n\n // TODO(srovell): strictly speaking fragments do not have textContent\n // or innerHTML but ShadowRoots do and are not easily distinguishable.\n // textContent / innerHTML\n textContent: {\n get() {\n if (this.childNodes) {\n let tc = [];\n for (let i = 0, cn = this.childNodes, c; (c = cn[i]); i++) {\n if (c.nodeType !== Node.COMMENT_NODE) {\n tc.push(c.textContent);\n }\n }\n return tc.join('');\n }\n return '';\n },\n set(text) {\n mixinImpl.clearNode(this);\n if (text) {\n this.appendChild(document.createTextNode(text));\n }\n },\n configurable: true\n },\n\n innerHTML: {\n get() {\n return getInnerHTML(this);\n },\n set(text) {\n mixinImpl.clearNode(this);\n let d = document.createElement('div');\n d.innerHTML = text;\n // here, appendChild may move nodes async so we cannot rely\n // on node position when copying\n let c$ = tree.arrayCopyChildNodes(d);\n for (let i=0; i < c$.length; i++) {\n this.appendChild(c$[i]);\n }\n },\n configurable: true\n }\n\n});\n\nlet ElementMixin = {\n\n // TODO(sorvell): should only exist on \n assignedNodes(options) {\n return (options && options.flatten ? this._distributedNodes :\n this._assignedNodes) || [];\n },\n\n\n setAttribute(name, value) {\n setAttribute.call(this, name, value);\n mixinImpl.maybeDistributeAttributeChange(this, name);\n },\n\n removeAttribute(name) {\n nativeRemoveAttribute.call(this, name);\n mixinImpl.maybeDistributeAttributeChange(this, name);\n }\n\n};\n\nObject.defineProperties(ElementMixin, {\n\n shadowRoot: {\n get() {\n return this.shadyRoot;\n }\n },\n\n slot: {\n get() {\n return this.getAttribute('slot');\n },\n set(value) {\n this.setAttribute('slot', value);\n }\n }\n\n});\n\nlet activeElementDescriptor = {\n get() {\n return mixinImpl.activeElementForNode(this);\n }\n}\n\nlet ActiveElementMixin = {};\nObject.defineProperties(ActiveElementMixin, {\n activeElement: activeElementDescriptor\n});\n\nlet UnderActiveElementMixin = {};\nObject.defineProperties(UnderActiveElementMixin, {\n _activeElement: activeElementDescriptor\n});\n\nexport let Mixins = {\n\n Node: utils.extendAll({__patched: 'Node'}, NodeMixin),\n\n Fragment: utils.extendAll({__patched: 'Fragment'},\n NodeMixin, FragmentMixin, ActiveElementMixin),\n\n Element: utils.extendAll({__patched: 'Element'},\n NodeMixin, FragmentMixin, ElementMixin, ActiveElementMixin),\n\n // Note: activeElement cannot be patched on document!\n Document: utils.extendAll({__patched: 'Document'},\n NodeMixin, FragmentMixin, ElementMixin, UnderActiveElementMixin)\n\n};\n\nexport let getRootNode = function(node) {\n return mixinImpl.getRootNode(node);\n}\n\nexport function filterMutations(mutations, target) {\n const targetRootNode = getRootNode(target);\n return mutations.filter(function(mutation) {\n const mutationInScope = (targetRootNode === getRootNode(mutation.target));\n if (mutationInScope && mutation.addedNodes) {\n let nodes = Array.from(mutation.addedNodes).filter(function(n) {\n return (targetRootNode === getRootNode(n));\n });\n Object.defineProperty(mutation, 'addedNodes', {\n value: nodes,\n configurable: true\n });\n }\n return mutationInScope &&\n (!mutation.addedNodes || mutation.addedNodes.length);\n });\n}\n\n// const promise = Promise.resolve();\n\nclass AsyncObserver {\n\n constructor() {\n this._scheduled = false;\n this.addedNodes = [];\n this.removedNodes = [];\n this.callbacks = new Set();\n }\n\n schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n utils.promish.then(() => {\n this.flush();\n });\n }\n }\n\n flush() {\n if (this._scheduled) {\n this._scheduled = false;\n let mutations = this.takeRecords();\n if (mutations.length) {\n this.callbacks.forEach(function(cb) {\n cb(mutations);\n });\n }\n }\n }\n\n takeRecords() {\n if (this.addedNodes.length || this.removedNodes.length) {\n let mutations = [{\n addedNodes: this.addedNodes,\n removedNodes: this.removedNodes\n }];\n this.addedNodes = [];\n this.removedNodes = [];\n return mutations;\n }\n return [];\n }\n\n}\n\n// TODO(sorvell): consider instead polyfilling MutationObserver\n// directly so that users do not have to fork their code.\n// Supporting the entire api may be challenging: e.g. filtering out\n// removed nodes in the wrong scope and seeing non-distributing\n// subtree child mutations.\nexport let observeChildren = function(node, callback) {\n utils.common.patchNode(node);\n if (!node.__dom.observer) {\n node.__dom.observer = new AsyncObserver();\n }\n node.__dom.observer.callbacks.add(callback);\n let observer = node.__dom.observer;\n return {\n _callback: callback,\n _observer: observer,\n _node: node,\n takeRecords() {\n return observer.takeRecords()\n }\n };\n}\n\nexport let unobserveChildren = function(handle) {\n let observer = handle && handle._observer;\n if (observer) {\n observer.callbacks.delete(handle._callback);\n if (!observer.callbacks.size) {\n handle._node.__dom.observer = null;\n }\n }\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\n'use strict';\nimport {tree} from './tree'\nimport * as utils from './utils'\nimport {Mixins} from './element-mixin'\n\nexport let patchedCount = 0;\n\nlet log = false;\n\nlet patchImpl = {\n\n canPatchNode: function(node) {\n switch (node) {\n case document.head:\n case document.documentElement:\n return false;\n default:\n return true;\n }\n },\n\n hasPrototypeDescriptors: Boolean(Object.getOwnPropertyDescriptor(\n window.Node.prototype, 'textContent')),\n\n patch: function(node) {\n patchedCount++;\n log && window.console.warn('patch node', node);\n if (this.hasPrototypeDescriptors) {\n utils.patchPrototype(node, this.mixinForObject(node));\n } else {\n window.console.warn('Patching instance rather than prototype', node);\n utils.extend(node, this.mixinForNode(node));\n }\n },\n\n mixinForObject: function(obj) {\n switch (obj.nodeType) {\n case Node.ELEMENT_NODE:\n return Mixins.Element;\n case Node.DOCUMENT_FRAGMENT_NODE:\n return Mixins.Fragment;\n case Node.DOCUMENT_NODE:\n return Mixins.Document;\n case Node.TEXT_NODE:\n case Node.COMMENT_NODE:\n return Mixins.Node;\n }\n },\n\n unpatch: function(obj) {\n if (obj.__sourceProto) {\n obj.__proto__ = obj.__sourceProto;\n\n }\n // TODO(sorvell): implement unpatching for non-proto patchable browsers\n }\n\n};\n\nexport function patchNode(node) {\n if (!utils.settings.inUse) {\n return;\n }\n if (!isNodePatched(node) && patchImpl.canPatchNode(node)) {\n tree.saveChildNodes(node);\n patchImpl.patch(node);\n }\n}\n\nexport function unpatchNode(node) {\n patchImpl.unpatch(node);\n}\n\nexport function isNodePatched(node) {\n return Boolean(node.__patched);\n}\n\n// TODO(sorvell): fake export\nutils.common.patchNode = patchNode;\nutils.common.isNodePatched = isNodePatched;","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport * as utils from './utils'\n\nlet origAddEventListener = Element.prototype.addEventListener;\nlet origRemoveEventListener = Element.prototype.removeEventListener;\n\n// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937\nlet alwaysComposed = {\n blur: true,\n focus: true,\n focusin: true,\n focusout: true,\n click: true,\n dblclick: true,\n mousedown: true,\n mouseenter: true,\n mouseleave: true,\n mousemove: true,\n mouseout: true,\n mouseover: true,\n mouseup: true,\n wheel: true,\n beforeinput: true,\n input: true,\n keydown: true,\n keyup: true,\n compositionstart: true,\n compositionupdate: true,\n compositionend: true,\n touchstart: true,\n touchend: true,\n touchmove: true,\n touchcancel: true,\n pointerover: true,\n pointerenter: true,\n pointerdown: true,\n pointermove: true,\n pointerup: true,\n pointercancel: true,\n pointerout: true,\n pointerleave: true,\n gotpointercapture: true,\n lostpointercapture: true,\n dragstart: true,\n drag: true,\n dragenter: true,\n dragleave: true,\n dragover: true,\n drop: true,\n dragend: true,\n DOMActivate: true,\n DOMFocusIn: true,\n DOMFocusOut: true,\n keypress: true\n};\n\nfunction pathComposer(startNode, composed) {\n let composedPath = [];\n let current = startNode;\n let startRoot = startNode === window ? window : startNode.getRootNode();\n while (current) {\n composedPath.push(current);\n if (current.assignedSlot) {\n current = current.assignedSlot;\n } else if (current.nodeType === Node.DOCUMENT_FRAGMENT_NODE && current.host && (composed || current !== startRoot)) {\n current = current.host;\n } else {\n current = current.parentNode;\n }\n }\n // event composedPath includes window when startNode's ownerRoot is document\n if (composedPath[composedPath.length - 1] === document) {\n composedPath.push(window);\n }\n return composedPath;\n}\n\nfunction retarget(refNode, path) {\n if (!utils.isShadyRoot) {\n return refNode;\n }\n // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n // shadow-including inclusive ancestor, return ANCESTOR.\n let refNodePath = pathComposer(refNode, true);\n let p$ = path;\n for (let i=0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n ancestor = p$[i];\n root = ancestor === window ? window : ancestor.getRootNode();\n if (root !== lastRoot) {\n rootIdx = refNodePath.indexOf(root);\n lastRoot = root;\n }\n if (!utils.isShadyRoot(root) || rootIdx > -1) {\n return ancestor;\n }\n }\n}\n\nlet EventMixin = {\n\n __patched: 'Event',\n\n get composed() {\n if (this.isTrusted && this.__composed === undefined) {\n this.__composed = alwaysComposed[this.type];\n }\n return this.__composed || false;\n },\n\n composedPath() {\n if (!this.__composedPath) {\n this.__composedPath = pathComposer(this.__target, this.composed);\n }\n return this.__composedPath;\n },\n\n get target() {\n return retarget(this.currentTarget, this.composedPath());\n },\n\n // http://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting\n get relatedTarget() {\n if (!this.__relatedTarget) {\n return null;\n }\n if (!this.__relatedTargetComposedPath) {\n this.__relatedTargetComposedPath = pathComposer(this.__relatedTarget, true);\n }\n // find the deepest node in relatedTarget composed path that is in the same root with the currentTarget\n return retarget(this.currentTarget, this.__relatedTargetComposedPath);\n },\n stopPropagation() {\n Event.prototype.stopPropagation.call(this);\n this.__propagationStopped = true;\n },\n stopImmediatePropagation() {\n Event.prototype.stopImmediatePropagation.call(this);\n this.__immediatePropagationStopped = true;\n this.__propagationStopped = true;\n }\n\n};\n\nfunction mixinComposedFlag(Base) {\n // NOTE: avoiding use of `class` here so that transpiled output does not\n // try to do `Base.call` with a dom construtor.\n let klazz = function(type, options) {\n let event = new Base(type, options);\n event.__composed = options && Boolean(options.composed);\n return event;\n }\n // put constructor properties on subclass\n utils.mixin(klazz, Base);\n klazz.prototype = Base.prototype;\n return klazz;\n}\n\nlet nonBubblingEventsToRetarget = {\n focus: true,\n blur: true\n};\n\nfunction fireHandlers(event, node, phase) {\n let hs = node.__handlers && node.__handlers[event.type] &&\n node.__handlers[event.type][phase];\n if (hs) {\n for (let i = 0, fn; (fn = hs[i]); i++) {\n fn.call(node, event);\n if (event.__immediatePropagationStopped) {\n return;\n }\n }\n }\n}\n\nfunction retargetNonBubblingEvent(e) {\n let path = e.composedPath();\n let node;\n // override `currentTarget` to let patched `target` calculate correctly\n Object.defineProperty(e, 'currentTarget', {\n get: function() {\n return node;\n },\n configurable: true\n });\n for (let i = path.length - 1; i >= 0; i--) {\n node = path[i];\n // capture phase fires all capture handlers\n fireHandlers(e, node, 'capture');\n if (e.__propagationStopped) {\n return;\n }\n }\n\n // set the event phase to `AT_TARGET` as in spec\n Object.defineProperty(e, 'eventPhase', {value: Event.AT_TARGET});\n\n // the event only needs to be fired when owner roots change when iterating the event path\n // keep track of the last seen owner root\n let lastFiredRoot;\n for (let i = 0; i < path.length; i++) {\n node = path[i];\n if (i === 0 || (node.shadowRoot && node.shadowRoot === lastFiredRoot)) {\n fireHandlers(e, node, 'bubble');\n // don't bother with window, it doesn't have `getRootNode` and will be last in the path anyway\n if (node !== window) {\n lastFiredRoot = node.getRootNode();\n }\n if (e.__propagationStopped) {\n return;\n }\n }\n }\n}\n\nexport function addEventListener(type, fn, optionsOrCapture) {\n if (!fn) {\n return;\n }\n\n // The callback `fn` might be used for multiple nodes/events. Since we generate\n // a wrapper function, we need to keep track of it when we remove the listener.\n // It's more efficient to store the node/type/options information as Array in\n // `fn` itself rather than the node (we assume that the same callback is used\n // for few nodes at most, whereas a node will likely have many event listeners).\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n if (fn.__eventWrappers) {\n // Stop if the wrapper function has already been created.\n for (let i = 0; i < fn.__eventWrappers.length; i++) {\n if (fn.__eventWrappers[i].node === this &&\n fn.__eventWrappers[i].type === type &&\n fn.__eventWrappers[i].capture === capture &&\n fn.__eventWrappers[i].once === once &&\n fn.__eventWrappers[i].passive === passive) {\n return;\n }\n }\n } else {\n fn.__eventWrappers = [];\n }\n\n const wrapperFn = function(e) {\n // Support `once` option.\n if (once) {\n this.removeEventListener(type, fn, optionsOrCapture);\n }\n if (!e.__target) {\n e.__target = e.target;\n e.__relatedTarget = e.relatedTarget;\n utils.patchPrototype(e, EventMixin);\n }\n // There are two critera that should stop events from firing on this node\n // 1. the event is not composed and the current node is not in the same root as the target\n // 2. when bubbling, if after retargeting, relatedTarget and target point to the same node\n if (e.composed || e.composedPath().indexOf(this) > -1) {\n if (e.eventPhase === Event.BUBBLING_PHASE) {\n if (e.target === e.relatedTarget) {\n e.stopImmediatePropagation();\n return;\n }\n }\n return fn(e);\n }\n };\n // Store the wrapper information.\n fn.__eventWrappers.push({\n node: this,\n type: type,\n capture: capture,\n once: once,\n passive: passive,\n wrapperFn: wrapperFn\n });\n\n if (nonBubblingEventsToRetarget[type]) {\n this.__handlers = this.__handlers || {};\n this.__handlers[type] = this.__handlers[type] || {capture: [], bubble: []};\n this.__handlers[type][capture ? 'capture' : 'bubble'].push(wrapperFn);\n } else {\n origAddEventListener.call(this, type, wrapperFn, optionsOrCapture);\n }\n}\n\nexport function removeEventListener(type, fn, optionsOrCapture) {\n if (!fn) {\n return;\n }\n\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n // Search the wrapped function.\n let wrapperFn = undefined;\n if (fn.__eventWrappers) {\n for (let i = 0; i < fn.__eventWrappers.length; i++) {\n if (fn.__eventWrappers[i].node === this &&\n fn.__eventWrappers[i].type === type &&\n fn.__eventWrappers[i].capture === capture &&\n fn.__eventWrappers[i].once === once &&\n fn.__eventWrappers[i].passive === passive) {\n wrapperFn = fn.__eventWrappers.splice(i, 1)[0].wrapperFn;\n // Cleanup.\n if (!fn.__eventWrappers.length) {\n fn.__eventWrappers = undefined;\n }\n break;\n }\n }\n }\n\n origRemoveEventListener.call(this, type, wrapperFn || fn, optionsOrCapture);\n if (wrapperFn && nonBubblingEventsToRetarget[type] &&\n this.__handlers && this.__handlers[type]) {\n const arr = this.__handlers[type][capture ? 'capture' : 'bubble'];\n const idx = arr.indexOf(wrapperFn);\n if (idx > -1) {\n arr.splice(idx, 1);\n }\n }\n}\n\nexport function activateFocusEventOverrides() {\n for (let ev in nonBubblingEventsToRetarget) {\n window.addEventListener(ev, function(e) {\n if (!e.__target) {\n e.__target = e.target;\n e.__relatedTarget = e.relatedTarget;\n utils.patchPrototype(e, EventMixin);\n retargetNonBubblingEvent(e);\n e.stopImmediatePropagation();\n }\n }, true);\n }\n}\n\nexport let OriginalEvent = Event;\nexport let PatchedEvent = mixinComposedFlag(Event);\nexport let PatchedCustomEvent = mixinComposedFlag(CustomEvent);\nexport let PatchedMouseEvent = mixinComposedFlag(MouseEvent);\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\n'use strict';\nimport * as utils from './utils'\nimport {ShadyRoot, flush, enqueue} from './shady'\nimport * as patch from './patch'\nimport {getRootNode, filterMutations, observeChildren, unobserveChildren,\n setAttribute} from './element-mixin'\nimport * as events from './event-mixin'\nimport {tree, getNativeProperty} from './tree'\n\nif (utils.settings.inUse) {\n\n window.ShadyDOM = {\n tree: tree,\n getNativeProperty: getNativeProperty,\n patch: patch.patchNode,\n isPatched: patch.isNodePatched,\n unpatch: patch.unpatchNode,\n isShadyRoot: utils.isShadyRoot,\n enqueue: enqueue,\n flush: flush,\n inUse: utils.settings.inUse,\n filterMutations: filterMutations,\n observeChildren: observeChildren,\n unobserveChildren: unobserveChildren\n };\n\n let createRootAndEnsurePatched = function(node) {\n // TODO(sorvell): need to ensure ancestors are patched but this introduces\n // a timing problem with gathering composed children.\n // (1) currently the child list is crawled and patched when patching occurs\n // (this needs to change)\n // (2) we can only patch when an element has received its parsed children\n // because we cannot detect them when inserted by parser.\n // let ancestor = node;\n // while (ancestor) {\n // patchNode(ancestor);\n // ancestor = ancestor.parentNode || ancestor.host;\n // }\n patch.patchNode(node);\n let root = new ShadyRoot(node);\n patch.patchNode(root);\n return root;\n }\n\n Element.prototype.attachShadow = function() {\n return createRootAndEnsurePatched(this);\n }\n\n Node.prototype.addEventListener = events.addEventListener;\n Node.prototype.removeEventListener = events.removeEventListener;\n Event = events.PatchedEvent;\n CustomEvent = events.PatchedCustomEvent;\n MouseEvent = events.PatchedMouseEvent;\n events.activateFocusEventOverrides();\n\n Object.defineProperty(Node.prototype, 'isConnected', {\n get() {\n return document.documentElement.contains(this);\n },\n configurable: true\n });\n\n Node.prototype.getRootNode = function(options) {\n return getRootNode(this, options);\n }\n\n Object.defineProperty(Element.prototype, 'slot', {\n get() {\n return this.getAttribute('slot');\n },\n set(value) {\n this.setAttribute('slot', value);\n },\n configurable: true\n });\n\n Object.defineProperty(Node.prototype, 'assignedSlot', {\n get() {\n return this._assignedSlot || null;\n },\n configurable: true\n });\n\n Element.prototype.setAttribute = setAttribute;\n\n Object.defineProperty(Element.prototype, 'className', {\n get() {\n return this.getAttribute('class');\n },\n set(value) {\n this.setAttribute('class', value);\n },\n configurable: true\n });\n\n // TODO(sorvell): super experimental auto patching of document fragment\n // via appendChild. This either needs to be expanded or contracted.\n // DocumentFragment.prototype.appendChild = function(node) {\n // patchNode(this);\n // return this.appendChild(node);\n // }\n\n}\n"],"names":["let","const","i","j","this","utils.common","p","parent","node","c","s","n","utils.extend","utils.promish","flush","utils.isShadyRoot","isShadyRoot","utils.matchesSelector","utils.extendAll","utils.patchPrototype","utils.settings","utils.mixin","patch.patchNode","patch.isNodePatched","patch.unpatchNode","events.addEventListener","events.removeEventListener","events.PatchedEvent","events.PatchedCustomEvent","events.PatchedMouseEvent","events.activateFocusEventOverrides"],"mappings":";;;AAAA;;;;;;;;;;AAUA,AAEA,AAAOA,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;;AAE5C,QAAQ,CAAC,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;;AAEpG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;;AAEhE,AAAO,SAAS,WAAW,CAAC,GAAG,EAAE;EAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,WAAW,C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,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE;IAC/C,GAAG,gBAAA,GAAG;MACJ,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;KAClC;IACD,GAAG,cAAA,CAAC,KAAK,EAAE;MACT,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAClC;IACD,YAAY,EAAE,IAAI;GACnB,CAAC,CAAC;;EAEH,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE;IACpD,GAAG,gBAAA,GAAG;MACJ,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC;KACnC;IACD,YAAY,EAAE,IAAI;GACnB,CAAC,CAAC;;EAEH,OAAO,CAAC,SAAS,CAAC,YAAY,GAAG,YAAY,CAAC;;EAE9C,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE;IACpD,GAAG,gBAAA,GAAG;MACJ,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;KACnC;IACD,GAAG,gBAAA,CAAC,KAAK,EAAE;MACT,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACnC;IACD,YAAY,EAAE,IAAI;GACnB,CAAC,CAAC;;;;;;;;;CASJ;;","sourceRoot":"/source/"} \ No newline at end of file diff --git a/src/element-mixin.js b/src/element-mixin.js index dbcf062..0c84ba1 100644 --- a/src/element-mixin.js +++ b/src/element-mixin.js @@ -22,7 +22,7 @@ let mixinImpl = { let ownerRoot = this.ownerShadyRootForNode(container); if (ownerRoot) { // optimization: special insertion point tracking - if (node.__noInsertionPoint) { + if (node.__noInsertionPoint && ownerRoot._clean) { ownerRoot._skipUpdateInsertionPoints = true; } // note: we always need to see if an insertion point is added @@ -33,7 +33,6 @@ let mixinImpl = { if (ipAdded) { ownerRoot._skipUpdateInsertionPoints = false; } - this._addedNode(node, ownerRoot); } if (tree.Logical.hasChildNodes(container)) { tree.Logical.recordInsertBefore(node, container, ref_node); @@ -66,9 +65,6 @@ let mixinImpl = { } } this._removeOwnerShadyRoot(node); - if (ownerRoot) { - this._removedNode(node, ownerRoot); - } return distributed; }, @@ -200,23 +196,6 @@ let mixinImpl = { node.shadyRoot.hasInsertionPoint(); }, - // TODO(sorvell): needed for style scoping, use MO? - _addedNode() {}, - _removedNode() {}, - /* - _addedNode(node, root) { - // if (ShadyDOM.addedNode) { - // ShadyDOM.addedNode(node, root); - // } - }, - - _removedNode(node, root) { - if (ShadyDOM.removedNode) { - ShadyDOM.removedNode(node, root); - } - }, - */ - _removeDistributedChildren(root, container) { let hostNeedsDist; let ip$ = root._insertionPoints; @@ -286,10 +265,11 @@ let mixinImpl = { }, maybeDistributeAttributeChange(node, name) { - let distribute = (node.localName === 'slot' && name === 'name'); - if (distribute) { - let root = this.getRootNode(node); - if (root.update) { + if (name === 'slot') { + this.maybeDistributeParent(node); + } else if (node.localName === 'slot' && name === 'name') { + let root = this.ownerShadyRootForNode(node); + if (root) { root.update(); } } @@ -371,6 +351,14 @@ let nativeImportNode = Document.prototype.importNode; let nativeSetAttribute = Element.prototype.setAttribute; let nativeRemoveAttribute = Element.prototype.removeAttribute; +export let setAttribute = function(attr, value) { + if (window.ShadyCSS && attr === 'class') { + window.ShadyCSS.setElementClass(this, value); + } else { + nativeSetAttribute.call(this, attr, value); + } +} + let NodeMixin = {}; Object.defineProperties(NodeMixin, { @@ -656,17 +644,13 @@ let ElementMixin = { setAttribute(name, value) { - nativeSetAttribute.call(this, name, value); - if (!mixinImpl.maybeDistributeParent(this)) { - mixinImpl.maybeDistributeAttributeChange(this, name); - } + setAttribute.call(this, name, value); + mixinImpl.maybeDistributeAttributeChange(this, name); }, removeAttribute(name) { nativeRemoveAttribute.call(this, name); - if (!mixinImpl.maybeDistributeParent(this)) { - mixinImpl.maybeDistributeAttributeChange(this, name); - } + mixinImpl.maybeDistributeAttributeChange(this, name); } }; diff --git a/src/env.js b/src/env.js index a28d67d..10a64e4 100644 --- a/src/env.js +++ b/src/env.js @@ -22,8 +22,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN import * as utils from './utils' import {ShadyRoot, flush, enqueue} from './shady' import * as patch from './patch' -import {getRootNode, filterMutations, observeChildren, unobserveChildren} - from './element-mixin' +import {getRootNode, filterMutations, observeChildren, unobserveChildren, + setAttribute} from './element-mixin' import * as events from './event-mixin' import {tree, getNativeProperty} from './tree' @@ -101,6 +101,18 @@ if (utils.settings.inUse) { configurable: true }); + Element.prototype.setAttribute = setAttribute; + + Object.defineProperty(Element.prototype, 'className', { + get() { + return this.getAttribute('class'); + }, + set(value) { + this.setAttribute('class', value); + }, + configurable: true + }); + // TODO(sorvell): super experimental auto patching of document fragment // via appendChild. This either needs to be expanded or contracted. // DocumentFragment.prototype.appendChild = function(node) {