Re: ISSUE-4: Versioning, namespace URIs and MIME types

On Tue, 17 Feb 2009, Robert J Burns wrote:
> On Feb 16, 2009, at 9:35 PM, Ian Hickson wrote:
> > 
> > Given the following function in a script:
> > 
> >   function test(imp) {
> >     // imp is a DOMImplementation object
> >     var doc = imp.createDocument(null, null, null);
> >     var e = doc.createElementNS('http://www.w3.org/1999/xhtml', 'img');
> >     return e;
> >   }
> > 
> > ...browsers are required, for compatibility with legacy content, XHTML1,
> > DOM2 HTML, and DOM2 Core, to return an element that, when inserted into a
> > document, displays either an image as indicated by its "src" attribute, or
> > text as indicated by its "alt" attribute.
> 
> But that element has neither value set. I'm not following your example.

The element has to be an element that acts as above for any subsequent 
value set, changed, or removed for those attributes.


> Could you say something about what XHTML2 would do with the above script?

It would create an element that rendered its children instead of its alt 
attribute in the absense of a src attribute.


It is common practice in computer science to describe objects in terms of 
how they react to various stimuli. For example, in the above, I refer to 
"an element that" has a particular behaviour. It is then understood that 
the given object (the element in this case) could be given a variety of 
stimuli (such as adding or removing attributes) and that the object would 
behave in a manner consistent with the aforementioned description. Thus in 
this case the example script creates an object with a defined behavior, 
and it is implied that further manipulation -- by script, by direct 
manipulation in a DOM editor, or by any other means -- would cause the 
object to react in the given way.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 17 February 2009 09:32:06 UTC