Skip to content
This repository was archived by the owner on Jul 30, 2019. It is now read-only.

Commit 11364a3

Browse files
committed
Update coords parsing
1 parent 5a8e922 commit 11364a3

5 files changed

+33
-99
lines changed

sections/acknowledgements.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@
668668
Shanti Rao,
669669
Shaun Inman,
670670
Shiki Okasaka,
671+
Shubheksha Jalan,
671672
Sierk Bornemann,
672673
Sigbjørn Finne,
673674
Sigbjørn Vik,

sections/attributes.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
<th><code>coords</code></th>
174174
<td><{area}></td>
175175
<td>Coordinates for the shape to be created in an <a>image map</a></td>
176-
<td><a>Valid list of integers</a>*</td>
176+
<td><a>Valid list of floating-point numbers</a>*</td>
177177
</tr>
178178
<tr>
179179
<th><code>crossorigin</code></th>

sections/infrastructure.include

Lines changed: 24 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@
535535
However, WYSIWYG tools are legitimate. WYSIWYG tools should use elements they know are
536536
appropriate, and should not use elements that they do not know to be appropriate. This might
537537
in certain extreme cases mean limiting the use of flow elements to just a few elements, like
538-
<{div}>, <{b}>, <{i}>, and <{span}> and making liberal use of the <{global/style}>
538+
<{div}>, <{b}>, <{i}>, and <{a}> and making liberal use of the <{global/style}>
539539
attribute.
540540

541541
All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling
@@ -1929,100 +1929,35 @@
19291929
5. If <var>value</var> is a percentage, return <var>value</var> as a percentage.
19301930
6. Return <var>value</var> as a length.
19311931

1932-
<h5 id="lists-of-integers">Lists of integers</h5>
1932+
<h5 id="lists-of-floating-point-numbers">Lists of floating-point numbers</h5>
19331933

1934-
A <dfn>valid list of integers</dfn> is a number of <a>valid integers</a> separated by U+002C COMMA
1935-
characters, with no other characters (e.g., no <a>space characters</a>). In addition, there might
1936-
be restrictions on the number of integers that can be given, or on the range of values allowed.
1934+
A <dfn>valid list of floating-point numbers</dfn> is a number of
1935+
<a>valid floating-point numbers</a> separated by U+002C COMMA characters, with no other characters
1936+
(e.g. no <a>space characters</a>). In addition, there might be restrictions on the number of
1937+
floating-point numbers that can be given, or on the range of values allowed.
19371938

1938-
The <dfn>rules for parsing a list of integers</dfn> are as follows:
1939+
The <dfn>rules for parsing a list of floating-point numbers</dfn> are as follows:
19391940

