--- a/master/changes.html Thu May 22 13:29:44 2014 +0200
+++ b/master/changes.html Thu May 22 23:08:23 2014 +0200
@@ -55,7 +55,7 @@
<li>Change all coordinate types to <a><length></a> in preparation for referencing css3-values..</li>
- <li>Add the <a>'script'</a> element to the content model of all elements.</li>
+ <li>Add the <a>'script'</a> element to the content model of all elements.</li>
</ul>
<h3 id="rendering">Rendering Model chapter</h3>
@@ -94,6 +94,10 @@
<li>Made <a>SVGElement</a> implement the <a>GlobalEventHandlers</a> interface from HTML.</li>
<li>Removed getStrokeBBox from <a>SVGGraphicsElement</a> and extended <a href="types.html#__svg__SVGGraphicsElement__getBBox">getBBox</a> with a dictionary argument that controls which parts of the element are included in the returned bounding box.</li>
+
+ <li>Allow leading and trailing whitespace in <a><length></a>, <a><angle></a>, <a><number></a> and <a><integer></a>.</li>
+
+ <li>Make whitespace include form feed (U+000C) to align with CSS and HTML.</li>
</ul>
<h3 id="structure">Document Structure chapter</h3>
--- a/master/definitions.xml Thu May 22 13:29:44 2014 +0200
+++ b/master/definitions.xml Thu May 22 23:08:23 2014 +0200
@@ -1213,6 +1213,8 @@
<symbol name='url' href='types.html#DataTypeIRI'/>
<symbol name='FuncIRI' href='types.html#DataTypeFuncIRI'/>
<symbol name='funciri' href='types.html#DataTypeFuncIRI'/>
+ <symbol name='whitespace' href='types.html#DataTypeWhitespace'/>
+ <symbol name='white space' href='types.html#DataTypeWhitespace'/>
<symbol name='XML-Name' href="types.html#DataTypeXML-Name"/>
<!-- ... terms (these will be generated later) .......................... -->
--- a/master/types.html Thu May 22 13:29:44 2014 +0200
+++ b/master/types.html Thu May 22 23:08:23 2014 +0200
@@ -217,6 +217,15 @@
([<a href='refs.html#ref-XML10'>XML10</a>], section 2.2).</p>
</dd>
+ <dt id='DataTypeWhitespace'><whitespace></dt>
+ <dd>
+ <p>White space is defined as one or more of the
+ following consecutive characters: "space" (U+0020), "tab" (U+0009), "line feed" (U+000A),
+ "form feed" (U+000C) and "carriage return" (U+000D).</p>
+
+ <pre class='grammar'><span id='WSP'>wsp</span> ::= ( #x9 | #x20 | #xA | #xC | #xD )</pre>
+ </dd>
+
<dt id='DataTypeChildSelector'><child-selector></dt>
<dd>
<p>A comma-separated list of <a>compound selectors</a>.
@@ -358,9 +367,9 @@
<dt id='DataTypeInteger'><integer></dt>
<dd>
<p>An <integer> is specified as an optional sign character ("+" or
- "-") followed by one or more digits "0" to "9":</p>
-
- <pre class='grammar'><span id='Integer'>integer</span> ::= [+-]? [0-9]+</pre>
+ "-") followed by one or more digits "0" to "9", optionally surrounded by whitespace:</p>
+
+ <pre class='grammar'><span id='Integer'>integer</span> ::= <a href='#WSP'>wsp</a>* [+-]? [0-9]+ <a href='#WSP'>wsp</a>*</pre>
<p>If the sign character is not present, the number is non-negative.</p>
@@ -410,7 +419,7 @@
<li>
<p>When a <length> is used in an SVG <a>presentation attribute</a>,
the syntax must match the following pattern:</p>
- <pre class='grammar'>length ::= <a href='#DataTypeNumber'>number</a> ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?</pre>
+ <pre class='grammar'>length ::= <a href='#WSP'>wsp</a>* <a href='#DataTypeNumber'>number</a> ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")? <a href='#WSP'>wsp</a>*</pre>
<p>The unit identifier, if present, must be in lower case; if
not present, the length value represents a distance in the
current user coordinate system.</p>
@@ -454,18 +463,14 @@
<dt id="DataTypeListOfStrings"><list-of-strings></dt>
<dd>
- <p>A <list-of-strings> consists of a separated sequence of <string>s.
- String lists are white space-separated, where white space is defined as one or more of the
- following consecutive characters: "space" (U+0020), "tab" (U+0009), "line feed" (U+000A) and
- "carriage return" (U+000D).</p>
+ <p>A <list-of-strings> consists of a white space-separated sequence of <string>s.</p>
<p>The following is an EBNF grammar describing the <list-of-strings> syntax:</p>
<pre>
list-of-strings ::= string
- | string wsp list-of-strings
-string ::= [^#x9#xA#xD#x20]*
-wsp ::= [#x9#xA#xD#x20]+
+ | string <a href='#WSP'>wsp</a>+ list-of-strings
+string ::= [^#x9#x20#xA#xC#xD]*
</pre>
</dd>
@@ -488,18 +493,12 @@
comma-separated, with optional white space before or after the comma,
or white space-separated.</p>
- <p>White space in lists is defined as one or more of the
- following consecutive characters: "space" (U+0020), "tab" (U+0009),
- "line feed" (U+000A), "carriage return" (U+000D)
- and "form-feed" (U+000C).</p>
-
<p>The following is a template for an EBNF grammar describing the
<list-of-<var>T</var>s> syntax:</p>
<pre class='grammar'><span id='ListOfTs'>list-of-<var>T</var>s</span> ::= <var>T</var>
| <var>T</var> <a href='#CommaWSP'>comma-wsp</a> <a href='#ListOfTs'>list-of-<var>T</var>s</a>
-<span id='CommaWSP'>comma-wsp</span> ::= (<a href='#WSP'>wsp</a>+ ","? <a href='#WSP'>wsp</a>*) | ("," <a href='#WSP'>wsp</a>*)
-<span id='WSP'>wsp</span> ::= (#x20 | #x9 | #xD | #xA)</pre>
+<span id='CommaWSP'>comma-wsp</span> ::= (<a href='#WSP'>wsp</a>+ ","? <a href='#WSP'>wsp</a>*) | ("," <a href='#WSP'>wsp</a>*)</pre>
<p>Within the SVG DOM, values of a <list-of-<var>T</var>s>
type are represented by an interface specific for the
@@ -523,8 +522,8 @@
a <number> is defined differently, to allow numbers with large magnitudes
to be specified more concisely:</p>
- <pre class='grammar'>number ::= <a href='#Integer'>integer</a> ([Ee] <a href='#DataTypeInteger'>integer</a>)?
- | [+-]? [0-9]* "." [0-9]+ ([Ee] <a href='#DataTypeInteger'>integer</a>)?</pre>
+ <pre class='grammar'>number ::= <a href='#WSP'>wsp</a>* <a href='#Integer'>integer</a> ([Ee] <a href='#DataTypeInteger'>integer</a>)?
+ | [+-]? [0-9]* "." [0-9]+ ([Ee] <a href='#DataTypeInteger'>integer</a>)? <a href='#WSP'>wsp</a>*</pre>
<p>Within the SVG DOM, a <number> is represented as a
<span class="DOMInterfaceName">float</span>, <a>SVGNumber</a> or a
@@ -537,8 +536,8 @@
<a><number></a> is optional.</p>
<pre class='grammar'>
-number-optional-number ::= <a href='#DataTypeNumber'>number</a>
- | <a href='#DataTypeNumber'>number</a> <a href='#CommaWSP'>comma-wsp</a> <a href='#DataTypeNumber'>number</a></pre>
+number-optional-number ::= <a href='#WSP'>wsp</a>* <a href='#DataTypeNumber'>number</a> <a href='#WSP'>wsp</a>*
+ | <a href='#WSP'>wsp</a>* <a href='#DataTypeNumber'>number</a> <a href='#CommaWSP'>comma-wsp</a> <a href='#DataTypeNumber'>number</a> <a href='#WSP'>wsp</a>*</pre>
<p>In the SVG DOM, a <number-optional-number> is represented
using a pair of <a>SVGAnimatedInteger</a> or <a>SVGAnimatedNumber</a>
@@ -558,7 +557,7 @@
<dd>
<p>Percentages are specified as a number followed by a "%" character:</p>
- <pre class='grammar'><span id='Percentage'>percentage</span> ::= <a href='#Number'>number</a> "%"</pre>
+ <pre class='grammar'><span id='Percentage'>percentage</span> ::= <a href='#WSP'>wsp</a>* <a href='#NumberStrict'>number</a> "%" <a href='#WSP'>wsp</a>*</pre>
<p>Note that the definition of <a href='#Number'><number></a> depends
on whether the percentage is specified in a style sheet or in an