spec/Overview.html 1.2088 2923 Add example of form association in weird

Add example of form association in weird case. (credit: js) (whatwg
r2923)

reset the form owner
http://people.w3.org/mike/diffs/html5/spec/Overview.1.2088.html#reset-the-form-owner

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2087&r2=1.2088&f=h
http://html5.org/tools/web-apps-tracker?from=2922&to=2923

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2087
retrieving revision 1.2088
diff -u -d -r1.2087 -r1.2088
--- Overview.html 30 Mar 2009 22:56:11 -0000 1.2087
+++ Overview.html 30 Mar 2009 23:53:46 -0000 1.2088
@@ -29767,7 +29767,38 @@
 
    <li><p>Otherwise, the element is left unassociated.</li>
 
-  </ol></div><dl class=domintro><dt><var title="">element</var> . <code title=dom-fae-form><a href=#dom-fae-form>form</a></code></dt>
+  </ol><div class=example>
+
+   <p>In the following non-conforming snippet:</p>
+
+   <pre class=bad>...
+ &lt;form id="a"&gt;
+  &lt;div id="b"&gt;&lt;/div&gt;
+ &lt;/form&gt;
+ &lt;script&gt;
+  document.getElementById('b').innerHTML =
+     '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;form id="c"&gt;&lt;input id="d"&gt;&lt;/table&gt;' +
+     '&lt;input id="e"&gt;';
+ &lt;/script&gt;
+...</pre>
+
+   <p>The <a href=#form-owner>form owner</a> of "d" would be the inner nested
+   form "c", while the <a href=#form-owner>form owner</a> of "e" would be the
+   outer form "a".</p>
+
+   <p>This is because despite the association of "e" with "c" in the
+   <a href=#html-parser>HTML parser</a>, when the <code title=dom-innerHTML><a href=#dom-innerhtml>innerHTML</a></code> algorithm moves the nodes
+   from the temporary document to the "b" element, the nodes see their
+   ancestor chain change, and thus all the "magic" associations done
+   by the parser are reset to normal ancestor associations.</p>
+
+   <p>This example is a non-conforming document, though, as it is a
+   violation of the content models to nest <code><a href=#the-form-element>form</a></code>
+   elements.</p>
+
+  </div>
+
+  </div><dl class=domintro><dt><var title="">element</var> . <code title=dom-fae-form><a href=#dom-fae-form>form</a></code></dt>
 
    <dd>

Received on Monday, 30 March 2009 23:56:25 UTC