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:
parent
cd06587514
commit
068f90a11f
15 changed files with 114 additions and 49 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.20",
|
||||
"version": "0.7.21",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -18,11 +18,11 @@
|
|||
"devDependencies": {
|
||||
"web-component-tester": "^4.0.1"
|
||||
},
|
||||
"_release": "0.7.20",
|
||||
"_release": "0.7.21",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.20",
|
||||
"commit": "ce9c8597696ec4bafc772c2126a3b1c7b0e948c0"
|
||||
"tag": "v0.7.21",
|
||||
"commit": "19ffcd921e1aef84b55f515b00eb56e8e9116126"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
||||
"_target": "^0.7.20",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -948,7 +948,7 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (doc && this._mayParse.indexOf(doc) < 0) {
|
||||
this._mayParse.push(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.hasResource(n)) {
|
||||
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
|
@ -3411,10 +3411,7 @@ window.ShadowDOMPolyfill = {};
|
|||
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
if (activeElement === this.host) {
|
||||
return null;
|
||||
}
|
||||
while (!this.contains(activeElement) && !this.host.contains(activeElement)) {
|
||||
while (!this.contains(activeElement)) {
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.20",
|
||||
"version": "0.7.21",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.20",
|
||||
"version": "0.7.21",
|
||||
"description": "webcomponents.js",
|
||||
"main": "webcomponents.js",
|
||||
"directories": {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
|
@ -912,14 +912,29 @@ if (typeof WeakMap === "undefined") {
|
|||
}
|
||||
})(self);
|
||||
|
||||
if (typeof HTMLTemplateElement === "undefined") {
|
||||
(function() {
|
||||
var TEMPLATE_TAG = "template";
|
||||
(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 TemplateImpl = function() {};
|
||||
if (needsTemplate) {
|
||||
var contentDoc = document.implementation.createHTMLDocument("template");
|
||||
var canDecorate = true;
|
||||
HTMLTemplateElement = function() {};
|
||||
HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
|
||||
HTMLTemplateElement.decorate = function(template) {
|
||||
var templateStyle = document.createElement("style");
|
||||
templateStyle.textContent = TEMPLATE_TAG + "{display:none;}";
|
||||
var head = document.head;
|
||||
head.insertBefore(templateStyle, head.firstElementChild);
|
||||
TemplateImpl.prototype = Object.create(HTMLElement.prototype);
|
||||
TemplateImpl.decorate = function(template) {
|
||||
if (template.content) {
|
||||
return;
|
||||
}
|
||||
|
@ -940,7 +955,7 @@ if (typeof HTMLTemplateElement === "undefined") {
|
|||
},
|
||||
set: function(text) {
|
||||
contentDoc.body.innerHTML = text;
|
||||
HTMLTemplateElement.bootstrap(contentDoc);
|
||||
TemplateImpl.bootstrap(contentDoc);
|
||||
while (this.content.firstChild) {
|
||||
this.content.removeChild(this.content.firstChild);
|
||||
}
|
||||
|
@ -950,27 +965,30 @@ if (typeof HTMLTemplateElement === "undefined") {
|
|||
},
|
||||
configurable: true
|
||||
});
|
||||
template.cloneNode = function(deep) {
|
||||
return TemplateImpl.cloneNode(this, deep);
|
||||
};
|
||||
} catch (err) {
|
||||
canDecorate = false;
|
||||
}
|
||||
}
|
||||
HTMLTemplateElement.bootstrap(template.content);
|
||||
TemplateImpl.bootstrap(template.content);
|
||||
};
|
||||
HTMLTemplateElement.bootstrap = function(doc) {
|
||||
TemplateImpl.bootstrap = function(doc) {
|
||||
var templates = doc.querySelectorAll(TEMPLATE_TAG);
|
||||
for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
|
||||
HTMLTemplateElement.decorate(t);
|
||||
TemplateImpl.decorate(t);
|
||||
}
|
||||
};
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
HTMLTemplateElement.bootstrap(document);
|
||||
TemplateImpl.bootstrap(document);
|
||||
});
|
||||
var createElement = document.createElement;
|
||||
document.createElement = function() {
|
||||
"use strict";
|
||||
var el = createElement.apply(document, arguments);
|
||||
if (el.localName == "template") {
|
||||
HTMLTemplateElement.decorate(el);
|
||||
TemplateImpl.decorate(el);
|
||||
}
|
||||
return el;
|
||||
};
|
||||
|
@ -993,8 +1011,61 @@ if (typeof HTMLTemplateElement === "undefined") {
|
|||
function escapeData(s) {
|
||||
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) {
|
||||
"use strict";
|
||||
|
@ -1595,7 +1666,7 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (doc && this._mayParse.indexOf(doc) < 0) {
|
||||
this._mayParse.push(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.hasResource(n)) {
|
||||
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
* 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
|
||||
*/
|
||||
// @version 0.7.20
|
||||
// @version 0.7.21
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
|
@ -3420,10 +3420,7 @@ if (WebComponents.flags.shadow) {
|
|||
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
if (activeElement === this.host) {
|
||||
return null;
|
||||
}
|
||||
while (!this.contains(activeElement) && !this.host.contains(activeElement)) {
|
||||
while (!this.contains(activeElement)) {
|
||||
while (activeElement.parentNode) {
|
||||
activeElement = activeElement.parentNode;
|
||||
}
|
||||
|
@ -6368,7 +6365,7 @@ window.HTMLImports.addModule(function(scope) {
|
|||
if (doc && this._mayParse.indexOf(doc) < 0) {
|
||||
this._mayParse.push(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.hasResource(n)) {
|
||||
return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue