Skip to content

Commit

Permalink
[] (0) define usemap="" (first pass); make some notes for future stuf…
Browse files Browse the repository at this point in the history
…f to come

git-svn-id: http://svn.whatwg.org/webapps@566 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 6, 2007
1 parent 81eed2d commit c3f28f2
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 28 deletions.
87 changes: 71 additions & 16 deletions index
Expand Up @@ -264,6 +264,9 @@

<li><a href="#keywords"><span class=secno>3.2.6. </span>Keywords and
enumerated attributes</a>

<li><a href="#references0"><span class=secno>3.2.7.
</span>References</a>
</ul>

<li><a href="#documents0"><span class=secno>3.3. </span>Documents and
Expand Down Expand Up @@ -5332,6 +5335,36 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
<em>missing value default</em>), but for various reasons that isn't the
way this specification actually defines it.

<h4 id=references0><span class=secno>3.2.7. </span>References</h4>

<p>A <dfn id=valid6>valid hashed ID reference</dfn> to an element of type
<var title="">type</var> is a string consisting of a U+0023 NUMBER SIGN
(<code title="">#</code>) character followed by a string which exactly
matches the value of the <code title=attr-id><a href="#id0">id</a></code>
attribute of an element in the document with type <var
title="">type</var>.

<p>The <dfn id=rules4>rules for parsing a hashed ID reference</dfn> to an
element of type <var title="">type</var> are as follows:

<ol>
<li>
<p>If the string being parsed does not contain a U+0023 NUMBER SIGN
character, or if the first such character in the string is the last
character in the string, then return null and abort these steps.

<li>
<p>Let <var title="">s</var> be the string from the character immediately
after the first U+0023 NUMBER SIGN character in the string being parsed
up to the end of that string.

<li>
<p>Return the first element of type <var title="">type</var> that has an
<code title=attr-id><a href="#id0">id</a></code> or <code
title="">name</code> attribute whose value case-insensitively matches
<var title="">s</var>.
</ol>

<h3 id=documents0><span class=secno>3.3. </span>Documents and document
fragments</h3>

Expand Down Expand Up @@ -11440,7 +11473,7 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>

<dd><code title=attr-img-src><a href="#src">src</a></code> (required)

<dd><code title=attr-hyperlink-usemap><a href="#usemap1">usemap</a></code>
<dd><code title=attr-hyperlink-usemap><a href="#usemap2">usemap</a></code>

<dd><code title=attr-img-ismap><a href="#ismap">ismap</a></code> (but only
if one of the ancestor elements is an <code><a href="#a0">a</a></code>
Expand Down Expand Up @@ -11538,7 +11571,7 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
href="#img0">img</a></code> element.

<p>The <code title=attr-hyperlink-usemap><a
href="#usemap1">usemap</a></code> attribute, if present, can indicate that
href="#usemap2">usemap</a></code> attribute, if present, can indicate that
the image has an associated <a href="#image">image map</a>.

<p>The <dfn id=ismap title=attr-img-ismap><code>ismap</code></dfn>
Expand Down Expand Up @@ -11881,7 +11914,7 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
(required if <code title=attr-object-data><a href="#data">data</a></code>
is not given)

<dd><code title=attr-hyperlink-usemap><a href="#usemap1">usemap</a></code>
<dd><code title=attr-hyperlink-usemap><a href="#usemap2">usemap</a></code>

<dd><code title=attr-object-height>height</code>

Expand Down Expand Up @@ -12117,7 +12150,7 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
capabilities, with the user agent picking the best one it supports.

<p>The <code title=attr-hyperlink-usemap><a
href="#usemap1">usemap</a></code> attribute, if present while the <code><a
href="#usemap2">usemap</a></code> attribute, if present while the <code><a
href="#object0">object</a></code> element represents an image, can
indicate that the object has an associated <a href="#image">image map</a>.
The attribute must be ignored if the <code><a
Expand Down Expand Up @@ -13500,7 +13533,7 @@ interface <dfn id=imagedata>ImageData</dfn> {

<p>The <dfn id=name3 title=attr-map-name><code>name</code></dfn> attribute
gives the name of the image map, so that it can be referenced using the
<code title=attr-hyperlink-usemap><a href="#usemap1">usemap</a></code>
<code title=attr-hyperlink-usemap><a href="#usemap2">usemap</a></code>
attribute of <code><a href="#img0">img</a></code> and <code><a
href="#object0">object</a></code> elements.

Expand Down Expand Up @@ -13697,7 +13730,7 @@ interface <dfn id=imagedata>ImageData</dfn> {

<p>Interactive user agents should allow users to <a href="#following1"
title="following hyperlinks">follow hyperlinks</a> created for <a
href="#valid6" title="valid area">valid areas</a> using the <code><a
href="#valid7" title="valid area">valid areas</a> using the <code><a
href="#area0">area</a></code> element. The <code
title=attr-hyperlink-href><a href="#href5">href</a></code> and <code
title=attr-hyperlink-ping><a href="#ping">ping</a></code> attributes
Expand Down Expand Up @@ -13763,28 +13796,38 @@ interface <dfn id=imagedata>ImageData</dfn> {
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
-->

<p class=big-issue>...<dfn id=image>image map</dfn>, <dfn id=valid6>valid
area</dfn>, <dfn id=usemap1
<p>An <dfn id=image>image map</dfn> allows geometric areas on an image to
be associated with <a href="#hyperlinks" title=hyperlink>hyperlinks</a>.

<p>An image, in the form of an <code><a href="#img0">img</a></code> element
or an <code><a href="#object0">object</a></code> element representing an
image, may be associated with an image map (in the form of a <code><a
href="#map0">map</a></code> element) by specifying a <dfn id=usemap1
title=attr-hyperlink-usemap><code>usemap</code></dfn> attribute on the
<code><a href="#img0">img</a></code> or <code><a
href="#object0">object</a></code> element.

<p>The <coode title=attr-area-usemap>usemap attribute, if specified, must
be a <a href="#valid6">valid hashed ID reference</a> to a <code><a
href="#map0">map</a></code> element.</coode>

<p class=big-issue><dfn id=valid7>valid area</dfn>, <dfn id=usemap2
title=attr-hyperlink-usemap><code>usemap</code></dfn>, <dfn id=coords1
title=attr-area-coords><code>coords</code></dfn>, <dfn id=server>server
side image map</dfn>.</p>
<!-- usemap is special-cased when it starts with a "#".
does any browser support it when it doesn't? -->
<!-- http://lxr.mozilla.org/seamonkey/source/layout/generic/nsImageMap.cpp: parsing of coords, ordering of coord numbers when out of order -->
<!-- http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLAreaElement.cpp -->
<!-- coords doesn't take %s (not even for radius, despite HTML4's claims -->
<!-- coords parsing:

4. treat missing items as hidden shapes, focusable but not covering any part of the image
1. use rules for parsing lists of integers to get list of coords
2. treat those with missing coords as hidden shapes, focusable but not covering any part of the image
poly: < 6
rect: < 4
circ: < 3 or r<=0
...then abort
3. drop any excess items:
3. drop any excess coords:
poly: drop the last one if there's an odd number
rect: drop > 4
circ: drop > 3
5. reorder items:
4. reorder coords:
rect: rearrange (a,b,c,d) such that:
if a < c and b < d: a,b,c,d
if c < a and b < d: c,b,a,d
Expand Down Expand Up @@ -35690,6 +35733,18 @@ mutually exclusive sections:
different sections are the various states that the application can
reach.</p>


XXX make a consistent decision of which of the following formats to use:

U+1234 FOO BAR character ("foo")
U+1234 FOO BAR character (foo)
U+1234 FOO BAR ("foo") character
U+1234 FOO BAR (foo) character
U+1234 FOO BAR character ("<code title="">foo</code>")
U+1234 FOO BAR character (<code title="">foo</code>)
U+1234 FOO BAR ("<code title="">foo</code>") character
U+1234 FOO BAR (<code title="">foo</code>) character

-->
<script src="http://status.whatwg.org/annotate-web-apps.js"
type="text/javascript"></script>
75 changes: 63 additions & 12 deletions source
Expand Up @@ -4196,6 +4196,38 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
specification actually defines it.</p>


<h4>References</h4>

<p>A <dfn>valid hashed ID reference</dfn> to an element of type <var
title="">type</var> is a string consisting of a U+0023 NUMBER SIGN
(<code title="">#</code>) character followed by a string which
exactly matches the value of the <code title="attr-id">id</code>
attribute of an element in the document with type <var
title="">type</var>.</p>

<p>The <dfn>rules for parsing a hashed ID reference</dfn> to an
element of type <var title="">type</var> are as follows:</p>

<ol>

<li><p>If the string being parsed does not contain a U+0023 NUMBER
SIGN character, or if the first such character in the string is the
last character in the string, then return null and abort these
steps.</p></li>

<li><p>Let <var title="">s</var> be the string from the character
immediately after the first U+0023 NUMBER SIGN character in the
string being parsed up to the end of that string.</p></li>

<li><p>Return the first element of type <var title="">type</var>
that has an <code title="attr-id">id</code> or <code
title="">name</code> attribute whose value case-insensitively
matches <var title="">s</var>.</p></li>

</ol>




<h3>Documents and document fragments</h3>

Expand Down Expand Up @@ -11787,31 +11819,38 @@ interface <dfn>ImageData</dfn> {
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
-->

<p class="big-issue">...<dfn>image map</dfn>, <dfn>valid area</dfn>,
<dfn title="attr-hyperlink-usemap"><code>usemap</code></dfn>, <dfn
title="attr-area-coords"><code>coords</code></dfn>, <dfn>server side
image map</dfn>.</p>
<p>An <dfn>image map</dfn> allows geometric areas on an image to be
associated with <span title="hyperlink">hyperlinks</span>.</p>

<!-- usemap is special-cased when it starts with a "#".
does any browser support it when it doesn't? -->
<p>An image, in the form of an <code>img</code> element or an
<code>object</code> element representing an image, may be associated
with an image map (in the form of a <code>map</code> element) by
specifying a <dfn
title="attr-hyperlink-usemap"><code>usemap</code></dfn> attribute on
the <code>img</code> or <code>object</code> element.</p>

<!-- http://lxr.mozilla.org/seamonkey/source/layout/generic/nsImageMap.cpp: parsing of coords, ordering of coord numbers when out of order -->
<!-- http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLAreaElement.cpp -->
<p>The <coode title="attr-area-usemap">usemap</code> attribute, if
specified, must be a <span>valid hashed ID reference</span> to a
<code>map</code> element.</p>

<!-- coords doesn't take %s (not even for radius, despite HTML4's claims -->
<p class="big-issue"><dfn>valid area</dfn>, <dfn
title="attr-hyperlink-usemap"><code>usemap</code></dfn>, <dfn
title="attr-area-coords"><code>coords</code></dfn>, <dfn>server side
image map</dfn>.</p>

<!-- coords parsing:

4. treat missing items as hidden shapes, focusable but not covering any part of the image
1. use rules for parsing lists of integers to get list of coords
2. treat those with missing coords as hidden shapes, focusable but not covering any part of the image
poly: < 6
rect: < 4
circ: < 3 or r<=0
...then abort
3. drop any excess items:
3. drop any excess coords:
poly: drop the last one if there's an odd number
rect: drop > 4
circ: drop > 3
5. reorder items:
4. reorder coords:
rect: rearrange (a,b,c,d) such that:
if a < c and b < d: a,b,c,d
if c < a and b < d: c,b,a,d
Expand Down Expand Up @@ -32612,6 +32651,18 @@ mutually exclusive sections:
different sections are the various states that the application can
reach.</p>


XXX make a consistent decision of which of the following formats to use:

U+1234 FOO BAR character ("foo")
U+1234 FOO BAR character (foo)
U+1234 FOO BAR ("foo") character
U+1234 FOO BAR (foo) character
U+1234 FOO BAR character ("<code title="">foo</code>")
U+1234 FOO BAR character (<code title="">foo</code>)
U+1234 FOO BAR ("<code title="">foo</code>") character
U+1234 FOO BAR (<code title="">foo</code>) character

-->

<script src="http://status.whatwg.org/annotate-web-apps.js" type="text/javascript"></script>
Expand Down

0 comments on commit c3f28f2

Please sign in to comment.