JS errors during execution can kill page accessibility #3648

Closed
scottjehl opened this Issue Feb 27, 2012 · 1 comment

3 participants

@scottjehl

This one has always been a problem in my opinion, but it's an easy fix.

The problem is, we add this class to the HTML element when the framework begins executing, "ui-mobile-rendering", which globally sets all children of the HTML element to visibility:hidden while jQM progressively enhances everything. If the page was visible during this time, it'd make for an ugly FOUC, so this class just hides things until they're ready, at which point the class is removed and the page is shown.

Problem is, if anything goes wrong during enhancements-stage, like a runtime error for instance, that class will never be removed, meaning a blank screen. Not good at all.

I think we can add a pretty simple timeout to ensure the class is removed after 5 seconds, no matter what. The default removal will still be in place, so in all likelihood, it'll be removed much sooner than 5 seconds, but the timeout places a bit of a guarantee that it'll be removed if something goes wrong.

@scottjehl scottjehl was assigned Feb 27, 2012
@scottjehl scottjehl pushed a commit that referenced this issue Feb 27, 2012
scottjehl the ui-mobile-rendering class should handle page visibility during in…
…it just fine, which means hiding .ui-page by its class is all we need. This is the first step towards addressing issue #3648
494c5ce
@scottjehl scottjehl pushed a commit that closed this issue Feb 27, 2012
scottjehl Add a last-resort fallback to ensure content is accessible if somethi…
…ng goes wrong during enhancements, such as a runtime error. Fixes #3648
818c2f2
@scottjehl scottjehl closed this in 818c2f2 Feb 27, 2012
@Wilto Wilto reopened this Feb 27, 2012
@jaspermdegroot
jQuery Foundation member

I don't know why it was re-opened but the fix landed so I am closing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment