Summary: | Adopt -[UIWindowScene interfaceOrientation] when determining device orientation | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||
Component: | WebKit2 | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bdakin, darin, megan_gardner, thorton, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Wenson Hsieh
2020-03-20 21:38:47 PDT
Created attachment 394183 [details]
Patch
Comment on attachment 394183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394183&action=review How can we make an automated test for this? > Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:229 > + auto *application = UIApplication.sharedApplication; Just auto would be better. Let’s dodge the * placement issue. > Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:234 > + else if (auto *windowScene = self.window.windowScene) Ditto. Comment on attachment 394183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394183&action=review I considered writing an API test for this that would mock out -_appAdoptsUISceneLifecycle to return YES, but I don't think such a test would be very useful. Generally, writing an API test for this is tricky, because TestWebKitAPI isn't even a UI application on iOS, and so the UIApplication, windows, and their window scenes would all need to be mocked by the test. I think when we eventually convert WebKitTestRunnerApp into a scene-based UIApplication, we'll be able to get test coverage for this codepath. >> Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:229 >> + auto *application = UIApplication.sharedApplication; > > Just auto would be better. Let’s dodge the * placement issue. Sounds good — changed to just auto. >> Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:234 >> + else if (auto *windowScene = self.window.windowScene) > > Ditto. Changed to just auto. Created attachment 394222 [details]
Patch for landing
Committed r258821: <https://trac.webkit.org/changeset/258821> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394222 [details]. |