W3C home > Mailing lists > Public > www-tag@w3.org > March 2013

Re: Why polyglot is needed

From: Harry Halpin <hhalpin@ibiblio.org>
Date: Tue, 19 Mar 2013 20:59:25 +0100
Message-ID: <CAE1ny+6Odq-=5kHJM+U8qGphoC2_fHi0_Bd0Qas+sm_xpROukA@mail.gmail.com>
To: "Michael[tm] Smith" <mike@w3.org>
Cc: "Henry S. Thompson" <ht@inf.ed.ac.uk>, www-tag@w3.org
On Tue, Mar 19, 2013 at 8:32 PM, Michael[tm] Smith <mike@w3.org> wrote:

> "Henry S. Thompson" <ht@inf.ed.ac.uk>, 2013-03-19 19:05 +0000:
>
> > My university serves html files as text/html.  I have no control over
> > that.
>
> What kind of Web server does your university use? You really don't have the
> ability to add an .htaccess file or equivalent? If you lack anything like
> that, it kind of sounds like your university's system is broken, from a
> user-experience point of view. Why don't you ask your university to fix
> that?
>

Regardless of polygot, access to .htaccess is becoming harder in general
for users to access. I don't think asking people to change that is a good
idea.

Yet I'm of the "media types might be an anti-pattern" opinion the more I
think about this given they can't be controlled often by document authors.

>
> Creating a new document class instead of fixing broken systems that aren't
> meeting your needs and the needs of other users doesn't seem to me like the
> best way to address the underlying problems.
>
> > If I don't produce polyglot, browsers do the wrong thing with,
> > for instance [1], void tags.
>
> It's not the wrong thing. It's the different-from-XML-thing or the
> behavior-that-browsers-have-consistently-had-before-XML-was-invented thing.
>
> > The document at [1] looks like this:
> >
> > <!DOCTYPE html>
> > <html xmlns="http://www.w3.org/1999/xhtml">
> >   <head>
> >     <title>test void element closure</title>
> >     <style type="text/css">a {background-color: pink}</style>
> >   </head>
> >
> >   <body>
> >     <h1>test void element closure</h1>
> >     <p><a name="test" />Inside or outside?</p>
>
> That's not valid per HTML5. The name attribute is not allowed on the <a>
> element. There is now never any good reason to use it. You can just use an
> id attribute on the p element to achieve the same effects.
>
> >     <hr/>
> >     <address><a href="mailto:ht@inf.ed.ac.uk">Henry S.
> Thompson</a></address>
> >   </body>
> > </html>
> >
> > Served as application/xml+xhtml, it validates [2] and displays
> > correctly (in Firefox 17, Chrome 26, IE9).  Served as text/html, it
> > doesn't parse [3]
>
> It parses fine. It just doesn't validate.
>
> > and displays incorrectly (same browsers).
>
> It displays exactly as expected given the rules for parsing text/html we
> have always had since the language was created.
>
> > ht
> >
> > [1] http://www.ltg.ed.ac.uk/~ht/void_test.html
> > [2]
> http://validator.w3.org/check?uri=http%3A%2F%2Fwww.ltg.ed.ac.uk%2F~ht%2Fvoid_test.xhtml&charset=%28detect+automatically%29&doctype=HTML5&group=0
> > [3]
> http://validator.w3.org/check?uri=http%3A%2F%2Fwww.ltg.ed.ac.uk%2F~ht%2Fvoid_test.html&charset=%28detect+automatically%29&doctype=HTML5&group=0
>
> --
> Michael[tm] Smith http://people.w3.org/mike
>
>
Received on Tuesday, 19 March 2013 19:59:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 19 March 2013 19:59:53 GMT