Closed Bug 494558 Opened 15 years ago Closed 15 years ago

<div> is on hiatus during initial script execution

Categories

(Core :: DOM: HTML Parser, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 178258

People

(Reporter: dao, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

Attached file testcase
See attached testcase. It succeeds if I prefix it with <body>. Without that, the script is moved to the implicit head, and the div isn't available at all as the script runs; output:

> TypeError: document.getElementById("out") is null
> 
> <head><script type="application/javascript">
> try {
>   document.getElementById("out").innerHTML;
> } catch (e) {
>   alert(e + "\n\n" + document.documentElement.innerHTML);
> }
> </script></head>

The div will later be in the implicit body.
IE8 behaves similarly (need to remove type="application/javascript" to make it work). Works as expected with Safari.
I think this is a dupe of bug 178258, see the generated DOM.

Bug 178258 has a working fix that unfortunately is not reviewed yet. Maybe due to the work on the HTML 5 parser, but I don't know. /poke mrbkap
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: