Forcing rails to output HTML4 rather then XHTML?

Marnen Laibow-Koser wrote in post #956924:

Right. But when the syntax – not just the semantics – changes, then I
start worrying. Time for me to do more research.

Okay, so let’s talk specifics. Assuming valid HTML 5 markup with no HTML
5 specific features, what breaks on what browsers.

Is this speculation that things might break on older browsers? Or does
anyone have concrete examples for certain browsers and versions?

For example, does anyone know if the use of self closing tags (e.g.
) actually breaks any of the reasonably modern browsers (i.e. IE
6.0+), of course assuming validating HTML 5 markup?

Peter De Berdt wrote in post #956885:

On 25 Oct 2010, at 15:34, Marnen Laibow-Koser wrote:

I don’t think it’s such as bad thing to not perfectly support older
browsers.

Not perfectly, perhaps, but as well as possible. I am not sure that
providing HTML 5 markup meets that goal. However, I haven’t yet done
much research about older browsers’ support of HTML 5.

I think the poster meant something like: I use some of the newer CSS
features and maybe some HTML5 attributes. Older browsers will simply
ignore those and move on.

…or not. Yes, of course it’s fine to use new attributes that older
browsers will ignore. However, HTML 5 differs from HTML 4 not just in
its repertoire of attributes and elements, but also in its basic
syntax
– HTML 5 is no longer a subset of SGML as HTML ≤4 is. That’s
the part that (potentially) breaks graceful degradation.

Trying to get the same result across all
browsers and versions is not necessary anyway. If you use IE6, you
accept that you might miss out on some of the new goodies. As long as
the page renders and is usable, that’s fine imo.

Right. But when the syntax – not just the semantics – changes, then I
start worrying. Time for me to do more research.

Best regards

Peter De Berdt

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 25 Oct 2010, at 17:34, Marnen Laibow-Koser wrote:

browsers will ignore. However, HTML 5 differs from HTML 4 not just in
its repertoire of attributes and elements, but also in its basic
syntax
– HTML 5 is no longer a subset of SGML as HTML ≤4 is.
That’s
the part that (potentially) breaks graceful degradation.

Uhu, completely agree. But I’ve noticed a lot of people are throwing
around “HTML5” these days like “Web 2.0” in the recent past. The major
difference being that HTML5 actually isn’t an empty shell like Web 2.0
was, but actually has a more-or-less well defined meaning.

Anyway, back to the “HTML4 rather than XHTML”, which has little to do
with HTML5 anyway. IE6 perfectly supports XHTML and its
tags
(with all of the usual IE6 quirks of course), so there is no reason to
go to HTML4 if that is your concern.

Best regards

Peter De Berdt

…or not. Yes, of course it’s fine to use new attributes that older
browsers will ignore. However, HTML 5 differs from HTML 4 not just in
its repertoire of attributes and elements, but also in its basic
syntax
– HTML 5 is no longer a subset of SGML as HTML ≤4 is. That’s
he part that (potentially) breaks graceful degradation.

It breaks absolutely nothing. More than that, only because browsers
don’t give
a damn about SGML rules all that XHTML nonsense was possible:
according to SGML
should be rendered as if it was
>
(search for
SGML SHORTTAG).

Anyway, back to the “HTML4 rather than XHTML”, which has little to do with
HTML5 anyway. IE6 perfectly supports XHTML and its
tags (with all of
the usual IE6 quirks of course), so there is no reason to go to HTML4 if
that is your concern.

IE6 (and any version of IE) does not support XHTML at all. Try to feed
them
proper XHTML (that’s with the MIME type application/xhtml+xml) and see
what
happens. They just silently ignore all those slashes.

HTML5 finally fixes this, and you can use a syntax you like for your
HTML5
documents. However, if you want XHTML5 you MUST server your document
with application/xhtml+xml: and by doing so be aware of all the
differences
in behaviour this brings.

Regards,
Rimantas

http://rimantas.com/

Rimantas L. wrote in post #957137:

…or not. Yes, of course it’s fine to use new attributes that older
browsers will ignore. However, HTML 5 differs from HTML 4 not just in
its repertoire of attributes and elements, but also in its basic
syntax
– HTML 5 is no longer a subset of SGML as HTML ≤4 is. That’s
he part that (potentially) breaks graceful degradation.

It breaks absolutely nothing.

You cannot possibly know this with certainty, I think. Since
non-HTML5-aware browsers use SGML syntax in non-XHTML documents, HTML5
self-closing tags shouldn’t be interpreted as self-closing tags (and are
invalid HTML4 due to the trailing >). The fact that, in practice, most
browsers are lenient in this respect doesn’t mean that this behavior
should be relied on.

More than that, only because browsers
don’t give
a damn about SGML rules all that XHTML nonsense was possible:

I think you’ve got it backwards. Self-closing XML-tags only became
necessary to support in browsers when XHTML was introduced. Before
that, no one would have thought to use them, and so SGML parsing could
(and perhaps should) have been the order of the day.

according to SGML
should be rendered as if it was
>
(search for
SGML SHORTTAG).

