Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS][WK2] Add initial implementation for the Screen Orientation API
https://bugs.webkit.org/show_bug.cgi?id=245999 Reviewed by Wenson Hsieh. Add initial implementation for the Screen Orientation API on WebKit2 / iOS: - https://w3c.github.io/screen-orientation/#dom-screenorientation-type - https://w3c.github.io/screen-orientation/#angle-attribute-get-orientation-angle - https://w3c.github.io/screen-orientation/#Screen-orientation-change I tested manually on device that the API is working as intended. The feature is still behind an experimental feature flag, off by defaut. Things that are missing and will be implemented in a follow-up: - Test harness changes for automated testing - Pre-conditions for locking / unlocking (e.g. user gesture, full screen) * Source/WebCore/Headers.cmake: * Source/WebCore/PAL/pal/ios/UIKitSoftLink.h: * Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm: * Source/WebCore/Sources.txt: * Source/WebCore/SourcesCocoa.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/dom/Exception.h: (WebCore::Exception::encode const): (WebCore::Exception::decode): * Source/WebCore/page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::screenOrientationManager const): * Source/WebCore/page/Page.h: * Source/WebCore/page/PageConfiguration.cpp: * Source/WebCore/page/PageConfiguration.h: * Source/WebCore/page/ScreenOrientation.cpp: (WebCore::ScreenOrientation::ScreenOrientation): (WebCore::ScreenOrientation::~ScreenOrientation): (WebCore::ScreenOrientation::manager const): (WebCore::ScreenOrientation::lock): (WebCore::ScreenOrientation::unlock): (WebCore::ScreenOrientation::type const): (WebCore::ScreenOrientation::angle const): (WebCore::ScreenOrientation::visibilityStateChanged): (WebCore::ScreenOrientation::shouldListenForChangeNotification const): (WebCore::ScreenOrientation::screenOrientationDidChange): (WebCore::ScreenOrientation::suspend): (WebCore::ScreenOrientation::resume): (WebCore::ScreenOrientation::stop): * Source/WebCore/page/ScreenOrientation.h: * Source/WebCore/page/ScreenOrientationLockType.h: * Source/WebCore/page/ScreenOrientationType.h: * Source/WebCore/platform/ScreenOrientationManager.h: Copied from Source/WebCore/page/ScreenOrientationLockType.h. (WebCore::ScreenOrientationManager::~ScreenOrientationManager): (WebCore::ScreenOrientationManager::Observer::~Observer): * Source/WebCore/platform/ScreenOrientationProvider.cpp: Added. (WebCore::globalProvider): (WebCore::ScreenOrientationProvider::getOrCreate): (WebCore::ScreenOrientationProvider::~ScreenOrientationProvider): (WebCore::ScreenOrientationProvider::addObserver): (WebCore::ScreenOrientationProvider::removeObserver): (WebCore::ScreenOrientationProvider::screenOrientationDidChange): (WebCore::ScreenOrientationProvider::currentOrientation): (WebCore::ScreenOrientationProvider::platformCurrentOrientation): (WebCore::ScreenOrientationProvider::platformStartListeningForChanges): (WebCore::ScreenOrientationProvider::platformStopListeningForChanges): (WebCore::ScreenOrientationProvider::platformDestroy): * Source/WebCore/platform/ScreenOrientationProvider.h: Copied from Source/WebCore/page/ScreenOrientation.h. (WebCore::ScreenOrientationProvider::Observer::~Observer): * Source/WebCore/platform/ios/ScreenOrientationProviderIOS.mm: Added. (currentOrientationFromCurrentUIDevice): (-[WebScreenOrientationObserver initWithProvider:]): (-[WebScreenOrientationObserver dealloc]): (-[WebScreenOrientationObserver _screenOrientationDidChange]): (WebCore::ScreenOrientationProvider::platformCurrentOrientation): (WebCore::ScreenOrientationProvider::platformStartListeningForChanges): (WebCore::ScreenOrientationProvider::platformStopListeningForChanges): (WebCore::ScreenOrientationProvider::platformDestroy): * Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: * Source/WebKit/CMakeLists.txt: * Source/WebKit/DerivedSources-input.xcfilelist: * Source/WebKit/DerivedSources-output.xcfilelist: * Source/WebKit/DerivedSources.make: * Source/WebKit/Sources.txt: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::resetState): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebScreenOrientationManagerProxy.cpp: Added. (WebKit::WebScreenOrientationManagerProxy::WebScreenOrientationManagerProxy): (WebKit::WebScreenOrientationManagerProxy::~WebScreenOrientationManagerProxy): (WebKit::WebScreenOrientationManagerProxy::currentOrientation): (WebKit::WebScreenOrientationManagerProxy::lock): (WebKit::WebScreenOrientationManagerProxy::unlock): (WebKit::WebScreenOrientationManagerProxy::screenOrientationDidChange): (WebKit::WebScreenOrientationManagerProxy::setShouldSendChangeNotification): * Source/WebKit/UIProcess/WebScreenOrientationManagerProxy.h: Copied from Source/WebCore/page/ScreenOrientation.h. * Source/WebKit/UIProcess/WebScreenOrientationManagerProxy.messages.in: Copied from Source/WebCore/page/ScreenOrientationType.h. * Source/WebKit/WebKit.xcodeproj/project.pbxproj: * Source/WebKit/WebProcess/WebCoreSupport/WebScreenOrientationManager.cpp: Added. (WebKit::WebScreenOrientationManager::WebScreenOrientationManager): (WebKit::WebScreenOrientationManager::~WebScreenOrientationManager): (WebKit::WebScreenOrientationManager::currentOrientation): (WebKit::WebScreenOrientationManager::orientationDidChange): (WebKit::WebScreenOrientationManager::lock): (WebKit::WebScreenOrientationManager::unlock): (WebKit::WebScreenOrientationManager::addObserver): (WebKit::WebScreenOrientationManager::removeObserver): * Source/WebKit/WebProcess/WebCoreSupport/WebScreenOrientationManager.h: Copied from Source/WebCore/page/ScreenOrientationLockType.h. * Source/WebKit/WebProcess/WebCoreSupport/WebScreenOrientationManager.messages.in: Copied from Source/WebCore/page/ScreenOrientationType.h. * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): * Source/WebKit/WebProcess/WebPage/WebPage.h: Canonical link: https://commits.webkit.org/255155@main
- Loading branch information
Showing
43 changed files
with
1,172 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.