W3C home > Mailing lists > Public > public-html-diffs@w3.org > January 2009

spec/Overview.html 1.1844 2674 Allow authors to include documentation i

From: poot <cvsmail@w3.org>
Date: Fri, 16 Jan 2009 10:50:17 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20090116015017.73B2F2BC9B@toro.w3.mag.keio.ac.jp>

Allow authors to include documentation inside <script> blocks that have
src='' attributes. (credit: sp) (whatwg r2674)

Index
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1844.html#index
4.3.1.1 Scripting languages
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1844.html#scriptingLanguages
4.3.2 The noscript element
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1844.html#the-noscript-element
4.3.1.2 Inline documentation for external scripts
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1844.html#inline-documentation-for-external-scripts
4.3.1 The script element
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1844.html#script

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1843&r2=1.1844&f=h
http://html5.org/tools/web-apps-tracker?from=2673&to=2674

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1843
retrieving revision 1.1844
diff -u -d -r1.1843 -r1.1844
--- Overview.html	16 Jan 2009 01:09:13 -0000	1.1843
+++ Overview.html	16 Jan 2009 01:45:40 -0000	1.1844
@@ -279,7 +279,8 @@
     <ol>
      <li><a href=#script><span class=secno>4.3.1 </span>The <code>script</code> element</a>
       <ol>
-       <li><a href=#scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</a></ol></li>
+       <li><a href=#scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</a></li>
+       <li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.2 </span>Inline documentation for external scripts</a></ol></li>
      <li><a href=#the-noscript-element><span class=secno>4.3.2 </span>The <code>noscript</code> element</a></li>
      <li><a href=#the-eventsource-element><span class=secno>4.3.3 </span>The <code>eventsource</code> element</a></ol></li>
    <li><a href=#sections><span class=secno>4.4 </span>Sections</a>
@@ -7890,7 +7891,8 @@
    <dd>If there is no <code title=attr-script-src><a href=#attr-script-src>src</a></code>
    attribute, depends on the value of the <code title=attr-script-type><a href=#attr-script-type>type</a></code> attribute.</dd>
    <dd>If there <em>is</em> a <code title=attr-script-src><a href=#attr-script-src>src</a></code>
-   attribute, the element must be empty.</dd>
+   attribute, the element must be either empty or contain only
+   <a href=#inline-documentation-for-external-scripts>script documentation</a>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title=attr-script-src><a href=#attr-script-src>src</a></code></dd>
    <dd><code title=attr-script-async><a href=#attr-script-async>async</a></code></dd>
@@ -8364,7 +8366,38 @@
   user agents must not ignore unknown MIME parameters &mdash; types
   with unknown parameters must be assumed to be unsupported.</p><!--
    XXX we should reference #references http://www.ietf.org/rfc/rfc4329
-  --><h4 id=the-noscript-element><span class=secno>4.3.2 </span>The <dfn><code>noscript</code></dfn> element</h4><dl class=element><dt>Categories</dt>
+  --><h5 id=inline-documentation-for-external-scripts><span class=secno>4.3.1.2 </span><dfn title="script documentation">Inline documentation for external scripts</dfn></h5><p>If a <code><a href=#script>script</a></code> element's <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute is specified, then the
+  contents of the <code><a href=#script>script</a></code> element, if any, must be such
+  that the value of the DOM <code title=dom-script-text><a href=#dom-script-text>text</a></code>
+  attribute, which is derived from the element's contents, matches the
+  <code>documentation</code> production in the following ABNF. <a href=#references>[ABNF]</a></p><!-- XXX
+  ftp://ftp.rfc-editor.org/in-notes/std/std68.txt --><pre>documentation ::= *( *( space / tab / comment ) [ line-comment ] newline )
+comment       ::= slash star *( not-star / star not-slash ) 1*star slash
+line-comment  ::= slash slash *not-newline
+space         ::= &lt; a U+0020 SPACE character &gt;
+tab           ::= &lt; a U+0009 TAB character &gt;
+newline       ::= &lt; a U+000A LINE FEED character &gt;
+star          ::= &lt; a U+002A ASTERISK character &gt;
+slash         ::= &lt; a U+002F SOLIDUS character &gt;
+not-star      ::= &lt; a single Unicode character other than a U+002A ASTERISK character &gt;
+not-slash     ::= &lt; a single Unicode character other than a U+002F SOLIDUS character &gt;
+not-newline   ::= &lt; a single Unicode character other than a U+000A LINE FEED character &gt;</pre><div class=example>
+
+   <p>This allows authors to include documentation, such as license
+   information or API information, inside their documents while still
+   referring to external script files. The syntax is constrained so
+   that authors don't accidentally include what looks like valid
+   script while also providing a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute.</p>
+
+   <pre>&lt;script src="cool-effects.js"&gt;
+ // create new instances using:
+ //    var e = new Effect();
+ // start the effect using .play, stop using .stop:
+ //    e.play();
+ //    e.stop();
+&lt;/script&gt;</pre>
+
+  </div><h4 id=the-noscript-element><span class=secno>4.3.2 </span>The <dfn><code>noscript</code></dfn> element</h4><dl class=element><dt>Categories</dt>
    <dd><a href=#metadata-content-0>Metadata content</a>.</dd>
    <dd><a href=#flow-content-0>Flow content</a>.</dd>
    <dd><a href=#phrasing-content-0>Phrasing content</a>.</dd>
@@ -46057,4 +46090,6 @@
        form data set the way that is done today.
  XXX * placeholder="" for <textarea>, e.g. as seen on:
        http://code.google.com/p/support/issues/detail?id=1#makechanges
+ XXX * become more consistent about what markup we use to mark up
+       productions (nothing? <i>? <code>?)
 -->
Received on Friday, 16 January 2009 01:50:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:13:57 GMT