haikuwebkit/Source/WebCore/platform/ios
Devin Rousso 2c6dee95cc [macOS] REGRESSION(r278850): modifying `playbackRate` via JS on a TouchBar mac only sometimes works and also causes the `defaultPlaybackRate` to change
https://bugs.webkit.org/show_bug.cgi?id=228939
<rdar://problem/80427578>

Reviewed by Eric Carlson.

Source/WebCore:

Test: VideoControlsManager.VideoControlsManagerDoesNotChangeValuesExposedToJavaScript

* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
Make sure to change the `defaultPlaybackRate` before the `rate` as otherwise the former will
override changes made to the latter (see r278850 (and r277203) for details as to why).

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager setDefaultPlaybackRate:]):
(-[WebPlaybackControlsManager setDefaultPlaybackRate:fromJavaScript:]): Added.
(-[WebPlaybackControlsManager setRate:]):
(-[WebPlaybackControlsManager setRate:fromJavaScript:]): Added.
Add a way to distinguish whether the change to the `rate`/`defaultPlaybackRate` came from JS
or some native call (e.g. AVKit). If the former, don't propagate the change to the playback
model (which eventually is the `HTMLMediaElement` in the WebProcess) as that's where the
value came from in the first place. Note that we still want to propagate the `rate` to the
`defaultPlaybackRate` (and vice versa when `isPlaying`) in the UIProcess for the reasons
described in r278850 (and r277203), but we don't want to expose it to JS.

* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::rateChanged):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController setDefaultPlaybackRate:]):
(-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]): Added.
(-[WebAVPlayerController setRate:]):
(-[WebAVPlayerController setRate:fromJavaScript:]): Added.
Drive-by: r278850 was based r277203 (which added the above), so fix that code now too.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/VideoControlsManager.mm:
(TestWebKitAPI::TEST.VideoControlsManager.VideoControlsManagerDoesNotChangeValuesExposedToJavaScript): Added.


Canonical link: https://commits.webkit.org/240391@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-10 14:31:51 +00:00
..
wak Make CheckedLock the default Lock 2021-05-24 05:37:41 +00:00
AbstractPasteboard.h
ColorIOS.h
ColorIOS.mm
Device.cpp
Device.h
DeviceMotionClientIOS.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DeviceMotionClientIOS.mm Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DeviceOrientationClientIOS.h
DeviceOrientationClientIOS.mm
DeviceOrientationUpdateProvider.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DragImageIOS.mm Stop building WebGPU and the WHLSL compiler to decrease binary size 2021-07-30 03:53:49 +00:00
KeyEventCodesIOS.h
KeyEventIOS.mm
LegacyTileCache.h Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
LegacyTileCache.mm Replace LockHolder with Locker in local variables 2021-05-22 16:49:42 +00:00
LegacyTileGrid.h
LegacyTileGrid.mm
LegacyTileGridTile.h
LegacyTileGridTile.mm
LegacyTileLayer.h
LegacyTileLayer.mm
LegacyTileLayerPool.h
LegacyTileLayerPool.mm Rename Checked::unsafeGet() to Checked::value() 2021-06-02 05:21:13 +00:00
LocalCurrentGraphicsContextIOS.mm
LocalCurrentTraitCollection.h
LocalCurrentTraitCollection.mm
LocalizedDeviceModel.h
LocalizedDeviceModel.mm Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
MotionManagerClient.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
PasteboardIOS.mm Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
PlatformEventFactoryIOS.h
PlatformEventFactoryIOS.mm Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
PlatformPasteboardIOS.mm Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
PlatformScreenIOS.mm Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.) 2021-05-25 01:26:18 +00:00
PlatformSpeechSynthesizerIOS.mm
PlaybackSessionInterfaceAVKit.h [iOS] Fullscreen video playback gets stuck after interacting with the playback controls 2021-06-18 19:15:40 +00:00
PlaybackSessionInterfaceAVKit.mm [macOS] REGRESSION(r278850): modifying `playbackRate` via JS on a TouchBar mac only sometimes works and also causes the `defaultPlaybackRate` to change 2021-08-10 14:31:51 +00:00
PreviewConverterIOS.mm
QuickLook.h
QuickLook.mm Drop CheckedLock / CheckedCondition aliases 2021-05-24 18:29:01 +00:00
ScrollAnimatorIOS.h
ScrollAnimatorIOS.mm
ScrollViewIOS.mm
ScrollbarThemeIOS.h
ScrollbarThemeIOS.mm
SelectionGeometry.cpp
SelectionGeometry.h Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
SystemMemory.h
SystemMemoryIOS.cpp
ThemeIOS.h
ThemeIOS.mm
TileControllerMemoryHandlerIOS.cpp
TileControllerMemoryHandlerIOS.h
UserAgentIOS.mm
ValidationBubbleIOS.mm
VideoFullscreenInterfaceAVKit.h [iPadOS] A video cannot enter picture-in-picture when Safari is suspended 2021-06-24 03:34:52 +00:00
VideoFullscreenInterfaceAVKit.mm [iPadOS] A video cannot enter picture-in-picture when Safari is suspended 2021-06-24 03:34:52 +00:00
WebAVPlayerController.h [macOS] REGRESSION(r278850): modifying `playbackRate` via JS on a TouchBar mac only sometimes works and also causes the `defaultPlaybackRate` to change 2021-08-10 14:31:51 +00:00
WebAVPlayerController.mm [macOS] REGRESSION(r278850): modifying `playbackRate` via JS on a TouchBar mac only sometimes works and also causes the `defaultPlaybackRate` to change 2021-08-10 14:31:51 +00:00
WebBackgroundTaskController.h
WebBackgroundTaskController.mm
WebCoreMotionManager.h
WebCoreMotionManager.mm Next step toward using std::optional directly instead of through WTF::Optional typedef 2021-05-28 01:26:23 +00:00
WebEvent.h
WebEvent.mm
WebItemProviderPasteboard.h
WebItemProviderPasteboard.mm
WebSQLiteDatabaseTrackerClient.h
WebSQLiteDatabaseTrackerClient.mm Drop CheckedLock / CheckedCondition aliases 2021-05-24 18:29:01 +00:00
WebVideoFullscreenControllerAVKit.h
WebVideoFullscreenControllerAVKit.mm [iOS] Fullscreen video playback gets stuck after interacting with the playback controls 2021-06-18 19:15:40 +00:00
WidgetIOS.mm