1 Reply Latest reply: Oct 1, 2013 2:47 PM by bdandoy
mariettamidwife Level 1 (0 points)

Not sure what happened in the ios7 update, but websites that need to enter information into freeze Safari up completely. I downloaded Chrome and no problems. Whats the deal?

  • bdandoy Level 1 (0 points)

    On a page with a form containing named input elements inside containers that are marked "display: none", the first press on an input in that form has a very noticeable delay (20sec-2min) between the keyboard coming up and the input being focused. This prevents users from using our web app due to the enormous time spent with the ui frozen waiting for the keyboard to respond. We have debugged it in various scenarios to try and discern what is going on, and it appears to be from a change in how iOS7 parses the DOM versus how it did on iOS6, which has none of these issues. 


        From debugging within Safari's Inspector with the iPad connected, we found that iOS7 provides much more information about the (program)'s activities, to the point that we found that _CollectFormMetaData is the parent of the problem. Searching for meta data causes massive churn that increases more than linearly along with the number of hidden containers containing inputs. We found that _isVisible and _isRenderedFormElement are called far more than they reasonably should be. Additionally, if it helps, we found some detection functions relating to credit cards and address books were large time consumers.


        Here are some jsFiddles for illustration. Please view them in Safari on an iPad running iOS6 and then on an iPad running iOS7:

        http://jsfiddle.net/gUDvL/20/ - Runs fine on both

        http://jsfiddle.net/gUDvL/21/ - Just noticeable delay on iOS 7

        http://jsfiddle.net/gUDvL/22/ - More noticeable delay on iOS 7

        http://jsfiddle.net/gUDvL/29/ - VERY noticeable delay on iOS 7

        http://jsfiddle.net/gUDvL/30/ - Same as 29 but with none hidden - no delay on iOS 7

        http://jsfiddle.net/gUDvL/38/ - Same as 29 but further exacerbated


    (We should note that having the iPad connected to a Mac with Safari's debugger engaged dramatically emphasizes the delays.)


    Steps to Reproduce:

    1. Load any of the above jsfiddles on the iPad

    2. Press an input to gain focus

    3. Watch screen until you can type


    Expected Results:

    Expect to be able to type as soon as the keyboard pops up


    Actual Results:

    Watch the keyboard pop up and the screen freeze, unable to scroll or interact with Safari for a duration. After the duration, focus is given as expected. From then on no further freezes are experienced when focusing on inputs.