Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix SD Polyfill + document.baseURI
Browse files Browse the repository at this point in the history
I assumed (incorrectly) that SD Polyfill provided wrappers for document.baseURI
  • Loading branch information
dfreedm committed Feb 4, 2014
1 parent f0dc21f commit cde4a8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/HTMLImports.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,16 @@ Object.defineProperty(document, '_currentScript', currentScriptDescriptor);
Object.defineProperty(mainDoc, '_currentScript', currentScriptDescriptor);

// Polyfill document.baseURI for browsers without it.
// ShadowDOM Polyfill wrapper should handle this automatically.
if (!document.baseURI) {
Object.defineProperty(document, 'baseURI', {
var baseURIDescriptor = {
get: function() {
return window.location.href;
},
configurable: true
});
};

Object.defineProperty(document, 'baseURI', baseURIDescriptor);
Object.defineProperty(mainDoc, 'baseURI', baseURIDescriptor);
}

// TODO(sorvell): multiple calls will install multiple event listeners
Expand Down

0 comments on commit cde4a8a

Please sign in to comment.