- From: poot <cvsmail@w3.org>
- Date: Mon, 11 Aug 2008 09:28:58 +0900 (JST)
- To: public-html-diffs@w3.org
Prepare the ground for insertAdjacentHTML(). (whatwg r2039) reset the insertion mode appropriately http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#reset DOM mutation events must not fire for changes caused by the UA parsing the document. (Conceptually, the parser is not mutating the DOM, it is constructing it.) This includes the parsing of any content inserted using document.write() and document.writeln() calls. [DOM3EVENTS] http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#mutation-during-parsing A start tag whose tag name is "script" http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#scriptTag document.write() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#document.write0 after body http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#after10 document.writeln(...) http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#document.writeln... innerHTML http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#innerhtml1 insertAdjacentHTML() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#insertadjacenthtml1 insertAdjacentHTML() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#insertadjacenthtml0 Running a script http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#running outerHTML http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#outerhtml insertAdjacentHTML() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#insertadjacenthtml outerHTML http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#outerhtml0 HTMLElement http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#htmlelement 3.7 Dynamic markup insertion http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#dynamic0 outerHTML http://people.w3.org/mike/diffs/html5/spec/Overview.1.1224.html#outerhtml1 http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1223&r2=1.1224&f=h http://html5.org/tools/web-apps-tracker?from=2038&to=2039 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1223 retrieving revision 1.1224 diff -u -d -r1.1223 -r1.1224 --- Overview.html 11 Aug 2008 00:07:12 -0000 1.1223 +++ Overview.html 11 Aug 2008 00:25:48 -0000 1.1224 @@ -27,7 +27,7 @@ for HTML and XHTML</h2> <h2 class="no-num no-toc" id=editors0><!-- "W3C Working Draft" --> - Editor's Draft <!--ZZZ-->10 August 2008</h2> + Editor's Draft <!--ZZZ-->11 August 2008</h2> <dl><!-- ZZZ: update the month/day <dt>This Version:</dt> @@ -199,7 +199,7 @@ <p>The W3C <a href="http://www.w3.org/html/wg/">HTML Working Group</a> is the W3C working group responsible for this specification's progress along - the W3C Recommendation track. <!--ZZZ:--> This specification is the 10 + the W3C Recommendation track. <!--ZZZ:--> This specification is the 11 August 2008 <!--ZZZ "Working Draft"-->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) --> @@ -7642,6 +7642,7 @@ // <a href="#dynamic3">dynamic markup insertion</a> attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>; attribute DOMString <a href="#outerhtml" title=dom-outerHTML>outerHTML</a>; + void <a href="#insertadjacenthtml" title=dom-insertAdjacentHTML>insertAdjacentHTML</a>(in DOMString position, in DOMString data); // <span>metadata attributes</span> attribute DOMString <a href="#id0" title=dom-id>id</a>; @@ -8708,18 +8709,12 @@ <h3 id=dynamic0><span class=secno>3.7 </span><dfn id=dynamic3>Dynamic markup insertion</dfn></h3> - <p>The <code title=dom-document-write><a - href="#document.write">document.write()</a></code> family of methods and - the <code title=dom-innerHTML><a - href="#innerhtml">innerHTML</a></code>/<code title=dom-outerHTML><a - href="#outerhtml">outerHTML</a></code> family of DOM attributes enable - script authors to dynamically insert markup into the document. - - <p>Because these APIs interact with the parser, their behavior varies - depending on whether they are used with <a href="#html-">HTML - documents</a> (and the <a href="#html-0">HTML parser</a>) or XHTML in <a - href="#xml-documents">XML documents</a> (and the <span>XML parser</span>). - The following table cross-references the various versions of these APIs. + <p>APIs for dynamically inserting markup into the document interact with + the parser, and thus their behavior varies depending on whether they are + used with <a href="#html-">HTML documents</a> (and the <a + href="#html-0">HTML parser</a>) or XHTML in <a href="#xml-documents">XML + documents</a> (and the <span>XML parser</span>). The following table + cross-references the various versions of these APIs. <table> <thead> @@ -8763,6 +8758,17 @@ title=dom-outerHTML-HTML><code>outerHTML</code> in HTML</a> <td><a href="#outerhtml1" title=dom-outerHTML-XML>not supported</a> + + <tr> + <th><dfn id=insertadjacenthtml + title=dom-insertAdjacentHTML><code>insertAdjacentHTML()</code></dfn> + + <td><a href="#insertadjacenthtml0" + title=dom-insertAdjacentHTML-HTML><code>insertAdjacentHTML()</code> in + HTML</a> + + <td><a href="#insertadjacenthtml1" title=dom-insertAdjacentHTML-XML>not + supported</a> </table> <p>Regardless of the parsing mode, the <dfn id=document.writeln... @@ -8775,8 +8781,10 @@ <p class=note>The <code title=dom-innerHTML><a href="#innerhtml">innerHTML</a></code> attribute applies to both <code>Element</code> nodes as well as <code>Document</code> nodes. The - <code title=dom-outerHTML><a href="#outerhtml">outerHTML</a></code> - attribute, on the other hand, only applies to <code>Element</code> nodes. + <code title=dom-outerHTML><a href="#outerhtml">outerHTML</a></code> and + <code title=dom-insertAdjacentHTML><a + href="#insertadjacenthtml">insertAdjacentHTML</a></code> attributes, on + the other hand, only apply to <code>Element</code> nodes. <p class=note>When inserted using the <code title=dom-document-write><a href="#document.write">document.write()</a></code> method, <code><a @@ -9120,7 +9128,12 @@ its place all the <var title="">new children</var> nodes, preserving their order.</p> </ol> - <!-- XXX must make sure we spec that innerHTML causes mutation + + <hr> + + <p class=big-issue><dfn id=insertadjacenthtml0 + title=dom-insertAdjacentHTML-HTML><code>insertAdjacentHTML()</code></dfn></p> + <!-- XXX must make sure we spec that innerHTML et al causes mutation events to fire, but document.write() doesn't. (the latter is already req-stated in the parser section, btw) --> <!-- http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp --> @@ -9265,8 +9278,10 @@ <hr> <p>In an XML context, the <dfn id=document.write0 - title=dom-document-write-XML><code>document.write()</code></dfn> method, - and the <dfn id=outerhtml1 + title=dom-document-write-XML><code>document.write()</code></dfn> and <dfn + id=insertadjacenthtml1 + title=dom-insertAdjacentHTML-XML><code>insertAdjacentHTML()</code></dfn> + methods, and the <dfn id=outerhtml1 title=dom-outerHTML-XML><code>outerHTML</code></dfn> attribute on both getting and setting, must raise an <code>INVALID_ACCESS_ERR</code> exception.</p> @@ -26210,8 +26225,8 @@ parser</span> that itself was created as part of the processing of the <code title=dom-innerHTML-XML><a href="#innerhtml1">innerHTML</a></code> attribute's setter<!-- - no need to worry about the innerHTML-HTML case, as the HTML parser - handles that for us, and outerHTML-XML doesn't work-->, + no need to worry about the HTML case, as the HTML parser handles + that for us -->, or if the user agent does not <a href="#support">support the scripting language</a> given by <var><a href="#the-scripts">the script's type</a></var> for this <code><a href="#script1">script</a></code> @@ -45949,9 +45964,10 @@ something other than a <link> or a <style> element; you'd expect that to break out of the <noscript> but it doesn't. This is an edge case that doesn't affect the spec, since the algorithm for fragment - parsing is only used for innerHTML/outerHTML, where we know - scripting is enabled. (XXX except maybe if innerHTML is set from - another browsing context on a document with designMode set?) --> + parsing is only used for innerHTML/outerHTML/insertAdjacentHTML(), + where we know scripting is enabled. (XXX except maybe if innerHTML + is set from another browsing context on a document with designMode + set?) --> <li>If <var title="">node</var> is a <code><a href="#body0">body</a></code> element, then switch the <span>insertion @@ -48133,11 +48149,8 @@ content inserted using <code title=dom-document-write-HTML><a href="#document.write...">document.write()</a></code> and <code title=dom-document-writeln><a - href="#document.writeln...">document.writeln()</a></code> calls.<!-- - XXX xref --> - <a href="#references">[DOM3EVENTS]</a></p> - <!-- XXX - what about innerHTML? --> + href="#document.writeln...">document.writeln()</a></code> calls. <a + href="#references">[DOM3EVENTS]</a> <p class=note>Not all of the tag names mentioned below are conformant tag names in this specification; many are included to handle legacy content. @@ -49101,10 +49114,12 @@ element as "already executed" prevents it from executing when it is inserted into the document a few paragraphs below. Thus, scripts missing their end tags and scripts that were inserted using <code - title=dom-innerHTML-HTML><a - href="#innerhtml0">innerHTML</a></code>/<code - title=dom-outerHTML-HTML><a href="#outerhtml0">outerHTML</a></code> - aren't executed.</p> + title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>, + <code title=dom-outerHTML-HTML><a + href="#outerhtml0">outerHTML</a></code>, or <code + title=dom-insertAdjacentHTML-HTML><a + href="#insertadjacenthtml0">insertAdjacentHTML()</a></code> aren't + executed.</p> <p>Let the <var title="">old insertion point</var> have the same value as the current <a href="#insertion">insertion point</a>. Let the <a @@ -51502,9 +51517,7 @@ href="#html-fragment0">HTML fragment parsing algorithm</a>, this is a <a href="#parse2">parse error</a>; ignore the token. (<a href="#fragment">fragment case</a>)</p> - <!-- can only happen for <html>'s own innerHTML or its children's - outerHTML --> - + <p>Otherwise, switch the <span>insertion mode</span> to "<a href="#after12" title="insertion mode: after after body">after after body</a>".</p>
Received on Monday, 11 August 2008 00:29:36 UTC