Page visibility API doesn't fire when I select tabs

Originator:mika
Number:rdar://19728698 Date Originated:5.2.2015
Status:Open Resolved:
Product:iOS/Mobile Safari Product Version:8.1
Classification: Reproducible:
 
Summary:
I develop sites that use amazing sensor APIs available on iPhones. Sites are accessed mostly on Mobile Safari. Twisting the phone will trigger visual changes on a page.

When I tap tabs icon in bottom bar I will see the list of open tabs. Page is no longer fully visible and active.

I expect to get an event when page visibility changes. In iOS8 the event fires only after I've moved focus to another tab. In iOS7 the event fires as expected.

W3C specs for Page Visibility API:
http://www.w3.org/TR/page-visibility/

My test page with console.log():
http://www.ff5f00.com/visibilitychange.html

Steps to Reproduce:
1. Open a test page
2. Tap tabs icon at the bottom bar
3. You'll see list of open tabs

Expected Results:
Page visibility API will fire an event "webkitvisibilitychange".

document.webkitHidden boolean value is true. Meaning that page is hidden.

Actual Results:
Page visibility API does not fire an event "webkitvisibilitychange".

document.webkitHidden boolean value is false. Meaning that page is still visible.

Version:
iOS 8.1 (12B411)

Notes:


Configuration:
iPhone 5S wifi

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!