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

update webcomponents.js

This commit is contained in:
Luke Pulverenti 2016-02-19 00:07:26 -05:00
parent cd06587514
commit 068f90a11f
15 changed files with 114 additions and 49 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "webcomponentsjs", "name": "webcomponentsjs",
"main": "webcomponents.js", "main": "webcomponents.js",
"version": "0.7.20", "version": "0.7.21",
"homepage": "http://webcomponents.org", "homepage": "http://webcomponents.org",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -18,11 +18,11 @@
"devDependencies": { "devDependencies": {
"web-component-tester": "^4.0.1" "web-component-tester": "^4.0.1"
}, },
"_release": "0.7.20", "_release": "0.7.21",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.7.20", "tag": "v0.7.21",
"commit": "ce9c8597696ec4bafc772c2126a3b1c7b0e948c0" "commit": "19ffcd921e1aef84b55f515b00eb56e8e9116126"
}, },
"_source": "git://github.com/Polymer/webcomponentsjs.git", "_source": "git://github.com/Polymer/webcomponentsjs.git",
"_target": "^0.7.20", "_target": "^0.7.20",

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.20 // @version 0.7.21
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;

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.20 // @version 0.7.21
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -948,7 +948,7 @@ window.HTMLImports.addModule(function(scope) {
if (doc && this._mayParse.indexOf(doc) < 0) { if (doc && this._mayParse.indexOf(doc) < 0) {
this._mayParse.push(doc); this._mayParse.push(doc);
var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) { for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
if (!this.isParsed(n)) { if (!this.isParsed(n)) {
if (this.hasResource(n)) { if (this.hasResource(n)) {
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;

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.20 // @version 0.7.21
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;

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.20 // @version 0.7.21
if (typeof WeakMap === "undefined") { if (typeof WeakMap === "undefined") {
(function() { (function() {
var defineProperty = Object.defineProperty; var defineProperty = Object.defineProperty;
@ -3411,10 +3411,7 @@ window.ShadowDOMPolyfill = {};
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement; var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null; if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
var activeElement = wrap(unwrappedActiveElement); var activeElement = wrap(unwrappedActiveElement);
if (activeElement === this.host) { while (!this.contains(activeElement)) {
return null;
}
while (!this.contains(activeElement) && !this.host.contains(activeElement)) {
while (activeElement.parentNode) { while (activeElement.parentNode) {
activeElement = activeElement.parentNode; activeElement = activeElement.parentNode;
} }

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.20", "version": "0.7.21",
"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.20", "version": "0.7.21",
"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.20 // @version 0.7.21
(function() { (function() {
window.WebComponents = window.WebComponents || { window.WebComponents = window.WebComponents || {
flags: {} flags: {}
@ -912,14 +912,29 @@ if (typeof WeakMap === "undefined") {
} }
})(self); })(self);
if (typeof HTMLTemplateElement === "undefined") { (function() {
(function() { var needsTemplate = typeof HTMLTemplateElement === "undefined";
var needsCloning = function() {
if (!needsTemplate) {
var frag = document.createDocumentFragment();
var t = document.createElement("template");
frag.appendChild(t);
t.content.appendChild(document.createElement("div"));
var clone = frag.cloneNode(true);
return clone.firstChild.content.childNodes.length === 0;
}
}();
var TEMPLATE_TAG = "template"; var TEMPLATE_TAG = "template";
var TemplateImpl = function() {};
if (needsTemplate) {
var contentDoc = document.implementation.createHTMLDocument("template"); var contentDoc = document.implementation.createHTMLDocument("template");
var canDecorate = true; var canDecorate = true;
HTMLTemplateElement = function() {}; var templateStyle = document.createElement("style");
HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype); templateStyle.textContent = TEMPLATE_TAG + "{display:none;}";
HTMLTemplateElement.decorate = function(template) { var head = document.head;
head.insertBefore(templateStyle, head.firstElementChild);
TemplateImpl.prototype = Object.create(HTMLElement.prototype);
TemplateImpl.decorate = function(template) {
if (template.content) { if (template.content) {
return; return;
} }
@ -940,7 +955,7 @@ if (typeof HTMLTemplateElement === "undefined") {
}, },
set: function(text) { set: function(text) {
contentDoc.body.innerHTML = text; contentDoc.body.innerHTML = text;
HTMLTemplateElement.bootstrap(contentDoc); TemplateImpl.bootstrap(contentDoc);
while (this.content.firstChild) { while (this.content.firstChild) {
this.content.removeChild(this.content.firstChild); this.content.removeChild(this.content.firstChild);
} }
@ -950,27 +965,30 @@ if (typeof HTMLTemplateElement === "undefined") {
}, },
configurable: true configurable: true
}); });
template.cloneNode = function(deep) {
return TemplateImpl.cloneNode(this, deep);
};
} catch (err) { } catch (err) {
canDecorate = false; canDecorate = false;
} }
} }
HTMLTemplateElement.bootstrap(template.content); TemplateImpl.bootstrap(template.content);
}; };
HTMLTemplateElement.bootstrap = function(doc) { TemplateImpl.bootstrap = function(doc) {
var templates = doc.querySelectorAll(TEMPLATE_TAG); var templates = doc.querySelectorAll(TEMPLATE_TAG);
for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) { for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
HTMLTemplateElement.decorate(t); TemplateImpl.decorate(t);
} }
}; };
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
HTMLTemplateElement.bootstrap(document); TemplateImpl.bootstrap(document);
}); });
var createElement = document.createElement; var createElement = document.createElement;
document.createElement = function() { document.createElement = function() {
"use strict"; "use strict";
var el = createElement.apply(document, arguments); var el = createElement.apply(document, arguments);
if (el.localName == "template") { if (el.localName == "template") {
HTMLTemplateElement.decorate(el); TemplateImpl.decorate(el);
} }
return el; return el;
}; };
@ -993,8 +1011,61 @@ if (typeof HTMLTemplateElement === "undefined") {
function escapeData(s) { function escapeData(s) {
return s.replace(escapeDataRegExp, escapeReplace); return s.replace(escapeDataRegExp, escapeReplace);
} }
})(); }
} if (needsTemplate || needsCloning) {
var nativeCloneNode = Node.prototype.cloneNode;
TemplateImpl.cloneNode = function(template, deep) {
var clone = nativeCloneNode.call(template);
if (this.decorate) {
this.decorate(clone);
}
if (deep) {
clone.content.appendChild(nativeCloneNode.call(template.content, true));
this.fixClonedDom(clone.content, template.content);
}
return clone;
};
TemplateImpl.fixClonedDom = function(clone, source) {
var s$ = source.querySelectorAll(TEMPLATE_TAG);
var t$ = clone.querySelectorAll(TEMPLATE_TAG);
for (var i = 0, l = t$.length, t, s; i < l; i++) {
s = s$[i];
t = t$[i];
if (this.decorate) {
this.decorate(s);
}
t.parentNode.replaceChild(s.cloneNode(true), t);
}
};
var originalImportNode = document.importNode;
Node.prototype.cloneNode = function(deep) {
var dom = nativeCloneNode.call(this, deep);
if (deep) {
TemplateImpl.fixClonedDom(dom, this);
}
return dom;
};
document.importNode = function(element, deep) {
if (element.localName === TEMPLATE_TAG) {
return TemplateImpl.cloneNode(element, deep);
} else {
var dom = originalImportNode.call(document, element, deep);
if (deep) {
TemplateImpl.fixClonedDom(dom, element);
}
return dom;
}
};
if (needsCloning) {
HTMLTemplateElement.prototype.cloneNode = function(deep) {
return TemplateImpl.cloneNode(this, deep);
};
}
}
if (needsTemplate) {
HTMLTemplateElement = TemplateImpl;
}
})();
(function(scope) { (function(scope) {
"use strict"; "use strict";
@ -1595,7 +1666,7 @@ window.HTMLImports.addModule(function(scope) {
if (doc && this._mayParse.indexOf(doc) < 0) { if (doc && this._mayParse.indexOf(doc) < 0) {
this._mayParse.push(doc); this._mayParse.push(doc);
var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) { for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
if (!this.isParsed(n)) { if (!this.isParsed(n)) {
if (this.hasResource(n)) { if (this.hasResource(n)) {
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;

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.20 // @version 0.7.21
(function() { (function() {
window.WebComponents = window.WebComponents || { window.WebComponents = window.WebComponents || {
flags: {} flags: {}
@ -3420,10 +3420,7 @@ if (WebComponents.flags.shadow) {
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement; var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null; if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
var activeElement = wrap(unwrappedActiveElement); var activeElement = wrap(unwrappedActiveElement);
if (activeElement === this.host) { while (!this.contains(activeElement)) {
return null;
}
while (!this.contains(activeElement) && !this.host.contains(activeElement)) {
while (activeElement.parentNode) { while (activeElement.parentNode) {
activeElement = activeElement.parentNode; activeElement = activeElement.parentNode;
} }
@ -6368,7 +6365,7 @@ window.HTMLImports.addModule(function(scope) {
if (doc && this._mayParse.indexOf(doc) < 0) { if (doc && this._mayParse.indexOf(doc) < 0) {
this._mayParse.push(doc); this._mayParse.push(doc);
var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) { for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
if (!this.isParsed(n)) { if (!this.isParsed(n)) {
if (this.hasResource(n)) { if (this.hasResource(n)) {
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;

File diff suppressed because one or more lines are too long