[whatwg] document.head

On Sun, Sep 20, 2009 at 9:42 PM, Garrett Smith <dhtmlkitchen at gmail.com> wrote:
> On Sun, Sep 20, 2009 at 8:51 PM, Juriy Zaytsev <kangax.dev at gmail.com> wrote:
>>
>> On Sep 20, 2009, at 10:29 PM, Garrett Smith wrote:
>>
>>> On Sun, Sep 20, 2009 at 2:47 PM, Michael A. Puls II
>>> <shadow2531 at gmail.com> wrote:
>>>>
>>>> On Sun, 20 Sep 2009 16:15:11 -0400, Joseph Pecoraro <joepeck02 at gmail.com>
>>>> wrote:
>>>>
>>>>> On Sep 20, 2009, at 3:57 PM, Michael A. Puls II wrote:
>>>>>>
>>>>>> I think it'd be cool to have to complement document.documentElement and
>>>>>> document.body.
>>>>>
>>>>> On Sep 20, 2009, at 4: 00PM, Juriy Zaytsev wrote:
>>>>>>

[...]

>> but HEAD was still reported as first child.
>>
>
> Wow, that's bizarre.
>
> Result:
> Opera 10, Chrome 2, Safari 4
> #comment, test1
> HEAD,
> #comment, test 2
> BODY,
>
> IE 5.5+, Firefox 3.5, Seamonkey 1.1
> HEAD,
> BODY,
>
> Blackberry Storm 9000
> #comment, test1
> HEAD,
> #comment, test 2
> BODY,
> #comment, test 3
>
>
> The first result seems nearly right, except for the last comment "test
> 3". I believe the Blackberry result is the correct one, though I can't
> cite a reference that backs this up.
>
> example document:

Ah, mistakenly posted different code than the results reflect.

The real example code used:

<!doctype html>
<html>
<!-- test1 -->
<head>
<title>documentElement.childNodes</title>
<script type="text/javascript">
onload = function() {
  var childNodesArray = [],
      cn;
  var childNodes = document.documentElement.childNodes;
  for(var i = 0; i < childNodes.length; i++) {
    cn = childNodes[i];
    childNodesArray[i] = [cn.nodeName, cn.nodeValue||""];
  }
  document.body.firstChild.data = childNodesArray.join("\n");
};
</script>
</head>
<!-- test 2 -->
<body style="white-space:pre">-</body>
<!-- test 3 -->
</html>

- and the Browser running on the BlackBerry, is BlackBerry9000/4.6.x

Garrett

Received on Sunday, 20 September 2009 21:50:52 UTC