HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
3015[Gecko] [Internet Explorer] [Opera] [Webkit] Add the URL decomposition attributes to <a> and <area>.2009-04-29 00:29
@@ -4433,38 +4433,39 @@
   title="concept-uda-input">input</dfn>, which is a <span>URL</span>
   that the attributes act on, and a <dfn
   title="concept-uda-setter">common setter action</dfn>, which is a
   set of steps invoked when any of the attributes' setters are
   invoked.</p>
 
   <p>The seven URL decomposition attributes have similar
   requirements.</p>
 
   <p>On getting, if the <span title="concept-uda-input">input</span>
-  fulfills the condition given in the "getter condition" column
-  corresponding to the attribute in the table below, the user agent
-  must return the part of the <span
+  is an <span>absolute URL</span> that fulfills the condition given in
+  the "getter condition" column corresponding to the attribute in the
+  table below, the user agent must return the part of the <span
   title="concept-uda-input">input</span> URL given in the "component"
   column, with any prefixes specified in the "prefix" column
   appropriately added to the start of the string and any suffixes
   specified in the "suffix" column appropriately added to the end of
   the string. Otherwise, the attribute must return the empty
   string.</p>
 
   <p>On setting, the new value must first be mutated as described by
   the "setter preprocessor" column, then mutated by %-escaping any
   characters in the new value that are not valid in the relevant
-  component as given by the "component" column. Then, if the resulting
-  new value fulfills the condition given in the "setter condition"
-  column, the user agent must make a new string <var
-  title="">output</var> by replacing the component of the URL given by
-  the "component" column in the <span
+  component as given by the "component" column. Then, if the <span
+  title="concept-uda-input">input</span> is an <span>absolute
+  URL</span> and the resulting new value fulfills the condition given
+  in the "setter condition" column, the user agent must make a new
+  string <var title="">output</var> by replacing the component of the
+  URL given by the "component" column in the <span
   title="concept-uda-input">input</span> URL with the new value;
   otherwise, the user agent must let <var title="">output</var> be
   equal to the <span title="concept-uda-input">input</span>. Finally,
   the user agent must invoke the <span
   title="concept-uda-setter">common setter action</span> with the
   value of <var title="">output</var>.</p>
 
   <p>When replacing a component in the URL, if the component is part
   of an optional group in the URL syntax consisting of a character
   followed by the component, the component (including its prefix
@@ -4499,38 +4500,38 @@
      <td>U+003A COLON ("<code title="">:</code>")
      <td>Remove all trailing U+003A COLON ("<code title="">:</code>") characters
      <td>The new value is not the empty string
     <tr>
      <td><dfn title="dom-uda-host"><code>host</code></dfn>
      <td><span title="url-hostport">&lt;hostport&gt;</span>
      <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
      <td>&mdash;
      <td>&mdash;
      <td>&mdash;
-     <td>&mdash;
+     <td>The new value is not the empty string and <span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
     <tr>
      <td><dfn title="dom-uda-hostname"><code>hostname</code></dfn>
      <td><span title="url-host">&lt;host&gt;</span>
      <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
      <td>&mdash;
      <td>&mdash;
      <td>Remove all leading U+002F SOLIDUS ("<code title="">/</code>") characters
-     <td>&mdash;
+     <td>The new value is not the empty string and <span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
     <tr>
      <td><dfn title="dom-uda-port"><code>port</code></dfn>
      <td><span title="url-port">&lt;port&gt;</span>
      <td><span title="concept-uda-input">input</span> is hierarchical, uses a server-based naming authority, and contained a <span title="url-port">&lt;port&gt;</span> component (possibly an empty one)
      <td>&mdash;
      <td>&mdash;
      <td>Remove any characters in the new value that are not in the range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE.
          If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character ('0').
-     <td>&mdash;
+     <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
     <tr>
      <td><dfn title="dom-uda-pathname"><code>pathname</code></dfn>
      <td><span title="url-path">&lt;path&gt;</span>
      <td><span title="concept-uda-input">input</span> is hierarchical
      <td>&mdash;
      <td>&mdash;
      <td>If it has no leading U+002F SOLIDUS ("<code title="">/</code>") character, prepend a U+002F SOLIDUS ("<code title="">/</code>") character to the new value
      <td>&mdash;
     <tr>
      <td><dfn title="dom-uda-search"><code>search</code></dfn>
@@ -14832,21 +14833,30 @@ first matching case):&lt;/p&gt;
    <dd>
 <pre class="idl">[Stringifies=href] interface <dfn>HTMLAnchorElement</dfn> : <span>HTMLElement</span> {
            attribute DOMString <span title="dom-a-href">href</span>;
            attribute DOMString <span title="dom-a-target">target</span>;
            attribute DOMString <span title="dom-a-ping">ping</span>;
            attribute DOMString <span title="dom-a-rel">rel</span>;
   readonly attribute DOMTokenList <span title="dom-a-relList">relList</span>;
            attribute DOMString <span title="dom-a-media">media</span>;
            attribute DOMString <span title="dom-a-hreflang">hreflang</span>;
            attribute DOMString <span title="dom-a-type">type</span>;
-};</pre><!-- XXX also support the URL decomposition attributes -->
+
+  // <span>URL decomposition attributes</span>
+           attribute DOMString <span title="dom-a-protocol">protocol</span>;
+           attribute DOMString <span title="dom-a-host">host</span>;
+           attribute DOMString <span title="dom-a-hostname">hostname</span>;
+           attribute DOMString <span title="dom-a-port">port</span>;
+           attribute DOMString <span title="dom-a-pathname">pathname</span>;
+           attribute DOMString <span title="dom-a-search">search</span>;
+           attribute DOMString <span title="dom-a-hash">hash</span>;
+};</pre>
     <p>The <code title="command-ro">Command</code> interface must also be implemented by
     this element.</p>
    </dd>
   </dl>
 
   <p>If the <code>a</code> element has an <code
   title="attr-hyperlink-href">href</code> attribute, then it
   <span>represents</span> a <span>hyperlink</span> (a hypertext
   anchor).</p>
 
