Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10736

Resizes iOS viewport after document.readyState "complete"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • iOS 9.2.1, WKWebView

    Description

      Edit: This only occurs using WKWebview. It doesn't resize on UIWebView (at least when I tested it on an iOS 8 phone).

      With StatusBarOverlaysWebView set to "false," the document loads (document.readyState == "complete") and then the window resizes sometime after that.

      This is causing a document reflow, and disallows Javascript changes to the DOM that relate to viewport size to start right away.

      My workaround right now is simple: If the platform is iOS, then wait for a resize before starting Javascript calculations.

      Is this resizing unavoidable? (Or, can I just handle this with some .plist settings, or something?)

      If the resizing is unavoidable, can I count on it always resizing the window? Or, is there a race condition happening, and I have just observed that it resizes after the readyState "complete", when it could really happen before OR after?

      Attachments

        Activity

          People

            Unassigned Unassigned
            trenthm Trent McNitt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: