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

update web components

This commit is contained in:
Luke Pulverenti 2015-12-05 09:18:07 -05:00
parent 5093d99000
commit f6b71369e3
22 changed files with 199 additions and 161 deletions

View file

@ -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.18
// @version 0.7.19
if (typeof WeakMap === "undefined") {
(function() {
var defineProperty = Object.defineProperty;
@ -2741,7 +2741,7 @@ window.ShadowDOMPolyfill = {};
enumerable: true
});
}
[ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
[ "focus", "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
scope.wrappers.HTMLElement = HTMLElement;
scope.getInnerHTML = getInnerHTML;
@ -3364,6 +3364,7 @@ window.ShadowDOMPolyfill = {};
var setInnerHTML = scope.setInnerHTML;
var unsafeUnwrap = scope.unsafeUnwrap;
var unwrap = scope.unwrap;
var wrap = scope.wrap;
var shadowHostTable = new WeakMap();
var nextOlderShadowTreeTable = new WeakMap();
function ShadowRoot(hostWrapper) {
@ -3399,6 +3400,22 @@ window.ShadowDOMPolyfill = {};
},
getSelection: function() {
return document.getSelection();
},
get activeElement() {
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
var activeElement = wrap(unwrappedActiveElement);
while (!this.contains(activeElement)) {
while (activeElement.parentNode) {
activeElement = activeElement.parentNode;
}
if (activeElement.host) {
activeElement = activeElement.host;
} else {
return null;
}
}
return activeElement;
}
});
scope.wrappers.ShadowRoot = ShadowRoot;
@ -4063,6 +4080,7 @@ window.ShadowDOMPolyfill = {};
var ShadowRoot = scope.wrappers.ShadowRoot;
var TreeScope = scope.TreeScope;
var cloneNode = scope.cloneNode;
var defineGetter = scope.defineGetter;
var defineWrapGetter = scope.defineWrapGetter;
var elementFromPoint = scope.elementFromPoint;
var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
@ -4086,6 +4104,23 @@ window.ShadowDOMPolyfill = {};
defineWrapGetter(Document, "documentElement");
defineWrapGetter(Document, "body");
defineWrapGetter(Document, "head");
defineGetter(Document, "activeElement", function() {
var unwrappedActiveElement = unwrap(this).activeElement;
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
var activeElement = wrap(unwrappedActiveElement);
while (!this.contains(activeElement)) {
var lastHost = activeElement;
while (activeElement.parentNode) {
activeElement = activeElement.parentNode;
}
if (activeElement.host) {
activeElement = activeElement.host;
} else {
return null;
}
}
return activeElement;
});
function wrapMethod(name) {
var original = document[name];
Document.prototype[name] = function() {