1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update polymer

This commit is contained in:
Luke Pulverenti 2015-08-20 23:27:11 -04:00
parent ec5a50ea20
commit 6744d8dbe8
20 changed files with 152 additions and 131 deletions

View file

@ -1,13 +1,14 @@
{ {
"name": "polymer", "name": "polymer",
"version": "1.1.0", "version": "1.1.1",
"main": [ "main": [
"polymer.html" "polymer.html"
], ],
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"ignore": [ "ignore": [
"/.*", "/.*",
"/test/" "/test/",
"gen-changelog.sh"
], ],
"authors": [ "authors": [
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)" "The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
@ -24,11 +25,11 @@
}, },
"private": true, "private": true,
"homepage": "https://github.com/Polymer/polymer", "homepage": "https://github.com/Polymer/polymer",
"_release": "1.1.0", "_release": "1.1.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.0", "tag": "v1.1.1",
"commit": "67fb2f85fd66d8556fc07cf1dec41ff5273fa68a" "commit": "c0bd5a73b4bd694b7fa5ead01ff558ed542f6bd8"
}, },
"_source": "git://github.com/Polymer/polymer.git", "_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,13 +1,14 @@
{ {
"name": "polymer", "name": "polymer",
"version": "1.1.0", "version": "1.1.1",
"main": [ "main": [
"polymer.html" "polymer.html"
], ],
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"ignore": [ "ignore": [
"/.*", "/.*",
"/test/" "/test/",
"gen-changelog.sh"
], ],
"authors": [ "authors": [
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)" "The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"

View file

@ -217,6 +217,9 @@ Polymer.telemetry.instanceCount = 0;
(function () { (function () {
var modules = {}; var modules = {};
var lcModules = {}; var lcModules = {};
var findModule = function (id) {
return modules[id] || lcModules[id.toLowerCase()];
};
var DomModule = function () { var DomModule = function () {
return document.createElement('dom-module'); return document.createElement('dom-module');
}; };
@ -235,10 +238,10 @@ lcModules[id.toLowerCase()] = this;
} }
}, },
import: function (id, selector) { import: function (id, selector) {
var m = modules[id] || lcModules[id.toLowerCase()]; var m = findModule(id);
if (!m) { if (!m) {
forceDocumentUpgrade(); forceDocumentUpgrade();
m = modules[id]; m = findModule(id);
} }
if (m && selector) { if (m && selector) {
m = m.querySelector(selector); m = m.querySelector(selector);
@ -558,7 +561,7 @@ debouncer.stop();
} }
} }
}); });
Polymer.version = '1.1.0'; Polymer.version = '1.1.1';
Polymer.Base._addFeature({ Polymer.Base._addFeature({
_registerFeatures: function () { _registerFeatures: function () {
this._prepIs(); this._prepIs();

View file

@ -457,47 +457,43 @@ Polymer.dom.addDebouncer(host.debounce('_distribute', host._distributeContent));
} }
}, },
appendChild: function (node) { appendChild: function (node) {
var handled; return this._addNode(node);
this._ensureContentLogicalInfo(node);
this._removeNodeFromHost(node, true);
if (this._nodeIsInLogicalTree(this.node)) {
this._addLogicalInfo(node, this.node);
this._addNodeToHost(node);
handled = this._maybeDistribute(node, this.node);
} else {
this._addNodeToHost(node);
}
if (!handled && !this._tryRemoveUndistributedNode(node)) {
var container = this.node._isShadyRoot ? this.node.host : this.node;
addToComposedParent(container, node);
nativeAppendChild.call(container, node);
}
return node;
}, },
insertBefore: function (node, ref_node) { insertBefore: function (node, ref_node) {
if (!ref_node) { return this._addNode(node, ref_node);
return this.appendChild(node); },
} _addNode: function (node, ref_node) {
var handled;
this._ensureContentLogicalInfo(node);
this._removeNodeFromHost(node, true); this._removeNodeFromHost(node, true);
if (this._nodeIsInLogicalTree(this.node)) { var addedInsertionPoint;
var root = this.getOwnerRoot();
if (root) {
addedInsertionPoint = this._maybeAddInsertionPoint(node, this.node);
}
if (this._nodeHasLogicalChildren(this.node)) {
if (ref_node) {
var children = this.childNodes; var children = this.childNodes;
var index = children.indexOf(ref_node); var index = children.indexOf(ref_node);
if (index < 0) { if (index < 0) {
throw Error('The ref_node to be inserted before is not a child ' + 'of this node'); throw Error('The ref_node to be inserted before is not a child ' + 'of this node');
} }
this._addLogicalInfo(node, this.node, index);
this._addNodeToHost(node);
handled = this._maybeDistribute(node, this.node);
} else {
this._addNodeToHost(node);
} }
if (!handled && !this._tryRemoveUndistributedNode(node)) { this._addLogicalInfo(node, this.node, index);
}
this._addNodeToHost(node);
if (!this._maybeDistribute(node, this.node) && !this._tryRemoveUndistributedNode(node)) {
if (ref_node) {
ref_node = ref_node.localName === CONTENT ? this._firstComposedNode(ref_node) : ref_node; ref_node = ref_node.localName === CONTENT ? this._firstComposedNode(ref_node) : ref_node;
}
var container = this.node._isShadyRoot ? this.node.host : this.node; var container = this.node._isShadyRoot ? this.node.host : this.node;
addToComposedParent(container, node, ref_node); addToComposedParent(container, node, ref_node);
if (ref_node) {
nativeInsertBefore.call(container, node, ref_node); nativeInsertBefore.call(container, node, ref_node);
} else {
nativeAppendChild.call(container, node);
}
}
if (addedInsertionPoint) {
this._updateInsertionPoints(root.host);
} }
return node; return node;
}, },
@ -505,14 +501,8 @@ removeChild: function (node) {
if (factory(node).parentNode !== this.node) { if (factory(node).parentNode !== this.node) {
console.warn('The node to be removed is not a child of this node', node); console.warn('The node to be removed is not a child of this node', node);
} }
var handled;
if (this._nodeIsInLogicalTree(this.node)) {
this._removeNodeFromHost(node); this._removeNodeFromHost(node);
handled = this._maybeDistribute(node, this.node); if (!this._maybeDistribute(node, this.node)) {
} else {
this._removeNodeFromHost(node);
}
if (!handled) {
var container = this.node._isShadyRoot ? this.node.host : this.node; var container = this.node._isShadyRoot ? this.node.host : this.node;
if (container === node.parentNode) { if (container === node.parentNode) {
removeFromComposedParent(container, node); removeFromComposedParent(container, node);
@ -560,7 +550,6 @@ if (hasContent) {
var root = this._ownerShadyRootForNode(parent); var root = this._ownerShadyRootForNode(parent);
if (root) { if (root) {
var host = root.host; var host = root.host;
this._updateInsertionPoints(host);
this._lazyDistribute(host); this._lazyDistribute(host);
} }
} }
@ -570,6 +559,25 @@ this._lazyDistribute(parent);
} }
return parentNeedsDist || hasContent && !wrappedContent; return parentNeedsDist || hasContent && !wrappedContent;
}, },
_maybeAddInsertionPoint: function (node, parent) {
var added;
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && !node.__noContent) {
var c$ = factory(node).querySelectorAll(CONTENT);
for (var i = 0, n, np, na; i < c$.length && (n = c$[i]); i++) {
np = factory(n).parentNode;
if (np === node) {
np = parent;
}
na = this._maybeAddInsertionPoint(n, np);
added = added || na;
}
} else if (node.localName === CONTENT) {
saveLightChildrenIfNeeded(parent);
saveLightChildrenIfNeeded(node);
added = true;
}
return added;
},
_tryRemoveUndistributedNode: function (node) { _tryRemoveUndistributedNode: function (node) {
if (this.node.shadyRoot) { if (this.node.shadyRoot) {
if (node._composedParent) { if (node._composedParent) {
@ -586,20 +594,8 @@ saveLightChildrenIfNeeded(c);
saveLightChildrenIfNeeded(factory(c).parentNode); saveLightChildrenIfNeeded(factory(c).parentNode);
} }
}, },
_nodeIsInLogicalTree: function (node) { _nodeHasLogicalChildren: function (node) {
return Boolean(node._lightParent !== undefined || node._isShadyRoot || node.shadyRoot); return Boolean(node._lightChildren !== undefined);
},
_ensureContentLogicalInfo: function (node) {
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
saveLightChildrenIfNeeded(this.node);
var c$ = Array.prototype.slice.call(node.childNodes);
for (var i = 0, n; i < c$.length && (n = c$[i]); i++) {
this._ensureContentLogicalInfo(n);
}
} else if (node.localName === CONTENT) {
saveLightChildrenIfNeeded(this.node);
saveLightChildrenIfNeeded(node);
}
}, },
_parentNeedsDistribution: function (parent) { _parentNeedsDistribution: function (parent) {
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot); return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
@ -609,6 +605,7 @@ var hostNeedsDist;
var root; var root;
var parent = node._lightParent; var parent = node._lightParent;
if (parent) { if (parent) {
factory(node)._distributeParent();
root = this._ownerShadyRootForNode(node); root = this._ownerShadyRootForNode(node);
if (root) { if (root) {
root.host._elementRemove(node); root.host._elementRemove(node);
@ -621,7 +618,7 @@ if (root && hostNeedsDist) {
this._updateInsertionPoints(root.host); this._updateInsertionPoints(root.host);
this._lazyDistribute(root.host); this._lazyDistribute(root.host);
} else if (ensureComposedRemoval) { } else if (ensureComposedRemoval) {
removeFromComposedParent(parent || node.parentNode, node); removeFromComposedParent(node._composedParent, node);
} }
}, },
_removeDistributedChildren: function (root, container) { _removeDistributedChildren: function (root, container) {
@ -1147,7 +1144,7 @@ node._lightChildren = c$;
} }
} }
function hasInsertionPoint(root) { function hasInsertionPoint(root) {
return Boolean(root._insertionPoints.length); return Boolean(root && root._insertionPoints.length);
} }
var p = Element.prototype; var p = Element.prototype;
var matchesSelector = p.matches || p.matchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector; var matchesSelector = p.matches || p.matchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector;

View file

@ -637,8 +637,7 @@ prevent = dy > dx;
prevent = dx > dy; prevent = dx > dy;
} }
if (prevent) { if (prevent) {
// This prevents horizontal scrolling in safari ev.preventDefault();
//ev.preventDefault();
} else { } else {
Gestures.prevent('track'); Gestures.prevent('track');
} }
@ -1657,6 +1656,9 @@ name: arg,
model: this._modelForPath(arg) model: this._modelForPath(arg)
}; };
var fc = arg[0]; var fc = arg[0];
if (fc === '-') {
fc = arg[1];
}
if (fc >= '0' && fc <= '9') { if (fc >= '0' && fc <= '9') {
fc = '#'; fc = '#';
} }
@ -2277,30 +2279,24 @@ return m && m._cssText || '';
_cssFromElement: function (element) { _cssFromElement: function (element) {
var cssText = ''; var cssText = '';
var content = element.content || element; var content = element.content || element;
var sourceDoc = element.ownerDocument;
var e$ = Array.prototype.slice.call(content.querySelectorAll(this.MODULE_STYLES_SELECTOR)); var e$ = Array.prototype.slice.call(content.querySelectorAll(this.MODULE_STYLES_SELECTOR));
for (var i = 0, e, resolveDoc, addModule; i < e$.length; i++) { for (var i = 0, e; i < e$.length; i++) {
e = e$[i]; e = e$[i];
resolveDoc = sourceDoc;
addModule = null;
if (e.localName === 'template') { if (e.localName === 'template') {
cssText += this._cssFromElement(e); cssText += this._cssFromElement(e);
} else { } else {
if (e.localName === 'style') { if (e.localName === 'style') {
addModule = e.getAttribute(this.INCLUDE_ATTR); var include = e.getAttribute(this.INCLUDE_ATTR);
e = e.__appliedElement || e; e = e.__appliedElement || e;
e.parentNode.removeChild(e); e.parentNode.removeChild(e);
} else { cssText += this.resolveCss(e.textContent, element.ownerDocument);
e = e.import && e.import.body; if (include) {
resolveDoc = e.ownerDocument; cssText += this.cssFromModules(include);
} }
if (e) { } else if (e.import && e.import.body) {
cssText += this.resolveCss(e.textContent, resolveDoc); cssText += this.resolveCss(e.import.body.textContent, e.import);
} }
} }
if (addModule) {
cssText += this.cssFromModules(addModule);
}
} }
return cssText; return cssText;
}, },
@ -3235,16 +3231,18 @@ var e = this.__appliedElement || this;
if (this.include) { if (this.include) {
e.textContent += styleUtil.cssFromModules(this.include); e.textContent += styleUtil.cssFromModules(this.include);
} }
var rules = styleUtil.rulesForStyle(e);
styleUtil.forEachStyleRule(rules, function (rule) {
styleTransformer.documentRule(rule);
});
this._computeStyleProperties(); this._computeStyleProperties();
var props = this._styleProperties; var props = this._styleProperties;
var self = this; e.textContent = styleUtil.toCssText(rules, function (rule) {
e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), function (rule) {
var css = rule.cssText = rule.parsedCssText; var css = rule.cssText = rule.parsedCssText;
if (rule.propertyInfo && rule.propertyInfo.cssText) { if (rule.propertyInfo && rule.propertyInfo.cssText) {
css = cssParse.removeCustomPropAssignment(css); css = cssParse.removeCustomPropAssignment(css);
rule.cssText = propertyUtils.valueForProperties(css, props); rule.cssText = propertyUtils.valueForProperties(css, props);
} }
styleTransformer.documentRule(rule);
}); });
} }
}); });
@ -3800,6 +3798,9 @@ this._instances.splice(keys.length, this._instances.length - keys.length);
_keySort: function (a, b) { _keySort: function (a, b) {
return this.collection.getKey(a) - this.collection.getKey(b); return this.collection.getKey(a) - this.collection.getKey(b);
}, },
_numericSort: function (a, b) {
return a - b;
},
_applySplicesUserSort: function (splices) { _applySplicesUserSort: function (splices) {
var c = this.collection; var c = this.collection;
var instances = this._instances; var instances = this._instances;
@ -3827,7 +3828,7 @@ addedKeys.push(key);
} }
} }
if (removedIdxs.length) { if (removedIdxs.length) {
removedIdxs.sort(); removedIdxs.sort(this._numericSort);
for (var i = removedIdxs.length - 1; i >= 0; i--) { for (var i = removedIdxs.length - 1; i >= 0; i--) {
var idx = removedIdxs[i]; var idx = removedIdxs[i];
if (idx !== undefined) { if (idx !== undefined) {
@ -4010,6 +4011,10 @@ selected: {
type: Object, type: Object,
notify: true notify: true
}, },
selectedItem: {
type: Object,
notify: true
},
toggle: { toggle: {
type: Boolean, type: Boolean,
value: false value: false
@ -4032,6 +4037,7 @@ this._selectedColl = Polymer.Collection.get(this.selected);
this.selected = null; this.selected = null;
this._selectedColl = null; this._selectedColl = null;
} }
this.selectedItem = null;
}, },
isSelected: function (item) { isSelected: function (item) {
if (this.multi) { if (this.multi) {
@ -4049,7 +4055,9 @@ this.unlinkPaths('selected.' + skey);
} }
} else { } else {
this.selected = null; this.selected = null;
this.selectedItem = null;
this.unlinkPaths('selected'); this.unlinkPaths('selected');
this.unlinkPaths('selectedItem');
} }
}, },
select: function (item) { select: function (item) {
@ -4069,8 +4077,10 @@ this.linkPaths('selected.' + skey, 'items.' + key);
if (this.toggle && item == this.selected) { if (this.toggle && item == this.selected) {
this.deselect(); this.deselect();
} else { } else {
this.linkPaths('selected', 'items.' + key);
this.selected = item; this.selected = item;
this.selectedItem = item;
this.linkPaths('selected', 'items.' + key);
this.linkPaths('selectedItem', 'items.' + key);
} }
} }
} }

View file

@ -1,7 +1,7 @@
{ {
"name": "webcomponentsjs", "name": "webcomponentsjs",
"main": "webcomponents.js", "main": "webcomponents.js",
"version": "0.7.11", "version": "0.7.12",
"homepage": "http://webcomponents.org", "homepage": "http://webcomponents.org",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -15,11 +15,11 @@
], ],
"license": "BSD", "license": "BSD",
"ignore": [], "ignore": [],
"_release": "0.7.11", "_release": "0.7.12",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.7.11", "tag": "v0.7.12",
"commit": "ce6321507de6161ec52b43f82a6c36eda614d750" "commit": "044234d00f966292390d02cbe88184861e673cc7"
}, },
"_source": "git://github.com/Polymer/webcomponentsjs.git", "_source": "git://github.com/Polymer/webcomponentsjs.git",
"_target": "^0.7.2", "_target": "^0.7.2",

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -341,7 +341,7 @@ if (typeof WeakMap === "undefined") {
}; };
global.JsMutationObserver = JsMutationObserver; global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver; if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
})(this); })(window);
window.CustomElements = window.CustomElements || { window.CustomElements = window.CustomElements || {
flags: {} flags: {}
@ -361,6 +361,7 @@ window.CustomElements = window.CustomElements || {
scope.addModule = addModule; scope.addModule = addModule;
scope.initializeModules = initializeModules; scope.initializeModules = initializeModules;
scope.hasNative = Boolean(document.registerElement); scope.hasNative = Boolean(document.registerElement);
scope.isIE = /Trident/.test(navigator.userAgent);
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
})(window.CustomElements); })(window.CustomElements);
@ -669,7 +670,7 @@ window.CustomElements.addModule(function(scope) {
}); });
window.CustomElements.addModule(function(scope) { window.CustomElements.addModule(function(scope) {
var isIE11OrOlder = scope.isIE11OrOlder; var isIE = scope.isIE;
var upgradeDocumentTree = scope.upgradeDocumentTree; var upgradeDocumentTree = scope.upgradeDocumentTree;
var upgradeAll = scope.upgradeAll; var upgradeAll = scope.upgradeAll;
var upgradeWithDefinition = scope.upgradeWithDefinition; var upgradeWithDefinition = scope.upgradeWithDefinition;
@ -865,7 +866,7 @@ window.CustomElements.addModule(function(scope) {
} }
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
wrapDomMethodToForceUpgrade(document, "importNode"); wrapDomMethodToForceUpgrade(document, "importNode");
if (isIE11OrOlder) { if (isIE) {
(function() { (function() {
var importNode = document.importNode; var importNode = document.importNode;
document.importNode = function() { document.importNode = function() {
@ -893,7 +894,7 @@ window.CustomElements.addModule(function(scope) {
(function(scope) { (function(scope) {
var useNative = scope.useNative; var useNative = scope.useNative;
var initializeModules = scope.initializeModules; var initializeModules = scope.initializeModules;
var isIE11OrOlder = /Trident/.test(navigator.userAgent); var isIE = scope.isIE;
if (useNative) { if (useNative) {
var nop = function() {}; var nop = function() {};
scope.watchShadow = nop; scope.watchShadow = nop;
@ -930,6 +931,9 @@ window.CustomElements.addModule(function(scope) {
function bootstrap() { function bootstrap() {
upgradeDocumentTree(window.wrap(document)); upgradeDocumentTree(window.wrap(document));
window.CustomElements.ready = true; window.CustomElements.ready = true;
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
setTimeout(f, 16);
};
requestAnimationFrame(function() { requestAnimationFrame(function() {
setTimeout(function() { setTimeout(function() {
window.CustomElements.readyTime = Date.now(); window.CustomElements.readyTime = Date.now();
@ -942,7 +946,7 @@ window.CustomElements.addModule(function(scope) {
}); });
}); });
} }
if (isIE11OrOlder && typeof window.CustomEvent !== "function") { if (isIE && typeof window.CustomEvent !== "function") {
window.CustomEvent = function(inType, params) { window.CustomEvent = function(inType, params) {
params = params || {}; params = params || {};
var e = document.createEvent("CustomEvent"); var e = document.createEvent("CustomEvent");
@ -966,5 +970,4 @@ window.CustomElements.addModule(function(scope) {
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
window.addEventListener(loadEvent, bootstrap); window.addEventListener(loadEvent, bootstrap);
} }
scope.isIE11OrOlder = isIE11OrOlder;
})(window.CustomElements); })(window.CustomElements);

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -341,7 +341,7 @@ if (typeof WeakMap === "undefined") {
}; };
global.JsMutationObserver = JsMutationObserver; global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver; if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
})(this); })(window);
window.HTMLImports = window.HTMLImports || { window.HTMLImports = window.HTMLImports || {
flags: {} flags: {}

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -341,4 +341,4 @@ if (typeof WeakMap === "undefined") {
}; };
global.JsMutationObserver = JsMutationObserver; global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver; if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
})(this); })(window);

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -1745,8 +1745,8 @@ window.ShadowDOMPolyfill = {};
var originalInsertBefore = OriginalNode.prototype.insertBefore; var originalInsertBefore = OriginalNode.prototype.insertBefore;
var originalRemoveChild = OriginalNode.prototype.removeChild; var originalRemoveChild = OriginalNode.prototype.removeChild;
var originalReplaceChild = OriginalNode.prototype.replaceChild; var originalReplaceChild = OriginalNode.prototype.replaceChild;
var isIe = /Trident|Edge/.test(navigator.userAgent); var isIEOrEdge = /Trident|Edge/.test(navigator.userAgent);
var removeChildOriginalHelper = isIe ? function(parent, child) { var removeChildOriginalHelper = isIEOrEdge ? function(parent, child) {
try { try {
originalRemoveChild.call(parent, child); originalRemoveChild.call(parent, child);
} catch (ex) { } catch (ex) {

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"name": "webcomponentsjs", "name": "webcomponentsjs",
"main": "webcomponents.js", "main": "webcomponents.js",
"version": "0.7.11", "version": "0.7.12",
"homepage": "http://webcomponents.org", "homepage": "http://webcomponents.org",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"

View file

@ -1,6 +1,6 @@
{ {
"name": "webcomponents.js", "name": "webcomponents.js",
"version": "0.7.11", "version": "0.7.12",
"description": "webcomponents.js", "description": "webcomponents.js",
"main": "webcomponents.js", "main": "webcomponents.js",
"directories": { "directories": {

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
window.WebComponents = window.WebComponents || {}; window.WebComponents = window.WebComponents || {};
(function(scope) { (function(scope) {
@ -909,7 +909,7 @@ if (typeof WeakMap === "undefined") {
}; };
global.JsMutationObserver = JsMutationObserver; global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver; if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
})(this); })(window);
window.HTMLImports = window.HTMLImports || { window.HTMLImports = window.HTMLImports || {
flags: {} flags: {}
@ -1675,6 +1675,7 @@ window.CustomElements = window.CustomElements || {
scope.addModule = addModule; scope.addModule = addModule;
scope.initializeModules = initializeModules; scope.initializeModules = initializeModules;
scope.hasNative = Boolean(document.registerElement); scope.hasNative = Boolean(document.registerElement);
scope.isIE = /Trident/.test(navigator.userAgent);
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
})(window.CustomElements); })(window.CustomElements);
@ -1983,7 +1984,7 @@ window.CustomElements.addModule(function(scope) {
}); });
window.CustomElements.addModule(function(scope) { window.CustomElements.addModule(function(scope) {
var isIE11OrOlder = scope.isIE11OrOlder; var isIE = scope.isIE;
var upgradeDocumentTree = scope.upgradeDocumentTree; var upgradeDocumentTree = scope.upgradeDocumentTree;
var upgradeAll = scope.upgradeAll; var upgradeAll = scope.upgradeAll;
var upgradeWithDefinition = scope.upgradeWithDefinition; var upgradeWithDefinition = scope.upgradeWithDefinition;
@ -2179,7 +2180,7 @@ window.CustomElements.addModule(function(scope) {
} }
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
wrapDomMethodToForceUpgrade(document, "importNode"); wrapDomMethodToForceUpgrade(document, "importNode");
if (isIE11OrOlder) { if (isIE) {
(function() { (function() {
var importNode = document.importNode; var importNode = document.importNode;
document.importNode = function() { document.importNode = function() {
@ -2207,7 +2208,7 @@ window.CustomElements.addModule(function(scope) {
(function(scope) { (function(scope) {
var useNative = scope.useNative; var useNative = scope.useNative;
var initializeModules = scope.initializeModules; var initializeModules = scope.initializeModules;
var isIE11OrOlder = /Trident/.test(navigator.userAgent); var isIE = scope.isIE;
if (useNative) { if (useNative) {
var nop = function() {}; var nop = function() {};
scope.watchShadow = nop; scope.watchShadow = nop;
@ -2244,6 +2245,9 @@ window.CustomElements.addModule(function(scope) {
function bootstrap() { function bootstrap() {
upgradeDocumentTree(window.wrap(document)); upgradeDocumentTree(window.wrap(document));
window.CustomElements.ready = true; window.CustomElements.ready = true;
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
setTimeout(f, 16);
};
requestAnimationFrame(function() { requestAnimationFrame(function() {
setTimeout(function() { setTimeout(function() {
window.CustomElements.readyTime = Date.now(); window.CustomElements.readyTime = Date.now();
@ -2256,7 +2260,7 @@ window.CustomElements.addModule(function(scope) {
}); });
}); });
} }
if (isIE11OrOlder && typeof window.CustomEvent !== "function") { if (isIE && typeof window.CustomEvent !== "function") {
window.CustomEvent = function(inType, params) { window.CustomEvent = function(inType, params) {
params = params || {}; params = params || {};
var e = document.createEvent("CustomEvent"); var e = document.createEvent("CustomEvent");
@ -2280,7 +2284,6 @@ window.CustomElements.addModule(function(scope) {
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
window.addEventListener(loadEvent, bootstrap); window.addEventListener(loadEvent, bootstrap);
} }
scope.isIE11OrOlder = isIE11OrOlder;
})(window.CustomElements); })(window.CustomElements);
if (typeof HTMLTemplateElement === "undefined") { if (typeof HTMLTemplateElement === "undefined") {

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also * Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/ */
// @version 0.7.11 // @version 0.7.12
window.WebComponents = window.WebComponents || {}; window.WebComponents = window.WebComponents || {};
(function(scope) { (function(scope) {
@ -1781,8 +1781,8 @@ if (WebComponents.flags.shadow) {
var originalInsertBefore = OriginalNode.prototype.insertBefore; var originalInsertBefore = OriginalNode.prototype.insertBefore;
var originalRemoveChild = OriginalNode.prototype.removeChild; var originalRemoveChild = OriginalNode.prototype.removeChild;
var originalReplaceChild = OriginalNode.prototype.replaceChild; var originalReplaceChild = OriginalNode.prototype.replaceChild;
var isIe = /Trident|Edge/.test(navigator.userAgent); var isIEOrEdge = /Trident|Edge/.test(navigator.userAgent);
var removeChildOriginalHelper = isIe ? function(parent, child) { var removeChildOriginalHelper = isIEOrEdge ? function(parent, child) {
try { try {
originalRemoveChild.call(parent, child); originalRemoveChild.call(parent, child);
} catch (ex) { } catch (ex) {
@ -5678,7 +5678,7 @@ if (WebComponents.flags.shadow) {
}; };
global.JsMutationObserver = JsMutationObserver; global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver; if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
})(this); })(window);
window.HTMLImports = window.HTMLImports || { window.HTMLImports = window.HTMLImports || {
flags: {} flags: {}
@ -6444,6 +6444,7 @@ window.CustomElements = window.CustomElements || {
scope.addModule = addModule; scope.addModule = addModule;
scope.initializeModules = initializeModules; scope.initializeModules = initializeModules;
scope.hasNative = Boolean(document.registerElement); scope.hasNative = Boolean(document.registerElement);
scope.isIE = /Trident/.test(navigator.userAgent);
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
})(window.CustomElements); })(window.CustomElements);
@ -6752,7 +6753,7 @@ window.CustomElements.addModule(function(scope) {
}); });
window.CustomElements.addModule(function(scope) { window.CustomElements.addModule(function(scope) {
var isIE11OrOlder = scope.isIE11OrOlder; var isIE = scope.isIE;
var upgradeDocumentTree = scope.upgradeDocumentTree; var upgradeDocumentTree = scope.upgradeDocumentTree;
var upgradeAll = scope.upgradeAll; var upgradeAll = scope.upgradeAll;
var upgradeWithDefinition = scope.upgradeWithDefinition; var upgradeWithDefinition = scope.upgradeWithDefinition;
@ -6948,7 +6949,7 @@ window.CustomElements.addModule(function(scope) {
} }
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
wrapDomMethodToForceUpgrade(document, "importNode"); wrapDomMethodToForceUpgrade(document, "importNode");
if (isIE11OrOlder) { if (isIE) {
(function() { (function() {
var importNode = document.importNode; var importNode = document.importNode;
document.importNode = function() { document.importNode = function() {
@ -6976,7 +6977,7 @@ window.CustomElements.addModule(function(scope) {
(function(scope) { (function(scope) {
var useNative = scope.useNative; var useNative = scope.useNative;
var initializeModules = scope.initializeModules; var initializeModules = scope.initializeModules;
var isIE11OrOlder = /Trident/.test(navigator.userAgent); var isIE = scope.isIE;
if (useNative) { if (useNative) {
var nop = function() {}; var nop = function() {};
scope.watchShadow = nop; scope.watchShadow = nop;
@ -7013,6 +7014,9 @@ window.CustomElements.addModule(function(scope) {
function bootstrap() { function bootstrap() {
upgradeDocumentTree(window.wrap(document)); upgradeDocumentTree(window.wrap(document));
window.CustomElements.ready = true; window.CustomElements.ready = true;
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
setTimeout(f, 16);
};
requestAnimationFrame(function() { requestAnimationFrame(function() {
setTimeout(function() { setTimeout(function() {
window.CustomElements.readyTime = Date.now(); window.CustomElements.readyTime = Date.now();
@ -7025,7 +7029,7 @@ window.CustomElements.addModule(function(scope) {
}); });
}); });
} }
if (isIE11OrOlder && typeof window.CustomEvent !== "function") { if (isIE && typeof window.CustomEvent !== "function") {
window.CustomEvent = function(inType, params) { window.CustomEvent = function(inType, params) {
params = params || {}; params = params || {};
var e = document.createEvent("CustomEvent"); var e = document.createEvent("CustomEvent");
@ -7049,7 +7053,6 @@ window.CustomElements.addModule(function(scope) {
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
window.addEventListener(loadEvent, bootstrap); window.addEventListener(loadEvent, bootstrap);
} }
scope.isIE11OrOlder = isIE11OrOlder;
})(window.CustomElements); })(window.CustomElements);
(function(scope) { (function(scope) {

File diff suppressed because one or more lines are too long