[whatwg] 3.3.2 Elements in the DOM in other contexts

"The nodes representing HTML elements in the DOM must implement, and 
expose to scripts, the interfaces listed for them in the relevant 
sections of this specification. This includes HTML elements in XML 
documents, even when those documents are in another context (e.g. inside 
an XSLT transform)."

I find this very questionable. If an XSLT processor is parsing a 
stylesheet, including a browser-hosted XSLT processor, there is no 
reason or expectation for it to treat HTML elements specially in the 
context of the stylesheet. Possibly doing so would lead to violations of 
the XSLT spec, especially given the error recovery littered throughout 
the HTML 5 spec. And of course XSLT is just one example. There are 
others where similar issues may apply.

I think something along the lines of section 2.2 would be more 
reasonable. "Web browsers that support XHTML must process elements and 
attributes from the HTML namespace found in XML documents as described 
in this specification, so that users can interact with them, *unless the 
semantics of those elements have been overridden by other specifications.*"

What's missing in 3.3.2 is something along the lines of "unless the 
semantics of those elements have been overridden by other specifications."

I'm not sure exactly what language we need here. Maybe something like

"The nodes representing HTML elements in the DOM must implement, and 
expose to scripts, the interfaces listed for them in the relevant 
sections of this specification. This includes HTML elements in XML 
documents unless those documents are in another context (e.g. inside an 
XSLT transform)."

That is, change "even when" to "unless". It would also be helpful here 
to define exactly what "another context" means. That is, what is the 
context where the HTML DOM is appropriate and what are its limits?  That 
wasn't clear to me from ereading the preceding sections. However 
whatever those limits are, I think they should stop well short of 
applying to an XSLT stylesheet.

-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
Refactoring HTML Just Published!
http://www.amazon.com/exec/obidos/ISBN=0321503635/ref=nosim/cafeaulaitA

Received on Thursday, 18 December 2008 08:33:21 UTC