-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Core: use interactive to evaluate dom ready #2678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
532628c
to
8aac0b8
Compare
8aac0b8
to
19869de
Compare
@dmethvin @mikesherov Would like feedback from you two specifically, given your familiarity with the old tickets. |
Hm.. so in the old code if we run after DOMContentLoaded (readyState interactive) but before window-load (readyState complete) then it wouldn't trigger immediately but fall back to window-load. The commit mentions interactive but the code does not. I assume On a related note: I tried to work on a polyfill for a readyState promise (whatwg/html#127) and ran into a bug on Android 2.3 where |
@Krinkle Yes, I believe that was why originally. I used it here just because it's shorter. |
The logic LGTM. I'd put a support comment there, something to the effect of: // Support: IE9-10 only
// Older IE signals "interactive" before scripts are ready |
19869de
to
dabd5ba
Compare
This commit is revisiting of the following commit. commit 790d6c2 Author: sgtwilko <null@sgtwilko.f9.co.uk> Date: Wed Oct 2 10:47:09 2013 +0100 Ready fires on IE10 before the document is ready. Added additional check for document.body into the ready check. Changing the readyRE regex does resolve the issue on IE, but breaks Chrome. Adding this check fixes IE and doesn't seem to have any problems on Chrome/Firefox. More info about the original problem with IE can be found in related jQuery tracker [1]. This commit solves the particular case when IE <= 10 gives non-null `document.body` in "interactive" `document.readyState`, but DOM isn't fully parsed at the moment. The case was catched in [2]. This commit adapt current jQuery's approach to detect IE9 & IE 10, see [3]. Related zepto trackers: madrobby#733, madrobby#916. [1]: https://bugs.jquery.com/ticket/12282 [2]: https://bugs.jquery.com/ticket/12282#comment:20 [3]: jquery/jquery#2678 Build size ---------- Calculated for a build with the default modules set: ``` zepto.js 58760 -> 58726 ( +6 bytes) zepto.min.js 26411 -> 26427 (+16 bytes) zepto.min.gz 9804 -> 9799 ( -5 bytes) ```
Fixes gh-2100