W3C home > Mailing lists > Public > public-html@w3.org > January 2010

Re: <iframe doc="">

From: Adam Barth <w3c@adambarth.com>
Date: Mon, 18 Jan 2010 09:48:22 -0800
Message-ID: <7789133a1001180948q9a68799x5da0c99579f0089b@mail.gmail.com>
To: Joe D Williams <joedwil@earthlink.net>
Cc: Ian Hickson <ian@hixie.ch>, public-html@w3.org
On Mon, Jan 18, 2010 at 7:36 AM, Joe D Williams <joedwil@earthlink.net> wrote:
> I actually meant to ask for a description of the steps taken to make
> src=data: and @doc work. Just an overview of steps html5 and xhtml/xml
> parsers might need to be aware of when they are processing the attribute
> string value as actual html5 syntax to be used as content of its parent.

Oh, ok.  They work in different ways.  The way data URLs work is as follows:

1) When retrieving a URI from the network, there is a table making URI
schemes to pieces of code that understand how to deal with them.  For
example, URIs with the http scheme are given to an HTTP module.  In
this case, URIs with the data scheme are (asynchronously) given to a
module that understands them.

2) The module then parses the data URI, extracting the media type, the
encoding if present, and the remaning content of the URI.

3) If the URI specifies an encoding, the module decodes the content.

4) The module then returns the content as having the specified media
type as if it had retrieved it from the network.

Now the rest of the machinery of the user agent swings into action and
loads the content into the iframe.

On the other hand, @doc would work is a follows:

1) There's a function that gets called whenever the user agent
encounters a new attribute on an element.  When this function gets
called for an "doc" attribute on an iframe (or whichever elements
support the doc attribute), the following steps occur.

2) Navigate the iframe to a new document.

3) Feed the tokenizer for that document the contents of the doc attribute.

>From that point, the rest of the machinery parses the contents of the
attribute and loads the frame.

At least, that's my understanding of how it would work.  We'll see
if/when Ian specs it.

Received on Monday, 18 January 2010 17:49:20 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:57 UTC