Side navigation
#13655 closed feature (fixed)
Opened March 24, 2013 02:40AM UTC
Closed April 04, 2013 05:36PM UTC
Create unit test for window.load .ready() fallback
Reported by: | m_gol | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.0b2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I was wondering, is a fallback from document
DOMContentLoaded
to window
load
in jQuery.ready.promise
still needed in jQuery 2.x? (line 789 in src/core.js on master). IE supports it from 9 but other browsers have had support for much longer time; it's also supported on old Android (at least 2.3).
This would save a few bytes if it's not needed any more.
Attachments (0)
Change History (8)
Changed March 24, 2013 02:42AM UTC by comment:1
Changed March 24, 2013 03:14AM UTC by comment:2
https://github.com/jquery/jquery/pull/1209
I've run the full test suite in current Chrome, Firefox & Safari as well as in IE9 & IE10 and all went fine (though, obviously, any bugs here might not be catched in a usual test).
I don't have any Android devices to test, though.
Changed March 24, 2013 03:23AM UTC by comment:3
_comment0: | Is it possible for jQuery to be loading after DOMContentLoaded, but before the load event has occurred ( think RequireJS or some other script loader )? \ \ If that's the case, then jQuery.ready would never be fired since document.readyState would be "interactive" at that point. → 1364095456214627 |
---|
Is it possible for jQuery to be loaded after DOMContentLoaded, but before the load event has occurred ( think RequireJS or some other script loader )?
If that's the case, then jQuery.ready would never be fired since document.readyState would be "interactive" at that point.
Changed March 24, 2013 03:36AM UTC by comment:4
window.load is needed for the reason dcherman describes. A long loading iframe on a page could keep the page "interactive" if jQuery is async loaded after DomContentLoaded. Rather than remove the fallback,, maybe write a test proving its necessity?
Changed March 24, 2013 03:46AM UTC by comment:5
OK, I'll try to write a test case.
Changed March 24, 2013 04:52AM UTC by comment:6
I updated my pull request, reverting the removal and adding a test, see there for further comments & remarks:
Changed March 25, 2013 02:32PM UTC by comment:7
status: | new → open |
---|---|
summary: | Remove DOMContentLoaded fallback to window load? → Create unit test for window.load .ready() fallback |
Marking as open and renaming to reflect the end result since we're not removing the fallback.
Give it a shot