Re: Request for Volunteers: Polyglot spec

On Fri, Mar 26, 2010 at 1:52 PM, Sam Ruby <rubys@intertwingly.net> wrote:
> I took an action item from the TAG yesterday to convey the following
> request:
>
>    The W3C TAG requests there should be in TR space a document
>    which specifies how one can create a set of bits which can
>    be served EITHER as text/html OR as application/xhtml+xml,
>    which will work identically in a browser in both bases.
>    (As Sam does on his web site.)
>
> This request requires a lot of explanation.  To start, it is recognized up
> front that this will be a subset of the set of possible documents that can
> be expressed as HTML5.  This is entirely OK.  For example, if it were to be
> the case that such a subset were to entirely disallow scripts of any kind,
> that would be acceptable as there exists a substantial class of documents
> which do not require scripting of any kind.

Out of curiosity, what does "work identically" encompass? Do they have
to have the same DOM? Or just render the same when the default UA
stylesheet is applied? Or just be semantically equivalent?

Even if the page itself doesn't contain any scripts, if the page is
contained in an iframe then scripts in another page might trip over
differences if the two pages produce different DOMs.

I believe a document served as text/html and one served as
application/xhtml+xml will always have different DOMs since the former
will have nodes with upper case nodeNames, whereas the latter will
have nodes with a lower case nodeName.

If DOMs aren't important, only rendering is, I assume that this
document won't qualify:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style> tbody { background: green } </style>
    <title>example document</title>
  </head>
  <body>
    Integer values for true/false.
    <table>
      <tr><td>true</td><td>1</td></tr>
      <tr><td>false</td><td>0</td></tr>
    </table>
  </body>
</html>

Since if this document is served as text/html the table will have a
green background, but if served as application/xhtml+xml it will not.

/ Jonas

Received on Thursday, 1 April 2010 17:45:19 UTC