Markup cleanup.
authorCameron McCormack <cam@mcc.id.au>
Thu, 17 May 2012 15:26:24 +1000
changeset 83 1cd17a911e77
parent 82 3258d00da823
child 84 05d08f47d660
Markup cleanup.
master/script.html
--- a/master/script.html	Thu May 17 15:17:55 2012 +1000
+++ b/master/script.html	Thu May 17 15:26:24 2012 +1000
@@ -53,39 +53,19 @@
 <h2 id="ScriptElement">The <span class="element-name">'script'</span> element</h2>
 
 <div class="annotation">
- <p>
-   SVG2 Requirement:  Consider allowing async/defer on &lt;svg:script&gt;
- </p>
- <p>
-   Resolution: SVG 2 will allow async/defer on &lt;svg:script&gt;
- </p>
- <p>
-   <a href="http://www.w3.org/2012/01/05-svg-irc#T21-07-03">5 January 2012 SVG WG telcon</a>.
- </p>
- <p>
-   Purpose: To align with the HTML script element
- </p>
- <p>
-   Owner: Cameron (ACTION-3280)
- </p>
+  <p>SVG2 Requirement:  Consider allowing async/defer on &lt;svg:script&gt;</p>
+  <p>Resolution: SVG 2 will allow async/defer on &lt;svg:script&gt;</p>
+  <p><a href="http://www.w3.org/2012/01/05-svg-irc#T21-07-03">5 January 2012 SVG WG telcon</a>.</p>
+  <p>Purpose: To align with the HTML script element</p>
+  <p>Owner: Cameron (ACTION-3280)</p>
 </div>
 
 <div class="annotation">
- <p>
-   SVG2 Requirement: Incorporate SVG Tiny 1.2 script processing model
- </p>
- <p>
-   Resolution: SVG 2 will define how inline scriptable content will be processed, in a compatible way to HTML5
- </p>
- <p>
-   <a href="http://www.w3.org/2012/03/08-svg-irc#T21-09-09">8 March 2012 SVG WG telcon</a>.
- </p>
- <p>
-   Purpose: To have consistent script running behaviour across HTML and SVG
- </p>
- <p>
-   Owner: Cameron (ACTION-3282)
- </p>
+  <p>SVG2 Requirement: Incorporate SVG Tiny 1.2 script processing model</p>
+  <p>Resolution: SVG 2 will define how inline scriptable content will be processed, in a compatible way to HTML5</p>
+  <p><a href="http://www.w3.org/2012/03/08-svg-irc#T21-09-09">8 March 2012 SVG WG telcon</a>.</p>
+  <p>Purpose: To have consistent script running behaviour across HTML and SVG</p>
+  <p>Owner: Cameron (ACTION-3282)</p>
 </div>
 
 <p>A <a>'script'</a> element is equivalent to the <a>'script'</a> element in
@@ -106,19 +86,21 @@
 <a>'onactivate'</a> event attribute should be used instead of the
 <a>'onclick'</a> event attribute.</p>
 
-<p id="ScriptElementExecution">Before attempting to execute the <a>'script'</a> element the resolved media type value for <a>'script/type'</a> must be inspected. 
-If the <a>SVG user agent</a> does not support the scripting language then the <a>'script'</a> element must not be executed.
-</p>
+<p id="ScriptElementExecution">Before attempting to execute the <a>'script'</a>
+element the resolved media type value for <a>'script/type'</a> must be inspected.
+If the <a>SVG user agent</a> does not support the scripting language then the
+<a>'script'</a> element must not be executed.</p>
 
