Turns out we have the same issues as domready: async/sync invocation of domready handlers is inconsistent (a clear example in this comment).

With this we have essentially a version of domready for IE11+ and single callback support.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nod_ created an issue. See original summary.

nod_’s picture

Status: Active » Needs review
FileSize
935 bytes
lauriii’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

This needs a reroll now that #3096516: domready has a race condition has been committed.

nod_’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
917 bytes

reroll

zrpnr’s picture

Status: Needs review » Reviewed & tested by the community

The reasoning in the linked issue makes sense, the fallback for when document.readyState is not "loading" should also be asynchronous.
This matches the fix in https://github.com/ded/domready/commit/d71121bf7072586d828761790a4d9ad7e...

The re-roll in #4 applies to 9.1.x.
Manually tested that this function works on Mac and in IE11 on Windows8.1

Nice catch! The article linked in the domready issue was an interesting read as well.

  • lauriii committed 1a8d0ac on 9.1.x
    Issue #3152473 by nod_, zrpnr: domready callback execution
    
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

+1 to the change. It's definitely better API design to consistently call the callback asynchronously.

Committed fc8ca40 and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.