Re: Revisiting Authoritative Metadata (was: The failure of Appendix C as a transition technique)

* Anne van Kesteren wrote:
>On Fri, Feb 22, 2013 at 9:29 AM, "Martin J. Dürst"
><duerst@it.aoyama.ac.jp> wrote:
>> In that scenario, how would you get a browser to display any format with
>> such a magic number,... as plain text? Many formats, HTML and XHTML
>> included, are at the same time plain text.
>
>Presumably that's why <plaintext> was invented before HTTP/1.0 made
>the whole system brittle with MIME types. It still works. And in fact,
>to this day browsers display text/plain as an HTML document with the
>tokenizer set to the PLAINTEXT state. That's even standardized:
>http://www.whatwg.org/specs/web-apps/current-work/#read-text (And
>observable, e.g. http://annevankesteren.com/robots.txt in Firefox, but
>you can also poke at the DOM of an <iframe> displaying a text/plain
>document and style it similarly in other browsers.)

That is turning plain text into a HTML document. Martin was asking about
being able to force plain text rendering of content that looks like HTML
like when you want others to have a look at your SSI source code like so

  <!doctype html>
  ...
  <!--#echo var="..."-->
  ...
  <script>
    ...
    eval(location.hash);
    ...
  </script>
  ...

You would not want that to render as HTML code in the browser, but if
they take the `<!doctype html>` string as sufficient reason to treat the
document as HTML, then that is not possible without some external meta
data. I've hinted at why solutions like using `view-source:` to refer to
the document would not work, and obviously you would want non-browsers,
like HTML editors, to treat the document as HTML, so using an inline "do
not treat as HTML" marker that works reliably is out of the question.

I do not think "make browsers render this as plain text" is a must-have
feature but "prevent browsers from treating this as something they know"
certainly is and you cannot do that reliably via magic numbers in files.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Sunday, 3 March 2013 00:27:25 UTC