Right. So the trailing > isn’t valid HTML4, so you can’t assume that
you can use it (outside an XHTML context) in a pre-HTML5 browser.

Anyway, back to the “HTML4 rather than XHTML”, which has little to do with
HTML5 anyway. IE6 perfectly supports XHTML and its
tags (with all of
the usual IE6 quirks of course), so there is no reason to go to HTML4 if
that is your concern.

IE6 (and any version of IE) does not support XHTML at all. Try to feed
them
proper XHTML (that’s with the MIME type application/xhtml+xml) and see
what
happens.

I think this was finally fixed in IE7, IIRC.

They just silently ignore all those slashes.

Right.

HTML5 finally fixes this, and you can use a syntax you like for your
HTML5
documents. However, if you want XHTML5 you MUST server your document
with application/xhtml+xml: and by doing so be aware of all the
differences
in behaviour this brings.

Yup.

Regards,
Rimantas

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote in post #957260:

Robert W. wrote in post #957044:

Okay, so let’s talk specifics. Assuming valid HTML 5 markup with no HTML
5 specific features, what breaks on what browsers.

Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4
markup (because, as Rimantas said, in HTML 4,
is equivalent to

>, with an invalid extra >). That’s all you need to know to know
that this is a bad thing.

I’m was not asking about validity. Markup validity is directly dependent
upon the DOCTYPE specified for the page.

What I’m trying to find out is specifically how IE 6 breaks (as in
incorrectly renders the page) when using valid HTML 5 markup (including
self-closing tags) with . Again assume no HTML 5 only
features only markup syntax.

I’m asking because I don’t personally use any version of IE, much less
IE 6. I’d really like to know if IE 6 actually has problems rending HTML
5 markup.

Robert W. wrote in post #957044:

Marnen Laibow-Koser wrote in post #956924:

Right. But when the syntax – not just the semantics – changes, then I
start worrying. Time for me to do more research.

Okay, so let’s talk specifics. Assuming valid HTML 5 markup with no HTML
5 specific features, what breaks on what browsers.

Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4
markup (because, as Rimantas said, in HTML 4,
is equivalent to

>, with an invalid extra >). That’s all you need to know to know
that this is a bad thing.

Best,

Marnen Laibow-Koser
http://www.marnen.org
marnen @marnen.org

On Oct 26, 2010, at 4:56 PM, Robert W. wrote:

that this is a bad thing.

I’m asking because I don’t personally use any version of IE, much less
IE 6. I’d really like to know if IE 6 actually has problems rending
HTML
5 markup.

I haven’t tried it myself, and I upgraded my test machine to IE8 at
the beginning of the summer, but I believe that it treats it like “tag
soup” and ignores any tag that it doesn’t understand. That is, it
shows the content of that unknown tag, but it doesn’t apply any
special meaning to the tag. It would likely be Quirks Mode all the way
down, definitely not something that looked like you cared about that
browser, but it would be readable in the sense that all the words
would be there.

Walter

Walter D. wrote in post #957346:

On Oct 26, 2010, at 4:56 PM, Robert W. wrote:

that this is a bad thing.

I’m asking because I don’t personally use any version of IE, much less
IE 6. I’d really like to know if IE 6 actually has problems rending
HTML
5 markup.

I haven’t tried it myself,

Nor have I.

and I upgraded my test machine to IE8 at
the beginning of the summer, but I believe that it treats it like “tag
soup” and ignores any tag that it doesn’t understand. That is, it
shows the content of that unknown tag, but it doesn’t apply any
special meaning to the tag. It would likely be Quirks Mode all the way
down, definitely not something that looked like you cared about that
browser, but it would be readable in the sense that all the words
would be there.

That would be my guess as well.

Walter

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

What I’m trying to find out is specifically how IE 6 breaks (as in
incorrectly renders the page) when using valid HTML 5 markup (including
self-closing tags) with . Again assume no HTML 5 only
features only markup syntax.

I’m asking because I don’t personally use any version of IE, much less
IE 6. I’d really like to know if IE 6 actually has problems rending HTML
5 markup.

It does not break. The only thing that doctype affects in IE6 is
rendering mode.
HTML5 doctype forces IE6 into “standards compliant” mode, see [1] for
more
details. In fact, because unknown doctype (which html5 doctype was for
earlier browsers) forces them to use standards rendering mode is THE
reason
HTML5 has doctype at all. You can omit doctype for your XHTML5
pages, because they MUST be served with application/xhtml+xml MIME type
and
then it is this MIME that tells browsers how to treat you document, no
doctype
necessary.

So if your web page was using any of doctypes which would cause IE to be
in
standards compliant mode it will behave just the same with HTML5
doctype.

However, if your page was developed for quirks mode, HTML5 doctype will
switch IE6 into standards compliant rendering and things may (will?)
break
horribly. The most probable case is different box model, but there are
other
differences too, see the link below for the details.

[1] Internet Explorer for Developers | Microsoft Learn

Regards,
Rimantas

http://rimantas.com/