19401941
1. Let <var>input</var> be the string being parsed.
19411942
2. Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start of
19421943
the string.
1943-
3. Let <var>numbers</var> be an initially empty list of integers. This list will be the
1944-
result of this algorithm.
1945-
4. If there is a character in the string <var>input</var> at position <var>position</var>, and
1946-
it is either a U+0020 SPACE, U+002C COMMA, or U+003B SEMICOLON character, then advance
1947-
<var>position</var> to the next character in <var>input</var>, or to beyond the end of the
1948-
string if there are no more characters.
1949-
5. If <var>position</var> points to beyond the end of <var>input</var>, return
1950-
<var>numbers</var> and abort.
1951-
6. If the character in the string <var>input</var> at position <var>position</var> is a U+0020
1952-
SPACE, U+002C COMMA, or U+003B SEMICOLON character, then return to step 4.
1953-
7. Let <var>negated</var> be false.
1954-
8. Let <var>value</var> be 0.
1955-
9. Let <var>started</var> be false. This variable is set to true when the parser sees a number
1956-
or a U+002D HYPHEN-MINUS character (-).
1957-
10. Let <var>got number</var> be false. This variable is set to true when the parser sees a
1958-
number.
1959-
11. Let <var>finished</var> be false. This variable is set to true to switch parser into a mode
1960-
where it ignores characters until the next separator.
1961-
12. Let <var>bogus</var> be false.
1962-
13. <i>Parser</i>: If the character in the string <var>input</var> at position <var>position</var> is:
1963-
<dl class="switch">
1964-
<dt>A U+002D HYPHEN-MINUS character</dt>
1965-
<dd>
1966-
Follow these substeps:
1967-
1. If <var>got number</var> is true, let <var>finished</var> be true.
1968-
2. If <var>finished</var> is true, skip to the next step in the overall set of steps.
1969-
3. If <var>started</var> is true, let <var>negated</var> be false.
1970-
4. Otherwise, if <var>started</var> is false and if <var>bogus</var> is false, let
1971-
<var>negated</var> be true.
1972-
5. Let <var>started</var> be true.
1973-
</dd>
1974-
1975-
<dt>An <a>ASCII digit</a></dt>
1976-
<dd>
1977-
Follow these substeps:
1978-
1. If <var>finished</var> is true, skip to the next step in the overall set of steps.
1979-
2. Multiply <var>value</var> by ten.
1980-
3. Add the value of the digit, interpreted in base ten, to <var>value</var>.
1981-
4. Let <var>started</var> be true.
1982-
5. Let <var>got number</var> be true.
1983-
</dd>
1984-
1985-
<dt>A U+0020 SPACE character</dt>
1986-
<dt>A U+002C COMMA character</dt>
1987-
<dt>A U+003B SEMICOLON character</dt>
1988-
<dd>
1989-
Follow these substeps:
1990-
1. If <var>got number</var> is false, return the <var>numbers</var> list and abort. This
1991-
happens if an entry in the list has no digits, as in "<code>1,2,x,4</code>".
1992-
2. If <var>negated</var> is true, then negate <var>value</var>.
1993-
3. Append <var>value</var> to the <var>numbers</var> list.
1994-
4. Jump to step 4 in the overall set of steps.
1995-
</dd>
1996-
1997-
<dt>
1998-
A character in the range U+0001 to U+001F, U+0021 to U+002B, U+002D to U+002F, U+003A,
1999-
U+003C to U+0040, U+005B to U+0060, U+007b to U+007F (i.e., any other non-alphabetic
2000-
ASCII character)
2001-
</dt>
2002-
<dd>
2003-
Follow these substeps:
2004-
1. If <var>got number</var> is true, let <var>finished</var> be true.
2005-
2. If <var>finished</var> is true, skip to the next step in the overall set of steps.
2006-
3. Let <var>negated</var> be false.
2007-
</dd>
2008-
2009-
<dt>Any other character</dt>
2010-
<dd>
2011-
Follow these substeps:
2012-
1. If <var>finished</var> is true, skip to the next step in the overall set of steps.
2013-
2. Let <var>negated</var> be false.
2014-
3. Let <var>bogus</var> be true.
2015-
4. If <var>started</var> is true, then return the <var>numbers</var> list, and abort.
2016-
(The value in <var>value</var> is not appended to the list first; it is dropped.)
2017-
</dd>
2018-
</dl>
2019-
14. Advance <var>position</var> to the next character in <var>input</var>, or to beyond the end
2020-
of the string if there are no more characters.
2021-
15. If <var>position</var> points to a character (and not to beyond the end of
2022-
<var>input</var>), jump to the big <i>Parser</i> step above.
2023-
16. If <var>negated</var> is true, then negate <var>value</var>.
2024-
17. If <var>got number</var> is true, then append <var>value</var> to the <var>numbers</var> list.
2025-
18. Return the <var>numbers</var> list and abort.
1944+
3. Let <var>numbers</var> be an initially empty list of floating-point numbers. This list will be
1945+
the result of this algorithm.
1946+
4. <a>Collect a sequence of characters</a> that are <a>space characters</a>, U+002C COMMA, or
1947+
U+003B SEMICOLON characters. This skips past any leading delimiters.
1948+
5. While <var>position</var> is not past the end of <var>input</var>:
1949+
1. <a>Collect a sequence of characters</a> that are not <a>space characters</a>, U+002C COMMA,
1950+
U+003B SEMICOLON, <a>ASCII digits</a>, U+002E FULL STOP, or U+002D HYPHEN-MINUS
1951+
characters. This skips past leading garbage.
1952+
2. <a>Collect a sequence of characters</a> that are not <a>space characters</a>, U+002C COMMA,
1953+
or U+003B SEMICOLON characters, and let <var>unparsed number</var> be the result.
1954+
3. Let <var>number</var> be the result of parsing <var>unparsed number</var> using the
1955+
<a>rules for parsing floating-point number values</a>.
1956+
4. If <var>number</var> is an error, set <var>number</var> to zero.
1957+
5. Append <var>number</var> to <var>numbers</var>.
1958+
6. <a>Collect a sequence of characters</a> that are <a>space characters</a>, U+002C COMMA, or
1959+
U+003B SEMICOLON characters. This skips past the delimiter.
1960+
6. Return <var>numbers</var>.
20261961

