update web components
This commit is contained in:
parent
5093d99000
commit
f6b71369e3
22 changed files with 199 additions and 161 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.18",
|
||||
"version": "0.7.19",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -18,11 +18,11 @@
|
|||
"devDependencies": {
|
||||
"web-component-tester": "~3.3.10"
|
||||
},
|
||||
"_release": "0.7.18",
|
||||
"_release": "0.7.19",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.18",
|
||||
"commit": "acdd43ad41c15e1834458da01d228ab22a224051"
|
||||
"tag": "v0.7.19",
|
||||
"commit": "d2b2329a8453e93b0d0c4949bb83e7166088adaf"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
||||
"_target": "^0.7.18",
|
||||
|
|
|
@ -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;
|
||||
|
|
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.18
|
||||
// @version 0.7.19
|
||||
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.18
|
||||
// @version 0.7.19
|
||||
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.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() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.18",
|
||||
"version": "0.7.19",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.18",
|
||||
"version": "0.7.19",
|
||||
"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.18
|
||||
// @version 0.7.19
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
|
|
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.18
|
||||
// @version 0.7.19
|
||||
(function() {
|
||||
window.WebComponents = window.WebComponents || {
|
||||
flags: {}
|
||||
|
@ -2771,7 +2771,7 @@ if (WebComponents.flags.shadow) {
|
|||
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;
|
||||
|
@ -3373,6 +3373,7 @@ if (WebComponents.flags.shadow) {
|
|||
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) {
|
||||
|
@ -3408,6 +3409,22 @@ if (WebComponents.flags.shadow) {
|
|||
},
|
||||
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;
|
||||
|
@ -4066,6 +4083,7 @@ if (WebComponents.flags.shadow) {
|
|||
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;
|
||||
|
@ -4089,6 +4107,23 @@ if (WebComponents.flags.shadow) {
|
|||
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() {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue