- From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
- Date: Sun, 27 Jan 2013 23:20:49 +0100
- To: public-html@w3.org
Smylers, Sat, 26 Jan 2013 11:33:47 +0000: > Alex Russell writes: > >> I find myself asking (without an obvious answer): who benefits from >> the creation of polyglot documents? > > I can see an advantage of the creating a snippet as polyglot HTML/XHTML. > For example if you want to distribute a badge or banner or status widget > or search form or something that others can paste into their sites, it's > simpler if you can just offer a single snippet which will work fine when > pasted into either an HTML or an XHTML document. I agree. And, in fact, I have reported bugs about tools based on that motivation. Remember: Both <H1>foo</H1> and <h1>foo</h1> are conforming per HTML5. So, based on what motivation should a developer change that to <h1>foo</h1>? I see no other motivation than compatibility with XML for such a change. But which tool vendor would not like to expand their tools' utility? > However: > > * The number of sites served as XHTML is so small that this may not be > worth bothering with. Like Sam, I wonder if it is worth wondering about. Just do it - and move on to more important things. > * This scenario doesn't involve an entire document being polyglot. So if > we wanted to support it we'd actually need a spec and validator for > polyglot snippets, rather than entire documents. The "old" validator, at http://validator.w3.org, supports snipped validation. But else, it is not very difficult - as long as the text field of the validators provides polyglot dummy code, the user can paste the snippet where it fits. > * You can't quite get this right in all detail anyway. For example, > suppose your snippet includes a <table>, and you want it to be styled > by an enclosing site's style-sheet to match other <table>-s on the > site. Do you include <tbody> tags or not? If the enclosing site is > XHTML then its styles may depend on either the presence of or the > absence of <tbody> elements. In order to match your snippet needs to > do the same -- but obviously you can't produce a single snippet which > both includes and omits <tbody> tags, so you can't cover both > possibilities anyway. Polyglot XHTML includes <tbody> - so says the spec. Obviously, polyglot markup cannot solve the problem of pages that relies on the code *not* being polyglot. -- leif halvard silli
Received on Sunday, 27 January 2013 22:21:17 UTC