HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2413location.resolveURL() for resolving relative URLs (for sending to workers, in particular) (credit: js)2008-11-18 03:40
@@ -41161,28 +41161,31 @@ style/default.css</pre>
   context</span>'s session history to be changed, by adding or
   replacing entries in the <code title="dom-history">history</code>
   object.</p>
 
   <pre class="idl">interface <dfn>Location</dfn> {
   readonly attribute DOMString <span title="dom-location-href">href</span>;
   void <span title="dom-location-assign">assign</span>(in DOMString url);
   void <span title="dom-location-replace">replace</span>(in DOMString url);
   void <span title="dom-location-reload">reload</span>();
 
-    // <span>URL decomposition attributes</span> <!-- blame brendan for these "innovative" names -->
+  // <span>URL decomposition attributes</span> <!-- blame brendan for these "innovative" names -->
            attribute DOMString <span title="dom-location-protocol">protocol</span>;
            attribute DOMString <span title="dom-location-host">host</span>;
            attribute DOMString <span title="dom-location-hostname">hostname</span>;
            attribute DOMString <span title="dom-location-port">port</span>;
            attribute DOMString <span title="dom-location-pathname">pathname</span>;
            attribute DOMString <span title="dom-location-search">search</span>;
            attribute DOMString <span title="dom-location-hash">hash</span>;
+
+  // resolving relative URLs
+  DOMString <span title="dom-location-resolveURL">resolveURL</span>(in DOMString url);
 };</pre>
 
   <p>The <dfn title="dom-location-href"><code>href</code></dfn>
   attribute must return <span title="the document's address">the
   address</span><!-- XXXDOCURL --> of the page represented by the
   associated <code>Document</code> object, as an <span>absolute
   URL</span>.</p>
 
   <p>On setting, <!--XXX Mozilla does this, but IE doesn't. What
   should we do?: the behavior depends on the context in which the
@@ -41214,50 +41217,60 @@ style/default.css</pre>
   <span>navigate</span> the <span>browsing context</span> to the
   specified <var title="">url</var> with <span>replacement
   enabled</span>.</p>
 
   <p>Navigation for the <code
   title="dom-location-assign">assign()</code> and <code
   title="dom-location-replace">replace()</code> methods must be done
   with the <span>script browsing context</span> of the script that
   invoked the method as the <span>source browsing context</span>.</p>
 
+<!--XXX
+  <dfn title="dom-location-reload"><code>reload()</code></dfn>
+  reload during resize event:
+  redisplay the current page (without reloading it). This
+  theoretically would have no effect but in practice can be useful to
+  work around rendering bugs.
+
+reload on shared Document updates all of them
+
+user reload must be equivalent to .reload()
+-->
+
   <p>The <code>Location</code> interface also has the complement of
   <span>URL decomposition attributes</span>, <dfn
   title="dom-location-protocol"><code>protocol</code></dfn>, <dfn
   title="dom-location-host"><code>host</code></dfn>, <dfn
   title="dom-location-port"><code>port</code></dfn>, <dfn
   title="dom-location-hostname"><code>hostname</code></dfn>, <dfn
   title="dom-location-pathname"><code>pathname</code></dfn>, <dfn
   title="dom-location-search"><code>search</code></dfn>, and <dfn
   title="dom-location-hash"><code>hash</code></dfn>. These must follow
   the rules given for URL decomposition attributes, with the <span
   title="concept-uda-input">input</span> being <span title="the
   document's address">the address</span><!-- XXXDOCURL --> of the page
   represented by the associated <code>Document</code> object, as an
   <span>absolute URL</span> (same as the <code
   title="dom-location-href">href</code> attribute), and the <span
   title="concept-uda-setter">common setter action</span> being the
   same as setting the <code title="dom-location-href">href</code>
   attribute to the new output value.</p>
 
-<!--
-  <dfn title="dom-location-reload"><code>reload()</code></dfn>
-  reload during resize event:
-  redisplay the current page (without reloading it). This
-  theoretically would have no effect but in practice can be useful to
-  work around rendering bugs.
+  <hr>
 
-reload on shared Document updates all of them
+  <p>The <dfn title="dom-location-resolveURL"><code>resolveURL(<var
+  title="">url</var>)</code></dfn> method must <span title="resolve a
+  url">resolve</span> its <var title="">url</var> argument, and if
+  that succeeds, return the resulting <span>absolute URL</span>. If it
+  fails, it must throw a <code>SYNTAX_ERR</code> exception
+  instead.</p>
 
-user reload must be equivalent to .reload()
--->
 
   <h5>Security</h5>
 
   <p>User agents must raise a <span>security exception</span> whenever
   any of the members of a <code>Location</code> object are accessed by
   scripts whose <span>effective script origin</span> is not the <span
   title="same origin">same</span> as the <code>Location</code>
   object's associated <code>Document</code>'s <span>effective script
   origin</span>, with the following exceptions:</p>
 

|