@@ -14964,20 +14974,39 @@ first matching case):&lt;/p&gt;
   title="dom-a-hreflang"><code>hreflang</code></dfn>, and <dfn
   title="dom-a-type"><code>type</code></dfn>, must
   <span>reflect</span> the respective content attributes of the same
   name.</p>
 
   <p>The DOM attribute <dfn
   title="dom-a-rellist"><code>relList</code></dfn> must
   <span>reflect</span> the <code title="attr-hyperlink-rel">rel</code>
   content attribute.</p>
 
+  <p>The <code>a</code> element also suports the complement of
+  <span>URL decomposition attributes</span>, <dfn
+  title="dom-a-protocol"><code>protocol</code></dfn>, <dfn
+  title="dom-a-host"><code>host</code></dfn>, <dfn
+  title="dom-a-port"><code>port</code></dfn>, <dfn
+  title="dom-a-hostname"><code>hostname</code></dfn>, <dfn
+  title="dom-a-pathname"><code>pathname</code></dfn>, <dfn
+  title="dom-a-search"><code>search</code></dfn>, and <dfn
+  title="dom-a-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 the result of <span
+  title="resolve a url">resolving</span> the element's <code
+  title="attr-a-href">href</code> attribute relative to the element,
+  if there is such an attribute and resolving it is successful, or the
+  empty string otherwise; and the <span
+  title="concept-uda-setter">common setter action</span> being the
+  same as setting the element's <code title="attr-a-href">href</code>
+  attribute to the new output value.</p>
+
   </div>
 
   <div class="example">
 
    <p>The <code>a</code> element may be wrapped around entire
    paragraphs, lists, tables, and so forth, even entire sections, so
    long as there is no interactive content within (e.g. buttons or
    other links). This example shows how this can be used to make an
    entire advertising block into a link:</p>
 
@@ -27577,21 +27606,30 @@ function AddCloud(data, x, y) { ... }</pre>
            attribute DOMString <span title="dom-area-coords">coords</span>;
            attribute DOMString <span title="dom-area-shape">shape</span>;
            attribute DOMString <span title="dom-area-href">href</span>;
            attribute DOMString <span title="dom-area-target">target</span>;
            attribute DOMString <span title="dom-area-ping">ping</span>;
            attribute DOMString <span title="dom-area-rel">rel</span>;
   readonly attribute DOMTokenList <span title="dom-area-relList">relList</span>;
            attribute DOMString <span title="dom-area-media">media</span>;
            attribute DOMString <span title="dom-area-hreflang">hreflang</span>;
            attribute DOMString <span title="dom-area-type">type</span>;
