Closed Bug 372008 Opened 17 years ago Closed 17 years ago

scripts added using appendChild are "deferred"

Categories

(Core :: DOM: Core & HTML, defect)

1.8 Branch
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 371576

People

(Reporter: moth.debian, Unassigned)

References

()

Details

(Keywords: regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2

Used to be (for example: Firefox 2.0.0.1) this test page would display:
new script: 2
original context: 3
timeout new script: 2
timeout original context: 3

However, firefox 2.0.0.2 displays:
original context: 1
new script: 2
timeout original context: 3
timeout new script: 2

In other words, it used to be that appendChild() with a script tag would execute the script before appendChild() would exit.  The new behavior acts as if the defer attribute is set, even when it's not.

Since the only way I can think of to control this behavior would be to remove the defer attribute, and since it's not set in this case, I'm not sure how to repair scripts that rely on this behavior.

Reproducible: Always

Steps to Reproduce:
1. Visit test page (http://www.usatoday.com/test/rdmiller/test.htm)

Actual Results:  
original context: 1
new script: 2
timeout original context: 3
timeout new script: 2

Expected Results:  
new script: 2
original context: 3
timeout new script: 2
timeout original context: 3

I'm going to classify this as a major feature of the browser because it's a break with the way firefox used to work.  Feel free to downgrade/upgrade if you have a good reason for doing so.
I believe that this is the same as or related to bug 371576 but I dont know enough about the situation to be sure.
Assignee: nobody → general
Component: General → DOM
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.8 Branch
Summary: scripts without defer attribute are deferred → scripts added with appendChild are defer attribute are deferred
Summary: scripts added with appendChild are defer attribute are deferred → scripts added using appendChild are "deferred"
Keywords: regression
Yes, bug 371576 is caused by the same problem as I tried to report here.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Assignee: general → nobody
Status: RESOLVED → VERIFIED
OS: Windows XP → All
QA Contact: ian → general
Hardware: x86 → All
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.