title: Optional baseURI (location) in DOMParser?
body: <pre class="lang-js prettyprint-override"><code>// html data loaded from [http://example.org/some/path]
  let htmlSource = `&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
   ... &lt;a href="relative"&gt;&lt;/a&gt; ... 
  &lt;/body&gt;&lt;/html&gt;`;
  
  const dom = new DOMParser().parseFromString(htmlSource, 'text/html');
  
  // this returns the value of the attribute as is
  dom.links[0].getAttribute('href'); // -&gt; "relative" / nothing new here
  
  // this should resolve urls
  dom.links[0].href // -&gt; wait, relative to WHAT??
  
  // if you run this code while being on [http://google.com] you'll get
  dom.links[0].href // -&gt; "https://www.google.com/relative"
  
  // Also,
  
  dom.location // -&gt; null / you can't change it
  
  dom.baseURI // -&gt; "https://www.google.com/" / read-only
  </code></pre>
  
  <p>So it looks like <code>DOMParser</code> implicitly forces to use current page <code>location</code> as <code>baseURI</code> for new <code>HTMLDocument</code>'s.</p>
  
  <p>Why not give developer an option (3rd argument?) to explicitly specify document location?</p>
  
  <p>Is there a way to make <code>DOMParser</code> respect optional base url? Workarounds?</p>