-<pre class="xml">&lt;?xml version="1.0" standalone="no"?&gt;
-&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
-  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt;
-&lt;svg width="6cm" height="5cm" viewBox="0 0 600 500"
-     xmlns="http://www.w3.org/2000/svg" version="1.1"&gt;
-  &lt;desc&gt;Example script01 - invoke an ECMAScript function from an onclick event
-  &lt;/desc&gt;
-  &lt;!-- ECMAScript to change the radius with each click --&gt;
-  &lt;script type="application/ecmascript"&gt; &lt;![CDATA[
+<pre class="xml"><![CDATA[
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="6cm" height="5cm" viewBox="0 0 600 500"
+     xmlns="http://www.w3.org/2000/svg" version="1.1">
+  <desc>Example script01 - invoke an ECMAScript function from an onclick event
+  </desc>
+  <!-- ECMAScript to change the radius with each click -->
+  <script type="application/ecmascript"> ]]>&lt;![CDATA[<![CDATA[
     function circle_click(evt) {
       var circle = evt.target;
       var currentRadius = circle.getAttribute("r");
@@ -127,21 +109,36 @@
       else
         circle.setAttribute("r", currentRadius*0.5);
     }
-  ]]&gt; &lt;/script&gt;
-
-  &lt;!-- Outline the drawing area with a blue line --&gt;
-  &lt;rect x="1" y="1" width="598" height="498" fill="none" stroke="blue"/&gt;
+  ]]>]]&gt;<![CDATA[ </script>
 
-  &lt;!-- Act on each click event --&gt;
-  &lt;circle onclick="circle_click(evt)" cx="300" cy="225" r="100"
-          fill="red"/&gt;
+  <!-- Outline the drawing area with a blue line -->
+  <rect x="1" y="1" width="598" height="498" fill="none" stroke="blue"/>
 
-  &lt;text x="300" y="480" 
-        font-family="Verdana" font-size="35" text-anchor="middle"&gt;
+  <!-- Act on each click event -->
+  <circle onclick="circle_click(evt)" cx="300" cy="225" r="100"
+          fill="red"/>
+
+  <text x="300" y="480" 
+        font-family="Verdana" font-size="35" text-anchor="middle">
 
     Click on circle to change its size
-  &lt;/text&gt;
-&lt;/svg&gt;</pre><table summary="Example script01"><caption align="bottom">Example script01</caption><tbody><tr><td><img alt="Example script01 — invoke an ECMAScript function from an onclick event — before first click" src="images/script/script01.png"/>&nbsp;<img alt="Example script01 — invoke an ECMAScript function from an onclick event — after first click" src="images/script/script01-AfterClick.png"/></td></tr></tbody></table><p class="view-as-svg"><a href="images/script/script01.svg">View this example as SVG (SVG-enabled browsers only)</a></p>
+  </text>
+</svg>
+]]></pre>
+
+<!--
+  It would be good to replace this markup with an <edit:example>, but that
+  currently doesn't support multiple images like this example needs.
+  -->
+<table summary="Example script01">
+  <caption align="bottom">Example script01</caption>
+  <tbody>
+    <tr>
+      <td><img alt="Example script01 — invoke an ECMAScript function from an onclick event — before first click" src="images/script/script01.png"/>&nbsp;<img alt="Example script01 — invoke an ECMAScript function from an onclick event — after first click" src="images/script/script01-AfterClick.png"/></td>
+    </tr>
+  </tbody>
+</table>
+<p class="view-as-svg"><a href="images/script/script01.svg">View this example as SVG (SVG-enabled browsers only)</a></p>
 
 
 <edit:elementsummary name='script'/>
@@ -270,18 +267,20 @@
 
 <p>Below are the definitions for the <a>document event attributes</a>.
 These can be specified only on <a>'svg'</a> elements.</p>
-<p class="issue">
-	The conformance class for the 'only-on-&lt;svg> elements' criteria needs to be clarified here (this is for document validation presumably, so perhaps <a href="conform.html#ConformingSVGDocuments">Conforming SVG Document Fragments</a>
-	would be appropriate to mention), the <a>document event attributes</a> should be fine to specify on any element, they just don't do much in all such cases,
-	and it makes sense to not encourage uses where it doesn't have any real meaning.
 
-	For <a href="conform.html#ConformingDynamicSVGViewers">Conforming Dynamic SVG Viewers</a>: what the <a>document event attributes</a> should do is register an event listener for the event in question.
-</p>
-<p class="issue">
-	'onerror' should be available on image, script and elements that load external resources.
-	This is related to issue <a href="http://www.w3.org/Graphics/SVG/WG/track/issues/2254">2254</a>.
-</p>
+<p class="issue">The conformance class for the 'only-on-&lt;svg> elements'
+criteria needs to be clarified here (this is for document validation presumably,
+so perhaps <a href="conform.html#ConformingSVGDocuments">Conforming SVG Document Fragments</a>
+would be appropriate to mention), the <a>document event attributes</a> should be
+fine to specify on any element, they just don't do much in all such cases, and
+it makes sense to not encourage uses where it doesn't have any real meaning.
+For <a href="conform.html#ConformingDynamicSVGViewers">Conforming Dynamic SVG Viewers</a>:
+what the <a>document event attributes</a> should do is register an event listener
+for the event in question.</p>
 
+<p class="issue">'onerror' should be available on image, script and elements
+that load external resources.  This is related to issue
+<a href="http://www.w3.org/Graphics/SVG/WG/track/issues/2254">2254</a>.</p>
 
 <div class="adef-list">
   <p><em>Attribute definitions:</em></p>