mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
Fix for IE11 bug where document.activeElement sometimes returns a null-prototyped object.
This commit is contained in:
@@ -52,7 +52,10 @@
|
||||
defineWrapGetter(Document, 'head');
|
||||
|
||||
defineGetter(Document, 'activeElement', function() {
|
||||
var activeElement = wrap(unwrap(this).activeElement);
|
||||
var unwrappedActiveElement = unwrap(this).activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
|
||||
// Loop while activeElement is not a shallow child of this document.
|
||||
while (!this.contains(activeElement)) {
|
||||
|
||||
@@ -75,7 +75,10 @@
|
||||
},
|
||||
|
||||
get activeElement() {
|
||||
var activeElement = wrap(unwrap(this).ownerDocument.activeElement);
|
||||
var unwrappedActiveElement = unwrap(this).ownerDocument.activeElement;
|
||||
if (!unwrappedActiveElement || !unwrappedActiveElement.nodeType) return null;
|
||||
|
||||
var activeElement = wrap(unwrappedActiveElement);
|
||||
|
||||
// Loop while activeElement is not a shallow child of this ShadowRoot.
|
||||
while (!this.contains(activeElement)) {
|
||||
|
||||
Reference in New Issue
Block a user