20271962
<h5 id="lists-of-dimensions">Lists of dimensions</h5>
20281963

sections/semantics-embedded-content.include

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5771,7 +5771,8 @@ zero or more <{track}> elements, then
57715771
Not displayed by the user agent.
57725772
</td></tr></tbody></table>
57735773

5774-
The attribute may be omitted. The <i>missing value default</i> is the <a>subtitles</a> state.
5774+
The attribute may be omitted. The <i>missing value default</i> is the <a>subtitles</a> state. The
5775+
<i>invalid value default</i> is the <a>metadata</a> state.
57755776

57765777
The <dfn element-attr for="track"><code>src</code></dfn> attribute gives the address of the text
57775778
track data. The value must be a <a>valid non-empty URL potentially surrounded by spaces</a>.
@@ -12943,7 +12944,7 @@ red:89
1294312944
The attribute may be omitted. The <i>missing value default</i> is the <a state for="area">rectangle state</a>.
1294412945

1294512946
The <dfn element-attr for="area"><code>coords</code></dfn> attribute must, if specified,
12946-
contain a <a>valid list of integers</a>. This attribute gives the coordinates for the shape
12947+
contain a <a>valid list of floating-point numbers</a>. This attribute gives the coordinates for the shape
1294712948
described by the <code>shape</code> attribute. <span class="impl">The
1294812949
processing for this attribute is described as part of the <a>image map</a> processing
1294912950
model.</span>
@@ -13160,9 +13161,9 @@ red:89
1316013161
<li>Find the state that the element's <code>shape</code> attribute
1316113162
represents.</li>
1316213163

13163-
<li>Use the <a>rules for parsing a list of integers</a> to parse the element's <code>coords</code> attribute, if it is present, and let the result be the
13164-
<var>coords</var> list. If the attribute is absent, let the <var>coords</var>
13165-
list be the empty list.</li>
13164+
<li>Use the <a>rules for parsing a list of floating-point numbers</a> to parse the element's
13165+
<code>coords</code> attribute, if it is present, and let the result be the <var>coords</var>
13166+
list. If the attribute is absent, let the <var>coords</var> list be the empty list.</li>
1316613167

1316713168
<li>
1316813169

sections/semantics-grouping-content.include

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,7 @@
983983
</dd>
984984
<dt><a>Content attributes</a>:</dt>
985985
<dd><a>Global attributes</a></dd>
986-
<dd>
987-
If the element is a child of an <{ol}> element: <code>value</code> - Ordinal value
988-
of the list item
989-
</dd>
986+
<dd>If the element is not a child of an <{ul}> or <{menu}> element: <code>value</code></dd>
990987
<dt>Allowed <a href="#aria-role-attribute">ARIA role attribute</a> values:</dt>
991988
<dd>
992989
<a value for="role"><code>listitem</code></a> role (default - <a><em>do not set</em></a>),

0 commit comments

Comments
 (0)