|
535 | 535 | However, WYSIWYG tools are legitimate. WYSIWYG tools should use elements they know are
|
536 | 536 | appropriate, and should not use elements that they do not know to be appropriate. This might
|
537 | 537 | 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}> |
539 | 539 | attribute.
|
540 | 540 |
|
541 | 541 | All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling
|
|
1929 | 1929 | 5. If <var>value</var> is a percentage, return <var>value</var> as a percentage.
|
1930 | 1930 | 6. Return <var>value</var> as a length.
|
1931 | 1931 |
|
1932 |
| -<h5 id="lists-of-integers">Lists of integers</h5> |
| 1932 | +<h5 id="lists-of-floating-point-numbers">Lists of floating-point numbers</h5> |
1933 | 1933 |
|
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. |
1937 | 1938 |
|
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: |
1939 | 1940 |
|
1940 | 1941 | 1. Let <var>input</var> be the string being parsed.
|
1941 | 1942 | 2. Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start of
|
1942 | 1943 | 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>. |
2026 | 1961 |
|
2027 | 1962 | <h5 id="lists-of-dimensions">Lists of dimensions</h5>
|
2028 | 1963 |
|
|
0 commit comments