Closed Bug 445330 Opened 17 years ago Closed 17 years ago

document.loaded XML documents fire onload before DOMContentLoaded

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mrbkap, Assigned: smaug)

Details

(Keywords: testcase)

Attachments

(2 files)

Attached file testcase
The problem is that XMLDocument::EndLoad fires onload sync. before we even dispatch the event to fire DOMContentLoaded. See http://hg.mozilla.org/mozilla-central/index.cgi/annotate/6db0b5d30af1/content/xml/document/src/nsXMLDocument.cpp#l539
Oh, the expected output of the testcase is: ...DOMContentLoaded called... ...onload called...
Assignee: nobody → Olli.Pettay
Hmm, I took this too fast :) - making load event dispatch asynchronous (so that it happens after DOMContentLoaded) breaks many XBL testcases. Perhaps I should take another approach, dispatch DOMContentLoaded synchronously right before load event.
Not sure we want this though :/
Comment on attachment 329719 [details] [diff] [review] Sync DOMContentLoaded Bz, IIRC you changed DOMContentLoaded to be async. This patch shouldn't cause any new problems since load event is anyway synchronous for data and XBL documents.
Attachment #329719 - Flags: review?(bzbarsky)
Comment on attachment 329719 [details] [diff] [review] Sync DOMContentLoaded Makes sense.
Attachment #329719 - Flags: superreview+
Attachment #329719 - Flags: review?(bzbarsky)
Attachment #329719 - Flags: review+
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: