Re: [whatwg] Handling inside <body></span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=whatwg@lists.whatwg.org&q=from:%22Tommy+Thorsen%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Tommy Thorsen</span></span></a></span> <span class="date"><a href="/search?l=whatwg@lists.whatwg.org&q=date:20081111" rel="nofollow">Tue, 11 Nov 2008 02:55:36 -0800</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre style="margin: 0em;"> Ian Hickson wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> On Mon, 10 Nov 2008, Tommy Thorsen wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><tt>From an implementors point of view, it's good to have clearly defined </tt><tt>boundaries between modules. An implementation would typically have one </tt><tt>module that tokenises and parses html and one module that renders the </tt><tt>resulting dom to the screen. If all the unexpected input is dealt with </tt><tt>in the parsing module, then you can make some assumptions in the </tt><tt>rendering module which can greatly simplify the implementation. Having </tt><tt>to deal with an arbitrary amount of illegal input in either module is, </tt><tt>IMHO, not the ideal design. </tt><tt> </tt></blockquote><pre style="margin: 0em;"></pre><pre> </pre><tt>Unfortunately, we have little choice in the matter. Scripting and XML both </tt><tt>allow you to unambiguously create highly non-conforming DOMs, e.g. with </tt><tt><title> elements as the root element and <html> elements as children of </tt><tt><input> elements. The renderer has to deal with all such DOMs. </tt><pre style="margin: 0em;"> </pre><tt> </tt></blockquote><pre style="margin: 0em;"> I just came across another related problem. Consider the following markup: <!doctype html><select><title>TITLE</title></select> </pre><tt>My version of Firefox moves the title to head, Opera ignores the title </tt><tt>completely, and the html 5 parsing algorithm produces the following </tt><tt>peculiar markup: </tt><pre style="margin: 0em;"> <!DOCTYPE html> <html> <head></head> <body> <select>TITLE</select> </body> </html> </pre><tt>Should this title be allowed or ignored? Right now we ignore the start </tt><tt>and end tags, but insert the CDATA into the select element. I'm tempted </tt><tt>to ignore CDATA unless the current node is an option element in the "in </tt><tt>select" insertion mode. </tt><pre style="margin: 0em;"> </pre><tt>Since we were discussing scripts creating unexpected DOMs, I had to try </tt><tt>the following: </tt><pre style="margin: 0em;"> <!doctype html> <script> function button_onclick() { </pre><tt> document.getElementById('myselect').innerHTML = </tt><tt>'<title>TITLE</title>'; </tt><pre style="margin: 0em;"> alert('title inserted'); } </script> <select id="myselect"></select> <input type="button" value="Make Title" onclick="button_onclick();" /> </pre><tt>On Firefox, the title is inserted into the select element, but does not </tt><tt>actually work. Opera seems to prevent the title element from being </tt><tt>inserted into the select element altogether. </tt><pre style="margin: 0em;"> -Tommy </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg12189.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd11.html#12193">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail13.html#12193">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg12762.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg12170.html">[whatwg] Handling <title> inside <body></a></span> <span class="sender italic">Tommy Thorsen</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12166.html">Re: [whatwg] Handling <title> inside <body></a></span> <span class="sender italic">Simon Pieters</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12167.html">Re: [whatwg] Handling <title> inside <body...</a></span> <span class="sender italic">Tommy Thorsen</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12168.html">Re: [whatwg] Handling <title> inside <...</a></span> <span class="sender italic">Simon Pieters</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12173.html">Re: [whatwg] Handling <title> inside ...</a></span> <span class="sender italic">Ian Hickson</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12189.html">Re: [whatwg] Handling <title> in...</a></span> <span class="sender italic">Tommy Thorsen</span></li> <li class="icons-email tSliceCur"><span class="subject">Re: [whatwg] Handling <title> in...</span> <span class="sender italic">Tommy Thorsen</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12762.html">Re: [whatwg] Handling <title>...</a></span> <span class="sender italic">Ian Hickson</span></li> </ul></li> <li class="icons-email"><span class="subject"><a href="msg12208.html">Re: [whatwg] Handling <title> in...</a></span> <span class="sender italic">Garrett Smith</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12212.html">Re: [whatwg] Handling <title>...</a></span> <span class="sender italic">Ian Hickson</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg12220.html">Re: [whatwg] Handling <titl...</a></span> <span class="sender italic">Garrett Smith</span></li> <li class="icons-email"><span class="subject"><a href="msg12226.html">Re: [whatwg] Handling <titl...</a></span> <span class="sender italic">Ian Hickson</span></li> </ul> </ul> </ul> </ul> </ul> </ul> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="Re: [whatwg] Handling <title> inside <body>"> <input type="hidden" name="msgid" value="4919653A.1040209@kvaleberg.com"> <input type="hidden" name="relpath" value="whatwg@lists.whatwg.org/msg12193.html"> <input type="submit" value=" Tommy Thorsen "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="whatwg@lists.whatwg.org"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search whatwg"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/whatwg@lists.whatwg.org/">whatwg - all messages</a></li> <li class="icons-about"><a href="/whatwg@lists.whatwg.org/info.html">whatwg - about the list</a></li> <li class="icons-expand"><a href="/search?l=whatwg@lists.whatwg.org&q=subject:%22Re%5C%3A+%5C%5Bwhatwg%5C%5D+Handling+%3Ctitle%3E+inside+%3Cbody%3E%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg12189.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg12762.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">4919653A.1040209@kvaleberg.com</li> </ul> </div> </body> </html>