Cocoa webviews do not handle webkitRequestFullScreen() in javascripts

Originator:barijaona
Number:rdar://18450829 Date Originated:25-sept-2014
Status:Open Resolved:
Product:OS X Product Version:OS X 10.9 +
Classification: Reproducible:
 
Webpages that allow fullscreen mode (and perform that correctly in Safari) do not operate correctly in other Cocoa apps.

Among other annoyances, this blocks YouTube and Vimeo HTML5 players.

Steps to Reproduce:
1. visit the fullscreen demo page at <http://sindresorhus.com/screenfull.js/>

2. click the 'Request' button. The page enters in full screen mode. Hit the Escape key to exit.

3. Create a simple Cocoa app, with an included webview. Make the webview load the same page (<http://sindresorhus.com/screenfull.js/>)
An example Xcode project is attached.

4. After the above mentioned webpage has loaded, click the 'Request' button. Note that the button doesn't produce any effect.

5. Quit the application, and enable WebKit web inspector. (In the case of the attached app, you have to type in Terminal : defaults write com.barijaona.TrialFullScreen WebKitDeveloperExtras -bool true)

6. Relaunch the app. Right-click in the web view and select 'Inspect Element'. The web inspector opens in a separate window.

7. Select the fullscreen.js script, and put a breakpoint in front of its line numbered 76.

7. Click again the 'Request' button. The inspector moves to its debugger pane. Execute step by step the script's instructions. Nothing noticeable happens.

8. Return to Safari and make sure Safari developer menu is enabled.

9. In Safari, put a breakpoint in front of line 76 of fullscreen.js

10. In Safari, click again the 'Request' button. The inspector moves to its debugger pane. Execute step by step the script's instructions. You will notice that the switch to full screen happens at line 88.


Expected Results:
At step 2 of the above mentioned sequence, the web view should enter fullscreen mode.

Actual Results:
The 'Request' button of the page at http://sindresorhus.com/screenfull.js/ works perfectly in Safari, but not in other Cocoa apps.

Comments

Test app available at https://github.com/barijaona/TrialFullScreen-radar18450829

By barijaona at Oct. 4, 2015, 4:32 p.m. (reply...)

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!