Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

Commit d2b2329

Browse files
committed
release v0.7.19
2 parents acdd43a + 396430f commit d2b2329

15 files changed

+111
-415
lines changed

CustomElements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Code distributed by Google as part of the polymer project is also
88
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99
*/
10-
// @version 0.7.18
10+
// @version 0.7.19
1111
if (typeof WeakMap === "undefined") {
1212
(function() {
1313
var defineProperty = Object.defineProperty;

CustomElements.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HTMLImports.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Code distributed by Google as part of the polymer project is also
88
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99
*/
10-
// @version 0.7.18
10+
// @version 0.7.19
1111
if (typeof WeakMap === "undefined") {
1212
(function() {
1313
var defineProperty = Object.defineProperty;

HTMLImports.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MutationObserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Code distributed by Google as part of the polymer project is also
88
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99
*/
10-
// @version 0.7.18
10+
// @version 0.7.19
1111
if (typeof WeakMap === "undefined") {
1212
(function() {
1313
var defineProperty = Object.defineProperty;

MutationObserver.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ShadowDOM.js

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Code distributed by Google as part of the polymer project is also
88
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99
*/
10-
// @version 0.7.18
10+
// @version 0.7.19
1111
if (typeof WeakMap === "undefined") {
1212
(function() {
1313
var defineProperty = Object.defineProperty;
@@ -2741,7 +2741,7 @@ window.ShadowDOMPolyfill = {};
27412741
enumerable: true
27422742
});
27432743
}
2744-
[ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
2744+
[ "focus", "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
27452745
registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
27462746
scope.wrappers.HTMLElement = HTMLElement;
27472747
scope.getInnerHTML = getInnerHTML;
@@ -3364,6 +3364,7 @@ window.ShadowDOMPolyfill = {};
33643364
var setInnerHTML = scope.setInnerHTML;
33653365
var unsafeUnwrap = scope.unsafeUnwrap;
33663366
var unwrap = scope.unwrap;
3367+
var wrap = scope.wrap;
33673368
var shadowHostTable = new WeakMap();
33683369
var nextOlderShadowTreeTable = new WeakMap();
33693370
function ShadowRoot(hostWrapper) {
@@ -3399,6 +3400,22 @@ window.ShadowDOMPolyfill = {};
33993400
},
34003401
getSelection: function() {
34013402
return document.getSelection();
3403+
},
3404+
get activeElement() {
3405+
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
3406+
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
3407+
var activeElement = wrap(unwrappedActiveElement);
3408+
while (!this.contains(activeElement)) {
3409+
while (activeElement.parentNode) {
3410+
activeElement = activeElement.parentNode;
3411+
}
3412+
if (activeElement.host) {
3413+
activeElement = activeElement.host;
3414+
} else {
3415+
return null;
3416+
}
3417+
}
3418+
return activeElement;
34023419
}
34033420
});
34043421
scope.wrappers.ShadowRoot = ShadowRoot;
@@ -4063,6 +4080,7 @@ window.ShadowDOMPolyfill = {};
40634080
var ShadowRoot = scope.wrappers.ShadowRoot;
40644081
var TreeScope = scope.TreeScope;
40654082
var cloneNode = scope.cloneNode;
4083+
var defineGetter = scope.defineGetter;
40664084
var defineWrapGetter = scope.defineWrapGetter;
40674085
var elementFromPoint = scope.elementFromPoint;
40684086
var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
@@ -4086,6 +4104,23 @@ window.ShadowDOMPolyfill = {};
40864104
defineWrapGetter(Document, "documentElement");
40874105
defineWrapGetter(Document, "body");
40884106
defineWrapGetter(Document, "head");
4107+
defineGetter(Document, "activeElement", function() {
4108+
var unwrappedActiveElement = unwrap(this).activeElement;
4109+
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
4110+
var activeElement = wrap(unwrappedActiveElement);
4111+
while (!this.contains(activeElement)) {
4112+
var lastHost = activeElement;
4113+
while (activeElement.parentNode) {
4114+
activeElement = activeElement.parentNode;
4115+
}
4116+
if (activeElement.host) {
4117+
activeElement = activeElement.host;
4118+
} else {
4119+
return null;
4120+
}
4121+
}
4122+
return activeElement;
4123+
});
40894124
function wrapMethod(name) {
40904125
var original = document[name];
40914126
Document.prototype[name] = function() {

ShadowDOM.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "webcomponentsjs",
33
"main": "webcomponents.js",
4-
"version": "0.7.18",
4+
"version": "0.7.19",
55
"homepage": "http://webcomponents.org",
66
"authors": [
77
"The Polymer Authors"

0 commit comments

Comments
 (0)