html5/spec Overview.html,1.2713,1.2714

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv23088

Modified Files:
	Overview.html 
Log Message:
setCustomValidity() message. (whatwg r3516)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2713
retrieving revision 1.2714
diff -u -d -r1.2713 -r1.2714
--- Overview.html	31 Jul 2009 23:00:32 -0000	1.2713
+++ Overview.html	1 Aug 2009 00:07:27 -0000	1.2714
@@ -175,7 +175,7 @@
    <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
    <!--ZZZ:-->
    <!--<h2 class="no-num no-toc">W3C Working Draft 23 April 2009</h2>-->
-   <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 31 July 2009</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 1 August 2009</h2>
    <!--:ZZZ-->
    <dl><!-- ZZZ: update the month/day (twice), (un)comment out
     <dt>This Version:</dt>
@@ -273,7 +273,7 @@
   track.
   <!--ZZZ:-->
   <!--This specification is the 23 April 2009 Working Draft.-->
-  This specification is the 31 July 2009 Editor's Draft.
+  This specification is the 1 August 2009 Editor's Draft.
   <!--:ZZZ-->
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href="http://www.whatwg.org/">WHATWG</a>. The two specifications are
   identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of)
@@ -8362,27 +8362,29 @@
      the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when the document has
      finished parsing</a>.</li>
 
-     <li><p><a href="#pause">Pause</a> until <var title="">the script</var>
-     has <a href="#completed-loading">completed loading</a>.</li>
-
-     <li><p><a href="#executing-a-script-block" title="executing a script block">Execute</a> <var title="">the script</var>.</li>
+     <li><p><i>Loop</i>: If <var title="">the script</var> is a
+     <code><a href="#script">script</a></code> element without a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute, then <a href="#executing-a-script-block" title="executing a script block">execute</a> <var title="">the
+     script</var>.</li>
 
-     <li><p>Remove <var title="">the script</var> from the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list
-     of scripts that will execute when the document has finished
-     parsing</a> (i.e. shift out the first entry in the
-     list).</li>
+     <li><p>If <var title="">the script</var> is not the last script
+     in the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when the document
+     has finished parsing</a>, then let <var title="">the
+     script</var> be the next script in that list, and return to the
+     step marked <i>loop</i>.</p>
 
-     <li><p>If there are any more entries in the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts
-     that will execute when the document has finished parsing</a>
-     then jump back to step 1.</li>
+     <li><p>Remove any scripts that were executed as part of this
+     algorithm from the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when
+     the document has finished parsing</a>.</li>
 
     </ol><!--
      TESTS: http://www.hixie.ch/tests/adhoc/html/parsing/script-defer-write/
-     Note: IE8 actually drops on the floor any scripts which in step 2
-     of the algorithm above aren't yet completely loaded. I don't want
-     to spec a race condition, though. The alternative to pausing like
-     above, however, is to blow away the doc if the external scripts
-     do document.write(), which apparently might cause issues.
+     Note: IE8 actually drops on the floor any scripts which had
+     src="" but aren't yet completely loaded, and executes the rest. I
+     don't want to spec a race condition, though, and other browser
+     vendors don't want to block on network I/O in
+     innerHTML. Unfortunately, this means that external scripts with
+     defer="" will blow away the document if they do document.write(),
+     which is incompatible with IE.
     --></li>
 
    <li>
@@ -32019,6 +32021,31 @@
   <a href="#custom-validity-error-message">custom validity error message</a> to the value of the given
   <var title="">message</var> argument.</p>
 
+  </div><div class="example">
+
+   <p>In the following example, a script checks the value of a form
+   control each time it is edited, and whenever it is not a valid
+   value, uses the <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code> method
+   to set an appropriate message.</p>
+
+   <pre>&lt;label&gt;Feeling: &lt;input name=f type="text" oninput="check(this)"&gt;&lt;/label&gt;
+&lt;script&gt;
+ function check(input) {
+   if (input.value == "good" ||
+       input.value == "fine" ||
+       input.value == "tired") {
+     input.setCustomValidity('"' + input.value + '" is not a feeling.');
+<!--   } else if (input.value == "...") {
+     input.setCustomValidity('...');
+-->   } else {
+     // input is fine -- reset the error message
+     input.setCustomValidity('');
+   }
+ }
+&lt;/script&gt;</pre>
+
+  </div><div class="impl">
+
   <p>The <dfn id="dom-cva-validity" title="dom-cva-validity"><code>validity</code></dfn>
   attribute must return a <code><a href="#validitystate">ValidityState</a></code> object that
   represents the <a href="#validity-states">validity states</a> of the element. This

Received on Saturday, 1 August 2009 00:07:45 UTC