On Sat, 14 Apr 2001, Erik Arvidsson wrote:
>
> I just wanted to clarify a little. Below is the DOM trees that the different
> browsers use for the following document:
>
>> <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
>> <?xml-stylesheet type="text/css" href="#css"?>
>> <document>
>> <style id="css">
>> {}
>> style {display:none;}
>> document {display:block;background-color:#3080af;}
>> </style>
>> <contents>
>> Hello, World!
>> </contents>
>> </document>
>
> If you understand how the browsers create their DOM trees it might be easier
> to understand why some css rules don't match.
>
> IE (5.0, 5.5, 6.0):
>
> Document
> + html:html
> + html:head
> + html:link
> + html:body
> + document
> + style
> + TextNode
> + contents
> + TextNode
*cries*
> Opera (Tested on 5.10 win32)
>
> Document (Not included in DOM model, so taking parent of document returns
> undefined)
> + [object HTMLdocumentElement]
> + [object HTMLstyleElement]
> + [object HTMLcontentsElement]
*whimpers*
> Mozilla ( Gecko/20010412 )
>
> [object Document]
> + [object Element] (tagName => document)
> + [object Text] (empty text node)
> + [object Element] (tagName => style)
> + [object Text] (content of style element)
> + [object Text] (empty text node)
> + [object Element] (tagName => contents)
> + [object Text]
> + [object Text] (empty text node after contents)
No PI node for the xml-stylesheet link? That's odd. Did you check all the
children of the Document object?
I'm curious: how did you do this in all the browsers? I know Mozilla
supports <html:script> (and <xul:script>, for that matter, and even
<xbl:script> if you try hard enough!) to execute scripts, but how did you
walk the DOM in Opera and IE? I'd be very interested to look at how you
did it. Thanks!
--
Ian Hickson )\ _. - ._.) fL
Netscape, Standards Compliance QA /. `- ' ( `--'
+1 650 937 6593 `- , ) - > ) \
irc.mozilla.org:Hixie _________________________ (.' \) (.' -' __________