Moving this thread out of the bug and into the mailing list to avoid
an endless comment thread on the bug.

Here is the bug for ppl just joining this thread:
https://issues.apache.org/jira/browse/TRINIDAD-922

This is in reply to Andy's comment on the bug.

Andy, you definitely have a good point with the renderers. A good
argument against your opinion would be that a renderkit could be DTD
aware and support multiple environments. The quirks vs. non-quirks is
not as much rendering specific as it is CSS skin specific. As for
XHTML vs. HTML, that is more of a ResponseWriter difference than a
RenderKit difference. AFAIK, XHTML and non-sloppy HTML are pretty much
identical except for non-content  elements (<link/> vs <link> and
<br/> vs. <br>).

The question of what to support comes down to effort and what is
gained. Why are ppl. wanting one DOCTYPE over another, why are they
using quirks mode on a new project, etc. If we can get a feeling for
these questions and if we can address them, then we can have a better
idea on the length to go to in allowing different DTDs.

I would argue that XHTML should always be the default and HTML only as
a backup, contrary to the current implementation, but that is my
opinion.

But without the Devil's advocate point of view, I think that my
solution is probably too quick. I threw it out there as a discussion
starter, not from a view of having done the proper architectural
research and thought.

Here is my comment on your choices:

>  A. Define a switch which is outside of the tr:document - perhaps a 
> trinidad-config.xml switch.

I would agree with this only if the switch supports EL expressions.
This way ppl. can change the DTD based on the current user. A good
example is to force quirks mode in IE and not in Firefox due to
shortcomings in IE7 with table CSS implementations.

>  2. While we clearly need to make it easier to switch between common doctypes 
> (html vs. xhtml), allowing the page author to provide custom doctypes may be 
> a bit too much flexibility.
>  ...
>  B. Keep our switch sufficiently abstract to avoid the issues mentioned in #2.

I still think that a custom DOCTYPE should be provided. With XHTML, to
be completely specification compliant, the HTML page ought to pass DTD
validation. This means that renderers and JavaScript that add custom
attributes onto elements are invalid and should not be used. On the
other hand, making a custom DTD that defines the extra attributes is
legal. The downside to this is that I am not sure browsers really
support custom DTDs. Does anyone know from experience?


Perhaps we should have this in the trinidad-config.xml, since that is
where the skins are configured. Then, using similar code to the skins,
allow EL expressions to specify the DOCTYPE (perhaps a DocType Java
object instead of a string for more control?)


>  BTW, just curious...  Anyone know whether the Trinidad renderers/skins 
> actually behave well in quirks mode?  I think we should verify this before 
> exposing a quirks mode switch.

I am using IE6 and IE7 in quirks mode and firefox in standards mode by
extending the DocumentRenderer for a project, and although I have only
used a small portion of the components, it is all working. On
occasion, I have to add tweaks to the standard skin in my custom skin.

-Andrew

Reply via email to