You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Chirag Shah <ch...@gmail.com> on 2009/10/28 02:35:52 UTC

HTML doctype declaration for content

Hey,

It looks like there's a discrepancy in which HTML doctype is used
between the Java and PHP gadget renderers.

GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
used when "quirks = false or empty in the view."

The Java Gadget renderer will not set a default doctype if it can't
find one. Shouldn't both systems explicitly set a doctype if it's not
provided?

Re: HTML doctype declaration for content

Posted by Kevin Marks <ke...@gmail.com>.
Mark Pilgrm wrote on this today in his usual engaging style:

http://diveintohtml5.org/semantics.html

he points to Henri Sivionen's detailed summary of browser behaviour:

http://hsivonen.iki.fi/doctype/

which delineates Quirks, Standards and 'Almost standards' mode - I think it
is the latter that we want here, no?

The key part:

Here are simple guidelines for choosing a doctype for a new text/html
>  document:

Standards mode, cutting edge validation

<!DOCTYPE html>

This is the right thing to do if you want to
validate<http://html5.validator.nu/> new
features such as <video>, <canvas> and ARIA. Note that the HTML5 validity
definition is still in flux. Please be sure to test your image alignment in
Firefox, Safari, Chrome or Opera 9 or 10. Testing image alignment with
Internet Explorer is inadequate however be sure to test in IE8, too.

Standards mode, more stable validation target

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">

This doctype also triggers the standards mode, and the decade-old HTML 4.01
validity definition is stable. Please be sure to test your image alignment
in Firefox, Safari, Chrome or Opera 9 or 10. Testing image alignment with
Internet Explorer is inadequate however be sure to test in IE8, too.

You’d like to use the Standards mode, but you still want to validate
deprecated markup or you use sliced images in table layouts and don’t want
to fix them

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">

This gives you the Almost Standards mode (and the full Standards mode in
really old Mozilla releases). Please note that your layouts based on sliced
images in tables are likely to
break<http://www.mozilla.org/docs/web-developer/faq.html#gaps> if
you later move to HTML5 (and, hence, the full Standards mode).

You willfully want the Quirks mode

No doctype.

Please don’t do this. Willfully designing for the Quirks mode will come and
haunt you, your coworkers or your successors in the future—when no one even
cares about Windows IE 6 anymore (already no one cares about Netscape 4.x
and IE 5). Designing for the Quirks mode is a bad idea. Trust me.

If you still want to support Windows IE 6, it is better to apply specific
hacks for it using conditional
comments<http://www.quirksmode.org/css/condcom.html> than
to regress other browsers into the Quirks mode.

I am not recommending any of the XHTML doctypes, because serving XHTML as
text/html is considered harmful <http://hixie.ch/advocacy/xhtml>. If you
choose to use an XHTML doctype anyway, please note that the XML declaration
makes IE 6 (but not IE 7!) trigger the Quirks mode.




On Tue, Oct 27, 2009 at 10:21 PM, Louis Ryan <lr...@google.com> wrote:

> No thats about the size of it. There are too many quirks dependent gadgets
> already out there that even defaulting any doctype would break a large
> number of gadgets.
>
> On Tue, Oct 27, 2009 at 6:51 PM, John Hjelmstad <fa...@google.com> wrote:
>
> > I seem to recall that the decision we made a while back was:
> > * if no doctype specified, let default reign (quirks, equivalent to
> writing
> > a doctype-free webpage)
> > * else include doctype
> >
> > Take that with a grain of salt; it's been a while. Perhaps it's worth
> > plumbing the archives for the longer discussion.
> >
> > --j
> >
> > On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com>
> > wrote:
> >
> > > Hey,
> > >
> > > It looks like there's a discrepancy in which HTML doctype is used
> > > between the Java and PHP gadget renderers.
> > >
> > > GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
> > > HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
> > > used when "quirks = false or empty in the view."
> > >
> > > The Java Gadget renderer will not set a default doctype if it can't
> > > find one. Shouldn't both systems explicitly set a doctype if it's not
> > > provided?
> > >
> >
>

Re: HTML doctype declaration for content

Posted by Louis Ryan <lr...@google.com>.
No thats about the size of it. There are too many quirks dependent gadgets
already out there that even defaulting any doctype would break a large
number of gadgets.

On Tue, Oct 27, 2009 at 6:51 PM, John Hjelmstad <fa...@google.com> wrote:

> I seem to recall that the decision we made a while back was:
> * if no doctype specified, let default reign (quirks, equivalent to writing
> a doctype-free webpage)
> * else include doctype
>
> Take that with a grain of salt; it's been a while. Perhaps it's worth
> plumbing the archives for the longer discussion.
>
> --j
>
> On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com>
> wrote:
>
> > Hey,
> >
> > It looks like there's a discrepancy in which HTML doctype is used
> > between the Java and PHP gadget renderers.
> >
> > GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
> > HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
> > used when "quirks = false or empty in the view."
> >
> > The Java Gadget renderer will not set a default doctype if it can't
> > find one. Shouldn't both systems explicitly set a doctype if it's not
> > provided?
> >
>

Re: HTML doctype declaration for content

Posted by Kevin Brown <et...@google.com>.
Yes, we never did get agreement on how to properly support standards mode in
the spec.

What shindig implements today is that if the developer writes a gadget
"following the spec", there's no doctype.

However, if the developer includes a fully-formed HTML document, we preserve
the doctype. This behavior comes from proxied rendering (which DOES specify
explicit doctype handling in the spec), but we copy it even for content
declared inline.

The alternative proposals were:

1. "quirks=false" -- mostly shot down because it's too vague.
2. Some attribute to specify the doctype based on an enum (I believe that
came from myspace).


On Wed, Oct 28, 2009 at 9:57 AM, Weygandt, Jon <jw...@ebay.com> wrote:

> I did a quick Markmail and opensocial.org search, and found lots of
> discussions, proposals and even +1 votes. But where it counts, the v0.9
> spec, and errata proposal for v1.0, there is nothing. So as it stands,
> the official OpenSocial container MUST render in quirks mode. Anything
> Shindig does with options is a Shindig only extension. Also, I seem to
> recall some other production containers NOT rendering in quirks mode.
>
> Did something really get adopted for the spec and simply not properly
> incorporated in the docs? Or something else?
>
> BTW - some of the people on this email thread were also on the other
> threads of discussion.
>
> -----Original Message-----
> From: John Hjelmstad [mailto:fargo@google.com]
> Sent: Tuesday, October 27, 2009 6:52 PM
> To: shindig-dev@incubator.apache.org
> Subject: Re: HTML doctype declaration for content
>
> I seem to recall that the decision we made a while back was:
> * if no doctype specified, let default reign (quirks, equivalent to
> writing a doctype-free webpage)
> * else include doctype
>
> Take that with a grain of salt; it's been a while. Perhaps it's worth
> plumbing the archives for the longer discussion.
>
> --j
>
> On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com>
> wrote:
>
> > Hey,
> >
> > It looks like there's a discrepancy in which HTML doctype is used
> > between the Java and PHP gadget renderers.
> >
> > GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
> > HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
> > used when "quirks = false or empty in the view."
> >
> > The Java Gadget renderer will not set a default doctype if it can't
> > find one. Shouldn't both systems explicitly set a doctype if it's not
> > provided?
> >
>

RE: HTML doctype declaration for content

Posted by "Weygandt, Jon" <jw...@ebay.com>.
I did a quick Markmail and opensocial.org search, and found lots of
discussions, proposals and even +1 votes. But where it counts, the v0.9
spec, and errata proposal for v1.0, there is nothing. So as it stands,
the official OpenSocial container MUST render in quirks mode. Anything
Shindig does with options is a Shindig only extension. Also, I seem to
recall some other production containers NOT rendering in quirks mode.

Did something really get adopted for the spec and simply not properly
incorporated in the docs? Or something else?

BTW - some of the people on this email thread were also on the other
threads of discussion.

-----Original Message-----
From: John Hjelmstad [mailto:fargo@google.com] 
Sent: Tuesday, October 27, 2009 6:52 PM
To: shindig-dev@incubator.apache.org
Subject: Re: HTML doctype declaration for content

I seem to recall that the decision we made a while back was:
* if no doctype specified, let default reign (quirks, equivalent to
writing a doctype-free webpage)
* else include doctype

Take that with a grain of salt; it's been a while. Perhaps it's worth
plumbing the archives for the longer discussion.

--j

On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com>
wrote:

> Hey,
>
> It looks like there's a discrepancy in which HTML doctype is used 
> between the Java and PHP gadget renderers.
>
> GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD 
> HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be 
> used when "quirks = false or empty in the view."
>
> The Java Gadget renderer will not set a default doctype if it can't 
> find one. Shouldn't both systems explicitly set a doctype if it's not 
> provided?
>

Re: HTML doctype declaration for content

Posted by Kevin Marks <ke...@gmail.com>.
I was advocating for the minimal HTML5 (extensively tested) doctype of

<!DOCTYPE html>

by default with the other doctype strings inserted if need be. This is
standards mode in all browsers.

On Tue, Oct 27, 2009 at 6:51 PM, John Hjelmstad <fa...@google.com> wrote:

> I seem to recall that the decision we made a while back was:
> * if no doctype specified, let default reign (quirks, equivalent to writing
> a doctype-free webpage)
> * else include doctype
>
> Take that with a grain of salt; it's been a while. Perhaps it's worth
> plumbing the archives for the longer discussion.
>
> --j
>
> On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com>
> wrote:
>
> > Hey,
> >
> > It looks like there's a discrepancy in which HTML doctype is used
> > between the Java and PHP gadget renderers.
> >
> > GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
> > HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
> > used when "quirks = false or empty in the view."
> >
> > The Java Gadget renderer will not set a default doctype if it can't
> > find one. Shouldn't both systems explicitly set a doctype if it's not
> > provided?
> >
>

Re: HTML doctype declaration for content

Posted by John Hjelmstad <fa...@google.com>.
I seem to recall that the decision we made a while back was:
* if no doctype specified, let default reign (quirks, equivalent to writing
a doctype-free webpage)
* else include doctype

Take that with a grain of salt; it's been a while. Perhaps it's worth
plumbing the archives for the longer discussion.

--j

On Tue, Oct 27, 2009 at 6:35 PM, Chirag Shah <ch...@gmail.com> wrote:

> Hey,
>
> It looks like there's a discrepancy in which HTML doctype is used
> between the Java and PHP gadget renderers.
>
> GadgetHtmlRenderer.php says that "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
> HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" should be
> used when "quirks = false or empty in the view."
>
> The Java Gadget renderer will not set a default doctype if it can't
> find one. Shouldn't both systems explicitly set a doctype if it's not
> provided?
>