-};</pre><!-- XXX also support the URL decomposition attributes -->
+
+  // <span>URL decomposition attributes</span>
+           attribute DOMString <span title="dom-area-protocol">protocol</span>;
+           attribute DOMString <span title="dom-area-host">host</span>;
+           attribute DOMString <span title="dom-area-hostname">hostname</span>;
+           attribute DOMString <span title="dom-area-port">port</span>;
+           attribute DOMString <span title="dom-area-pathname">pathname</span>;
+           attribute DOMString <span title="dom-area-search">search</span>;
+           attribute DOMString <span title="dom-area-hash">hash</span>;
+};</pre>
    </dd>
   </dl>
 
   <p>The <code>area</code> element <span>represents</span> either a
   hyperlink with some text and a corresponding area on an <span>image
   map</span>, or a dead area on an image map.</p>
 
   <p>If the <code>area</code> element has an <code
   title="attr-hyperlink-href">href</code> attribute, then the
   <code>area</code> element represents a <span>hyperlink</span>. In
@@ -27772,20 +27810,40 @@ function AddCloud(data, x, y) { ... }</pre>
   <p>The DOM attribute <dfn
   title="dom-area-shape"><code>shape</code></dfn> must
   <span>reflect</span> the <code title="attr-area-shape">shape</code>
   content attribute, <span>limited to only known values</span>.</p>
 
   <p>The DOM attribute <dfn
   title="dom-area-rellist"><code>relList</code></dfn> must
   <span>reflect</span> the <code title="attr-hyperlink-rel">rel</code>
   content attribute.</p>
 
+  <p>The <code>area</code> element also suports the complement of
+  <span>URL decomposition attributes</span>, <dfn
+  title="dom-area-protocol"><code>protocol</code></dfn>, <dfn
+  title="dom-area-host"><code>host</code></dfn>, <dfn
+  title="dom-area-port"><code>port</code></dfn>, <dfn
+  title="dom-area-hostname"><code>hostname</code></dfn>, <dfn
+  title="dom-area-pathname"><code>pathname</code></dfn>, <dfn
+  title="dom-area-search"><code>search</code></dfn>, and <dfn
+  title="dom-area-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 the result of <span
+  title="resolve a url">resolving</span> the element's <code
+  title="attr-area-href">href</code> attribute relative to the
+  element, if there is such an attribute and resolving it is
+  successful, or the empty string otherwise; and the <span
+  title="concept-uda-setter">common setter action</span> being the
+  same as setting the element's <code
+  title="attr-area-href">href</code> attribute to the new output
+  value.</p>
+
   </div>
 
 
   <h4 id="image-maps">Image maps</h4>
 
   <!-- TESTS
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/smallcats%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%3E%0A%3Cmap%20name%3Da%3E%0A%20%3Carea%20onclick%3Dw%28%271%27%29%20coords%3D%270%25%200%25%20100%25%20100%25%27%20href%3Djavascript%3A%3E%0A%3C/map%3E
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cbody%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/smallcats%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/sample%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cmap%20name%3Da%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%20%3Carea%20onclick%3Dw%28%271%27%29%20coords%3D%270%200%2050%2050%27%20href%3Djavascript%3A%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3C/map%3E%0A%3Cscript%3E%0A%20var%20x%20%3D%20document.getElementsByTagName%28%27img%27%29%5B0%5D%3B%0A%20x.parentNode.appendChild%28x%29%3B%0A%20document.getElementsByTagName%28%27area%27%29%5B0%5D.focus%28%29%3B%0A%3C/script%3E
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3Ex%3Cmap%3E%3Carea%20shape%3Dpolyg%20coords%3D%221%2C2%203%22%3E%3C/map%3E%0A%3Cscript%3Ex%20%3D%20document.getElementsByTagName%28%27area%27%29%5B0%5D%3B%20w%28x.shape%20+%20%27%20%27%20+%20x.coords%29%3C/script%3E
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cp%3E%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/astrophy/128%22%20usemap%3D%23a%3E%0D%0A%3Cmap%20name%3Da%3E%3Carea%20shape%3Dcirc%20coords%3D%2220%2C20%2C10%25%22%20href%3D%23%3E%3Carea%20shape%3Dcirc%20coords%3D%2220%2C20%2C10%22%20href%3D%23%3E%3C/map%3E%0D%0A%3Cscript%3Edocument.write%28document.getElementsByTagName%28%27area%27%29%5B0%5D.coords%29%3C/script%3E

|