Bug 32418 - JQuery "core4 module: contents()" fails 7 tests - DOMContentLoaded fires before subframe loads
Summary: JQuery "core4 module: contents()" fails 7 tests - DOMContentLoaded fires befo...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-11 04:15 PST by Petri Ojala
Modified: 2011-03-08 15:55 PST (History)
6 users (show)

See Also:


Attachments
reduction (1.12 KB, application/zip)
2010-03-06 17:13 PST, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petri Ojala 2009-12-11 04:15:09 PST
Steps to Reproduce:
-------------------
1. Open the URL: "http://podcast.cdmamail.com/jquery/test.html"
2. Tap on the link "Core 4"

Expected Outcome:
-----------------
"0 tests of 69 failed" should be displayed. 

Actual Outcome:
---------------
"7 tests of 69 failed" is displayed. 7 cases from the "core4 module: contents()
(7, 5, 12)" is failing.

Note:
-----
Windows: Yes (7 tests of 69 failed)
Safari: Yes (7 tests of 69 failed)
Mozilla: Yes (5 tests of 69 failed)
Comment 1 Tor Arne Vestbø 2010-03-05 06:43:16 PST
Reproducible in:

 - QtWebKit trunk on Windows
 - WebKit nightly r55519 (Safari) on Windows
 - Chrome 4.0.249.89 (38071) on Windows
Comment 2 Alexey Proskuryakov 2010-03-06 17:13:00 PST
WebKit fires DOMContentLoaded before subframes load, which I think matches both Mozilla documentation and common sense. But these tests rely on subframe content being already available.
Comment 3 Alexey Proskuryakov 2010-03-06 17:13:22 PST
Created attachment 50159 [details]
reduction
Comment 4 Tony Gentilcore 2011-03-08 15:55:15 PST
According to the HTML5 spec, the DOMContentLoaded event should not wait for subframes to load. See:
http://dev.w3.org/html5/spec/Overview.html#the-end

Notice that 8.2.6.4 is where DCL is fired and 8.2.6.6 is where we wait for subframes.

This being said, a subframe may race the DCL event and win, but this should never be relied upon. I haven't looked at the tests, but perhaps they can be rewritten to use the window's load event instead of the DCL event. If you still believe this behavior to be incorrect, file a spec bug at http://www.w3.org/Bugs/Public/.