Re: [whatwg] HTML as a text format: Should be optional?</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=whatwg@lists.whatwg.org&q=from:%22Brian+Campbell%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Brian Campbell</span></span></a></span> <span class="date"><a href="/search?l=whatwg@lists.whatwg.org&q=date:20090923" rel="nofollow">Wed, 23 Sep 2009 13:31:49 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre style="margin: 0em;"> On Jun 4, 2009, at 6:42 PM, Ian Hickson wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> On Fri, 17 Apr 2009, Øistein E. Andersen wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"></pre><pre> </pre><tt>A <title> is usually a good idea, but is it really necessary to </tt><tt>require </tt><pre style="margin: 0em;"> this for conformance? After all, a <title> is not something which an author is likely to forget, and leaving it out has no unexpected consequences. </pre></blockquote><pre style="margin: 0em;"> Leaving it out has a pretty important consequence, it breaks user </pre><tt>interfaces that need to refer to the document, e.g. "bookmarks" </tt><tt>features </tt><pre style="margin: 0em;"> in browsers. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>HTML documents sometimes occur in places in which they are not </tt><tt>independently bookmarkable, such as in an HTML email, or embedded in </tt><tt>an Atom or RSS feed. </tt><pre style="margin: 0em;"> </pre><tt>They also sometimes occur in places in which it's generally not </tt><tt>expected that someone will bookmark them, nor particularly easy to do </tt><tt>so, such as within an iframe which is being used for a gadget or some </tt><tt>sort of sandboxed content that isn't really independent of the </tt><tt>containing page. </tt><pre style="margin: 0em;"> </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> On Sat, 18 Apr 2009, Randy Drielinger wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> </pre><tt>If you're converting from a textfile, title could refer to the </tt><tt>filename. </tt><pre style="margin: 0em;"> If it's an automated process, it can be added by default. </pre><tt>If it's manual, they'll have to remember the short html5 doctype </tt><tt>and the </tt><pre style="margin: 0em;"> title element. </pre></blockquote><pre style="margin: 0em;"> It does indeed seem easy to include it. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>Yes, but sometimes you don't have a reasonable value for the title. </tt><tt>Say you are converting some word processing document format to HTML </tt><tt>(or spreadsheet, or slides, or anything of the sort); what would you </tt><tt>use if there isn't any sort of heading to take the title from? </tt><pre style="margin: 0em;"> </pre><tt>There are several options (you could use the filename, or look for </tt><tt>anything heading like, or use the first couple of words), but if a </tt><tt><title> element is missing, then the user agent could do the same. </tt><pre style="margin: 0em;"> </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> On Sat, 18 Apr 2009, Øistein E. Andersen wrote: </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> </pre><tt>It could, but chances are that the original filename would </tt><tt>typically be </tt><pre style="margin: 0em;"> less useful than the URL, which is what most browsers use when the <title> element is omitted, so this rather sounds like an argument against forcing authors to include a <title>. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>I don't see why this would be the case. In practice, however, if one </tt><tt>is at </tt><pre style="margin: 0em;"> a loss as to what to use for the <title>, but one has an <h1>, then I would recommend using the <h1>'s contents. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>This has the problem of duplicating content, which may get out of </tt><tt>sync. And why can't the user agent just extract the title from the </tt><tt>heading if it needs it rather than the generator? </tt><pre style="margin: 0em;"> </pre><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><blockquote style="border-left: #5555EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;"> Yes, my concern is that a validator should be useful as an authoring tool and not overwhelm the author with spurious errors. As I see it, leaving out <title> is very much like leaving out a paragraph of text and not something that should matter for validation. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>As it affects user interfaces, and since the cost of including a </tt><tt><title> </tt><pre style="margin: 0em;"> is so low, I think it makes sense to continue to make it required. </pre></blockquote><pre style="margin: 0em;"> </pre><tt>As it's something that affects the user interface in a fairly visible </tt><tt>way, it's not likely that many authors will neglect to use it if it's </tt><tt>useful to do so. However, in some cases it is not possible to include </tt><tt>a title, or there isn't any really useful title to include, so I'm not </tt><tt>sure why it should be required in those cases. </tt><pre style="margin: 0em;"> </pre><tt>This seems somewhat analogous to the <img alt> case; there are some </tt><tt>times when you don't have any useful text to put in there, and putting </tt><tt>in auto-generated placeholder text just to conform seems less than </tt><tt>useful. The number of pages unhelpfully titled "Untitled" or "Untitled </tt><tt>page" seems to confirm this. </tt><pre style="margin: 0em;"> </pre><tt>There are other cases in which a title just isn't all that useful, </tt><tt>like an iframe; the title will be invisible, and it's pretty uncommon </tt><tt>for people to open that iframe in a new tab and then bookmark it from </tt><tt>there (unless maybe they happen to be web geeks like us). For example, </tt><tt>see Google Gadgets <<a rel="nofollow" href="http://www.google.com/webmasters/gadgets/">http://www.google.com/webmasters/gadgets/</a>>, or </tt><tt>iframe sandboxes used for isolating untrusted content while still </tt><tt>being inline in the page. </tt><pre style="margin: 0em;"> </pre><tt>So, my recommendation is that <title> be made optional; perhaps a </tt><tt>validator could issue a warning if you leave it off, but there are </tt><tt>perfectly valid cases of wanting to produce an HTML document that </tt><tt>doesn't have any sort of meaningful title or for which a title will </tt><tt>never be seen or used, it doesn't seem likely that people will forget </tt><tt>it in cases in which it's useful, and right now it is sometimes being </tt><tt>filled with useless values like "Untitled" that actually get in the </tt><tt>way of a UA computing a better value (such as the URL or the top level </tt><tt>heading). </tt><pre style="margin: 0em;"> -- Brian Campbell </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg18224.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="index.html#18229">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail2.html#18229">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg18396.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email tSliceCur"><span class="subject">Re: [whatwg] HTML as a text format: Should <title> be...</span> <span class="sender italic">Brian Campbell</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18396.html">Re: [whatwg] HTML as a text format: Should <title&g...</a></span> <span class="sender italic">Ian Hickson</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg18459.html">Re: [whatwg] HTML as a text format: Should <tit...</a></span> <span class="sender italic">Brian Campbell</span></li> </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] HTML as a text format: Should <title> be optional?"> <input type="hidden" name="msgid" value="362E5401-2351-4D51-A480-BB3E417117A0@dartmouth.edu"> <input type="hidden" name="relpath" value="whatwg@lists.whatwg.org/msg18229.html"> <input type="submit" value=" Brian Campbell "> </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+HTML+as+a+text+format%5C%3A+Should+%3Ctitle%3E+be+optional%5C%3F%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg18224.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg18396.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">362E5401-2351-4D51-A480-BB3E417117A0@dartmouth.edu</li> </ul> </div> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9ce34d6eaf6e7089',t:'MTc3MTE0Mjc1MA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script>