-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 3637,3638 #3639
Fix 3637,3638 #3639
Conversation
…under native Custom Elements.
…ements when importHref is called repeatedly with the same url.
l.onerror = function(e) { | ||
var errorListener = function(e) { | ||
e.target.__firedError = true; | ||
e.target.removeEventListener('error', errorListener); | ||
return onerror.call(self, e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The errorListener should be added as listener to the link I suppose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, import can be cached element if present var imprt = cached || link;
. And below load/error events will be simulated on cached element if it is present or link will be loaded if necessary. So in either case imprt
is what events will be fired on.
However, I do not understand the purpose of shortening import
to imprt
😄
Also link creation might be avoided if cached import is already in place, this will save few wasted CPU cycles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sorry, mistyped link instead of imprt.
@sorvell Would a testcase like this verify the error callback? This should generate a 404 and trigger the test('importHref error callback is invoked', function(done) {
Polymer.Base.importHref('non-existing-page.html', null, done);
}); |
@sorvell |
No description provided.