Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Handle a baseURI of null #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Handle a baseURI of null #91

wants to merge 2 commits into from

Conversation

dfreedm
Copy link
Contributor

@dfreedm dfreedm commented Aug 19, 2016

When ownerDocument.baseURI is null (detached document, maybe some other cases), new URL(url, baseURI) will throw.
Only use new URL when baseURI is not null.

When `ownerDocument.baseURI` is null (detached document, maybe some other cases), `new URL(url, baseURI)` will throw.
Only use `new URL` when `baseURI` is not null.
On second thought, you really only need `new URL`. `Polymer.ResolveUrl.resolveUrl` is just doing the same thing as this.
@@ -396,8 +396,11 @@
},

_resolveSrc: function(testSrc) {
var baseURI = /** @type {string} */(this.ownerDocument.baseURI);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@type isn't needed anymore?

@bicknellr
Copy link
Contributor

This will cause #86 again when the URL isn't resolved. How about (this.ownerDocument || document).baseURI?

@stramel
Copy link
Contributor

stramel commented May 25, 2017

I don't believe this is applicable anymore with the latest in master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants