Skip to content

Commit

Permalink
3430 - ie memory leak fixes - disable event caching, fixed resolver u…
Browse files Browse the repository at this point in the history
…rl adding to root doc, and weak map ie issues
  • Loading branch information
bbsteventill committed Sep 27, 2016
1 parent 80640c8 commit a6e66f9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/bind/accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
value = value === undefined ? this[source] : value;
event = event || Polymer.CaseMap.camelToDashCase(source) + '-changed';
this.fire(event, {value: value},
{bubbles: false, cancelable: false, _useCache: true});
{bubbles: false, cancelable: false, _useCache: Polymer.Settings.eventDataCache || !CustomElements.isIE});
},

// TODO(sjmiles): removing _notifyListener from here breaks accessors.html
Expand Down
2 changes: 1 addition & 1 deletion src/lib/lang.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
enumerable: true,
configurable: true,
get: function() {
return (document._currentScript || document.currentScript).ownerDocument;
return (document._currentScript || document.currentScript || {}).ownerDocument;
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/lib/resolve-url.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
}

function getUrlResolver(ownerDocument) {
return ownerDocument.__urlResolver ||
(ownerDocument.__urlResolver = ownerDocument.createElement('a'));
return ownerDocument.body.__urlResolver ||
(ownerDocument.body.__urlResolver = ownerDocument.createElement('a'));
}

var CSS_URL_RX = /(url\()([^)]*)(\))/g;
Expand Down
4 changes: 3 additions & 1 deletion src/standard/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@
var bl = hbl.get(target);
if (!bl) {
bl = {};
hbl.set(target, bl);
if( !CustomElements.isIE || target != window ) {
hbl.set(target, bl);
}
}
var key = this._boundListenerKey(eventName, methodName);
bl[key] = handler;
Expand Down
2 changes: 1 addition & 1 deletion src/standard/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
this.fire(eventName, {
path: path,
value: value
}, {bubbles: false, _useCache: true});
}, {bubbles: false, _useCache: Polymer.Settings.eventDataCache || !CustomElements.isIE});
},

_EVENT_CHANGED: '-changed',
Expand Down

0 comments on commit a6e66f9

Please sign in to comment.