Safari: Negative window.scrollY when opening webpages with smart banners from a link in an app

Originator:than.tibbetts
Number:rdar://19655227 Date Originated:01/29/2015
Status:Open Resolved:
Product:iOS Product Version:8.0 - 8.1.3
Classification:Bug Reproducible:Always
 
Summary:
We are seeing a behavior in mobile Safari that results in what appears to be a blank page upon opening a URL with a smart app banner meta tag from an iOS app. 

Screenshots are attached. We have seen this occur on both iPad and iPhone. On the iPad it appears this only occurs when the device is in landscape mode.

The webpage contents all load successfully, as confirmed in the web inspector. However, window.scrollY can be set to a large negative number, resulting in the user only seeing the grey, blank stage area and not the webpage contents. window.scrollY snaps back to 0 once any touch or scroll event is initiated on the page.

This issue appears to be confined to case where a URL is passed to Safari from another app. Requesting or reloading pages from within Safari does not result in the described anomaly.

Steps to Reproduce:
0. Place the iPad device in landscape orientation.

1. Go to Settings < Safari and Clear History and Website Data

2. Run the example app at https://github.com/than/Open-a-Link

3. Tap Test Page with Viewport to open the example page at http://hobosupply.com/banner-test.html in mobile Safari.

- This test page is built with the following: a smart app banner meta tag, meta viewport tag. See: https://github.com/than/Open-a-Link/blob/master/banner-test.html

Expected Results:
The page should be rendered as expected. The user should see a 100% wide, 1200px tall div with a green background.

Actual Results:
The user will see a page similar to this: http://than.to/10EVw.png

Smart Banner at the top, grey Safari stage. Any touch or scroll event will snap the page back to its expected Y=0 position.

I have included a counter example with the meta viewport tag removed at http://hobosupply.com/banner-test-no-viewport.html

The "Test Page without Viewport" button in the example app will open that page in Safari and should display the page as you would expect. 

Version:
Observed in iOS 8.0, 8.1.2 and 8.1.3

Notes:
Here is the sample Xcode project that I built to replicate this behavior. https://github.com/than/Open-a-Link



Configuration:
iPad Air

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!