[webkit-changes] [291144] trunk

2022-03-10 Thread peng . liu6
Title: [291144] trunk








Revision 291144
Author peng.l...@apple.com
Date 2022-03-10 21:03:26 -0800 (Thu, 10 Mar 2022)


Log Message
EnterPictureInPictureEvent event was renamed to PictureInPictureEvent in spec
https://bugs.webkit.org/show_bug.cgi?id=221083

Reviewed by Youenn Fablet.

Source/WebCore:

Some updates based on the spec changes:
- Rename EnterPictureInPictureEvent.idl to PictureInPictureEvent.idl.
- leavepictureinpicture event should be fired with the Picture-in-Picture window.
(https://github.com/w3c/picture-in-picture/issues/188)

Covered by media/picture-in-picture/picture-in-picture-api-events.html.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:
(WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
* Modules/pictureinpicture/PictureInPictureEvent.cpp: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.cpp.
(WebCore::PictureInPictureEvent::create):
(WebCore::PictureInPictureEvent::PictureInPictureEvent):
* Modules/pictureinpicture/PictureInPictureEvent.h: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.h.
* Modules/pictureinpicture/PictureInPictureEvent.idl: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

LayoutTests:

* media/picture-in-picture/picture-in-picture-api-events-expected.txt:
* media/picture-in-picture/picture-in-picture-api-events.html:
Check the picture-in-picture window in the "leavepictureinpicture" event handler.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events-expected.txt
trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events.html
trunk/Source/WebCore/CMakeLists.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/DerivedSources-input.xcfilelist
trunk/Source/WebCore/DerivedSources-output.xcfilelist
trunk/Source/WebCore/DerivedSources.make
trunk/Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp
trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
trunk/Source/WebCore/dom/EventNames.in
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm


Added Paths

trunk/Source/WebCore/Modules/pictureinpicture/PictureInPictureEvent.cpp
trunk/Source/WebCore/Modules/pictureinpicture/PictureInPictureEvent.h
trunk/Source/WebCore/Modules/pictureinpicture/PictureInPictureEvent.idl


Removed Paths

trunk/Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.cpp
trunk/Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.h
trunk/Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.idl




Diff

Modified: trunk/LayoutTests/ChangeLog (291143 => 291144)

--- trunk/LayoutTests/ChangeLog	2022-03-11 03:22:03 UTC (rev 291143)
+++ trunk/LayoutTests/ChangeLog	2022-03-11 05:03:26 UTC (rev 291144)
@@ -1,3 +1,14 @@
+2022-03-10  Peng Liu  
+
+EnterPictureInPictureEvent event was renamed to PictureInPictureEvent in spec
+https://bugs.webkit.org/show_bug.cgi?id=221083
+
+Reviewed by Youenn Fablet.
+
+* media/picture-in-picture/picture-in-picture-api-events-expected.txt:
+* media/picture-in-picture/picture-in-picture-api-events.html:
+Check the picture-in-picture window in the "leavepictureinpicture" event handler.
+
 2022-03-10  Chris Dumez  
 
 Main document is leaking on haaretz.co.il due to lazy image loading


Modified: trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events-expected.txt (291143 => 291144)

--- trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events-expected.txt	2022-03-11 03:22:03 UTC (rev 291143)
+++ trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events-expected.txt	2022-03-11 05:03:26 UTC (rev 291144)
@@ -8,5 +8,6 @@
 EXPECTED (pipWindow.width > '0') OK
 EXPECTED (pipWindow.height > '0') OK
 EVENT(leavepictureinpicture)
+EXPECTED (pipWindow == pipWindow1 == 'true') OK
 END OF TEST
 


Modified: trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events.html (291143 => 291144)

--- trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events.html	2022-03-11 03:22:03 UTC (rev 291143)
+++ trunk/LayoutTests/media/picture-in-picture/picture-in-picture-api-events.html	2022-03-11 05:03:26 UTC (rev 291144)
@@ -28,7 +28,11 @@
 testExpected('pipWindow.height', 0, '>');
 
 document.exitPictureInPicture();
-

[webkit-changes] [290997] trunk/Source/WebCore

2022-03-08 Thread peng . liu6
Title: [290997] trunk/Source/WebCore








Revision 290997
Author peng.l...@apple.com
Date 2022-03-08 09:29:11 -0800 (Tue, 08 Mar 2022)


Log Message
[iOS] Flash media controls when a fullscreen video resets its source
https://bugs.webkit.org/show_bug.cgi?id=237493

Reviewed by Jer Noble.

Source/WebCore:

Some pages reset the fullscreen video's source when a user rotates the device.
The screen will become black for a while, and users might think the player is broken.
With this patch, the player will show the media controls for 1 second when the source
is changed, so that users will know the player is working.

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
`_presentingViewController` is only used for watchOS.
(-[WebAVPlayerViewController flashPlaybackControlsWithDuration:]):
(VideoFullscreenInterfaceAVKit::setPlayerIdentifier):

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (290996 => 290997)

--- trunk/Source/WebCore/ChangeLog	2022-03-08 17:15:30 UTC (rev 290996)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 17:29:11 UTC (rev 290997)
@@ -1,3 +1,21 @@
+2022-03-08  Peng Liu  
+
+[iOS] Flash media controls when a fullscreen video resets its source
+https://bugs.webkit.org/show_bug.cgi?id=237493
+
+Reviewed by Jer Noble.
+
+Some pages reset the fullscreen video's source when a user rotates the device.
+The screen will become black for a while, and users might think the player is broken.
+With this patch, the player will show the media controls for 1 second when the source
+is changed, so that users will know the player is working.
+
+* platform/ios/VideoFullscreenInterfaceAVKit.h:
+* platform/ios/VideoFullscreenInterfaceAVKit.mm:
+`_presentingViewController` is only used for watchOS.
+(-[WebAVPlayerViewController flashPlaybackControlsWithDuration:]):
+(VideoFullscreenInterfaceAVKit::setPlayerIdentifier):
+
 2022-03-08  Alex Christensen  
 
 WebSocket.send() should synchronously update bufferedAmount


Modified: trunk/Source/WebCore/PAL/ChangeLog (290996 => 290997)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-03-08 17:15:30 UTC (rev 290996)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-03-08 17:29:11 UTC (rev 290997)
@@ -1,3 +1,12 @@
+2022-03-08  Peng Liu  
+
+[iOS] Flash media controls when a fullscreen video resets its source
+https://bugs.webkit.org/show_bug.cgi?id=237493
+
+Reviewed by Jer Noble.
+
+* pal/spi/cocoa/AVKitSPI.h:
+
 2022-03-07  Jean-Yves Avenard  
 
 MediaTime::invalidTime() conversion to CMTime incorrectly creates a valid time.


Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h (290996 => 290997)

--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h	2022-03-08 17:15:30 UTC (rev 290996)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h	2022-03-08 17:29:11 UTC (rev 290997)
@@ -205,6 +205,8 @@
 - (void)startPictureInPicture;
 - (void)stopPictureInPicture;
 
+- (void)flashPlaybackControlsWithDuration:(NSTimeInterval)duration;
+
 @property (nonatomic, strong, nullable) AVPlayerController *playerController;
 @property (nonatomic, readonly, getter=isPictureInPictureActive) BOOL pictureInPictureActive;
 @property (nonatomic, readonly) BOOL pictureInPictureWasStartedWhenEnteringBackground;


Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (290996 => 290997)

--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2022-03-08 17:15:30 UTC (rev 290996)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2022-03-08 17:29:11 UTC (rev 290997)
@@ -78,7 +78,7 @@
 WEBCORE_EXPORT void hasVideoChanged(bool) final;
 WEBCORE_EXPORT void videoDimensionsChanged(const FloatSize&) final;
 WEBCORE_EXPORT void modelDestroyed() final;
-void setPlayerIdentifier(std::optional identifier) final { m_playerIdentifier = identifier; }
+WEBCORE_EXPORT void setPlayerIdentifier(std::optional) final;
 
 // PlaybackSessionModelClient
 WEBCORE_EXPORT void externalPlaybackChanged(bool enabled, PlaybackSessionModel::ExternalPlaybackTargetType, const String& localizedDeviceName) final;


Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (290996 => 290997)

--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2022-03-08 17:15:30 UTC (rev 290996)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2022-03-08 17:29:11 UTC (rev 290997)
@@ -56,6 +56,10 @@
 #import 
 #import 
 
+#if !PLATFORM(WATCHOS)
+static const NSTimeInterval 

[webkit-changes] [290892] trunk/Source

2022-03-07 Thread peng . liu6
Title: [290892] trunk/Source








Revision 290892
Author peng.l...@apple.com
Date 2022-03-07 09:29:22 -0800 (Mon, 07 Mar 2022)


Log Message
Small cleanups of media code
https://bugs.webkit.org/show_bug.cgi?id=237496

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

No new tests. No behavior change.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): `schedulePlaybackControlsManagerUpdate()` is
called in both branches.

Source/WebKit:

* WebProcess/cocoa/PlaybackSessionManager.h: `protected` is not needed here.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290891 => 290892)

--- trunk/Source/WebCore/ChangeLog	2022-03-07 17:13:17 UTC (rev 290891)
+++ trunk/Source/WebCore/ChangeLog	2022-03-07 17:29:22 UTC (rev 290892)
@@ -1,3 +1,16 @@
+2022-03-07  Peng Liu  
+
+Small cleanups of media code
+https://bugs.webkit.org/show_bug.cgi?id=237496
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+No new tests. No behavior change.
+
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::updatePlayState): `schedulePlaybackControlsManagerUpdate()` is
+called in both branches.
+
 2022-03-07  Antoine Quint  
 
 [web-animations] text-emphasis-style should support discrete animations


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (290891 => 290892)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-03-07 17:13:17 UTC (rev 290891)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2022-03-07 17:29:22 UTC (rev 290892)
@@ -5622,9 +5622,8 @@
 #endif
 }
 
+schedulePlaybackControlsManagerUpdate();
 if (shouldBePlaying) {
-schedulePlaybackControlsManagerUpdate();
-
 invalidateCachedTime();
 
 if (playerPaused) {
@@ -5649,8 +5648,6 @@
 startPlaybackProgressTimer();
 setPlaying(true);
 } else {
-schedulePlaybackControlsManagerUpdate();
-
 if (!playerPaused)
 pausePlayer();
 refreshCachedTime();


Modified: trunk/Source/WebKit/ChangeLog (290891 => 290892)

--- trunk/Source/WebKit/ChangeLog	2022-03-07 17:13:17 UTC (rev 290891)
+++ trunk/Source/WebKit/ChangeLog	2022-03-07 17:29:22 UTC (rev 290892)
@@ -1,3 +1,12 @@
+2022-03-07  Peng Liu  
+
+Small cleanups of media code
+https://bugs.webkit.org/show_bug.cgi?id=237496
+
+Reviewed by Xabier Rodriguez-Calvar.
+
+* WebProcess/cocoa/PlaybackSessionManager.h: `protected` is not needed here.
+
 2022-03-07  Adrian Perez de Castro  
 
 [GTK] generate-automation-atom.py breaks reproducible builds


Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h (290891 => 290892)

--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h	2022-03-07 17:13:17 UTC (rev 290891)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h	2022-03-07 17:29:22 UTC (rev 290892)
@@ -110,7 +110,7 @@
 
 WebCore::HTMLMediaElement* currentPlaybackControlsElement() const;
 
-protected:
+private:
 friend class PlaybackSessionInterfaceContext;
 friend class VideoFullscreenManager;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [290133] trunk/Source/WebCore

2022-02-18 Thread peng . liu6
Title: [290133] trunk/Source/WebCore








Revision 290133
Author peng.l...@apple.com
Date 2022-02-18 09:32:52 -0800 (Fri, 18 Feb 2022)


Log Message
[iOS][Modern Media Controls] Add an alternative overflow icon
https://bugs.webkit.org/show_bug.cgi?id=236729

Reviewed by Devin Rousso.

Add a new overflow icon. By default, the media controls will use the
original overflow icon. So this patch does not change the appearance of
the media controls.

* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/layout-traits.js:
(LayoutTraits.prototype.overflowButtonHasCircle):
* Modules/modern-media-controls/controls/overflow-button.js:
(OverflowButton):
* Modules/modern-media-controls/images/iOS/OverflowCircle.svg: Added.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js
trunk/Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js
trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js


Added Paths

trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/OverflowCircle.svg




Diff

Modified: trunk/Source/WebCore/ChangeLog (290132 => 290133)

--- trunk/Source/WebCore/ChangeLog	2022-02-18 17:29:54 UTC (rev 290132)
+++ trunk/Source/WebCore/ChangeLog	2022-02-18 17:32:52 UTC (rev 290133)
@@ -1,3 +1,21 @@
+2022-02-18  Peng Liu  
+
+[iOS][Modern Media Controls] Add an alternative overflow icon
+https://bugs.webkit.org/show_bug.cgi?id=236729
+
+Reviewed by Devin Rousso.
+
+Add a new overflow icon. By default, the media controls will use the
+original overflow icon. So this patch does not change the appearance of
+the media controls.
+
+* Modules/modern-media-controls/controls/icon-service.js:
+* Modules/modern-media-controls/controls/layout-traits.js:
+(LayoutTraits.prototype.overflowButtonHasCircle):
+* Modules/modern-media-controls/controls/overflow-button.js:
+(OverflowButton):
+* Modules/modern-media-controls/images/iOS/OverflowCircle.svg: Added.
+
 2022-02-18  Xabier Rodriguez Calvar  
 
 [EME][GStreamer][Thunder] Add video/x-h265 caps to Thunder decryptor


Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js (290132 => 290133)

--- trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js	2022-02-18 17:29:54 UTC (rev 290132)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js	2022-02-18 17:32:52 UTC (rev 290133)
@@ -35,6 +35,7 @@
 InvalidCircle   : { name: "InvalidCircle", type: "pdf", label: UIString("Invalid") },
 InvalidPlacard  : { name: "invalid-placard", type: "png", label: UIString("Invalid") },
 Overflow: { name: "Overflow", type: "svg", label: UIString("More\u2026") },
+OverflowCircle  : { name: "OverflowCircle", type: "svg", label: UIString("More\u2026") },
 Pause   : { name: "Pause", type: "svg", label: UIString("Pause") },
 PiPPlacard  : { name: "pip-placard", type: "png", label: UIString("Picture in Picture") },
 Play: { name: "Play", type: "svg", label: UIString("Play") },


Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js (290132 => 290133)

--- trunk/Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js	2022-02-18 17:29:54 UTC (rev 290132)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/layout-traits.js	2022-02-18 17:32:52 UTC (rev 290133)
@@ -91,6 +91,11 @@
 throw "Derived class must implement this function.";
 }
 
+overflowButtonHasCircle()
+{
+return false;
+}
+
 additionalControlScaleFactor()
 {
 return 1;


Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js (290132 => 290133)

--- trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js	2022-02-18 17:29:54 UTC (rev 290132)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js	2022-02-18 17:32:52 UTC (rev 290133)
@@ -30,7 +30,7 @@
 {
 super({
 cssClassName: "overflow",
-iconName: Icons.Overflow,
+iconName: layoutDelegate?.layoutTraits?.overflowButtonHasCircle() ? Icons.OverflowCircle : Icons.Overflow,
 layoutDelegate,
 });
 


Added: trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/OverflowCircle.svg (0 => 290133)

--- trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/OverflowCircle.svg	(rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/OverflowCircle.svg	2022-02-18 17:32:52 UTC (rev 290133)
@@ -0,0 +1,4 @@
+
+
+
+






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289751] trunk/Source/WebCore

2022-02-14 Thread peng . liu6
Title: [289751] trunk/Source/WebCore








Revision 289751
Author peng.l...@apple.com
Date 2022-02-14 12:12:50 -0800 (Mon, 14 Feb 2022)


Log Message
Add a centerControlsBar in InlineMediaControls
https://bugs.webkit.org/show_bug.cgi?id=236575

Reviewed by Jer Noble.

When a subclass of `InlineMediaControls` implements `_centerContainerButtons()`
to return a list of elements, a control bar will be added as a child of the
media-controls element.

No behavior change so far.

* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls):
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._centerContainerButtons):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js




Diff

Modified: trunk/Source/WebCore/ChangeLog (289750 => 289751)

--- trunk/Source/WebCore/ChangeLog	2022-02-14 19:57:43 UTC (rev 289750)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 20:12:50 UTC (rev 289751)
@@ -1,3 +1,21 @@
+2022-02-14  Peng Liu  
+
+Add a centerControlsBar in InlineMediaControls
+https://bugs.webkit.org/show_bug.cgi?id=236575
+
+Reviewed by Jer Noble.
+
+When a subclass of `InlineMediaControls` implements `_centerContainerButtons()`
+to return a list of elements, a control bar will be added as a child of the
+media-controls element.
+
+No behavior change so far.
+
+* Modules/modern-media-controls/controls/inline-media-controls.js:
+(InlineMediaControls):
+(InlineMediaControls.prototype.layout):
+(InlineMediaControls.prototype._centerContainerButtons):
+
 2022-02-14  Antti Koivisto  
 
 [CSS Container Queries] Implement full query parser and evaluator


Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js (289750 => 289751)

--- trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2022-02-14 19:57:43 UTC (rev 289750)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2022-02-14 20:12:50 UTC (rev 289751)
@@ -44,6 +44,9 @@
 this.leftContainer = new ButtonsContainer({ cssClassName: "left" });
 this.rightContainer = new ButtonsContainer({ cssClassName: "right" });
 
+this.centerControlsBar = new ControlsBar("center");
+this._centerControlsBarContainer = this.centerControlsBar.addChild(new ButtonsContainer);
+
 this._shouldUseAudioLayout = false;
 this._shouldUseSingleBarLayout = false;
 this.showsStartButton = false;
@@ -129,6 +132,11 @@
 this.topLeftControlsBar.width = this._topLeftControlsBarContainer.width;
 this.topLeftControlsBar.visible = this._topLeftControlsBarContainer.children.some(button => button.visible);
 
+this._centerControlsBarContainer.children = this._centerContainerButtons();
+this._centerControlsBarContainer.layout();
+this.centerControlsBar.width = this._centerControlsBarContainer.width;
+this.centerControlsBar.visible = this._centerControlsBarContainer.children.some(button => button.visible);
+
 // Compute the visible size for the controls bar.
 if (!this._inlineInsideMargin)
 this._inlineInsideMargin = this.computedValueForStylePropertyInPx("--inline-controls-inside-margin");
@@ -224,6 +232,8 @@
 this.bottomControlsBar.children = controlsBarChildren;
 if (!this._shouldUseAudioLayout && !this._shouldUseSingleBarLayout)
 children.push(this.topLeftControlsBar);
+if (!this._shouldUseAudioLayout && !this._shouldUseSingleBarLayout && this._centerControlsBarContainer.children.length)
+children.push(this.centerControlsBar);
 children.push(this.bottomControlsBar);
 if (this.muteButton.style === Button.Styles.Corner || (this.muteButton.dropped && !this._shouldUseAudioLayout && !this._shouldUseSingleBarLayout))
 this._addTopRightBarWithMuteButtonToChildren(children);
@@ -265,6 +275,10 @@
 return [this.skipBackButton, this.playPauseButton, this.skipForwardButton];
 }
 
+_centerContainerButtons() {
+return [];
+}
+
 _rightContainerButtons()
 {
 if (this._shouldUseAudioLayout)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [288413] trunk/Source/WebCore

2022-01-22 Thread peng . liu6
Title: [288413] trunk/Source/WebCore








Revision 288413
Author peng.l...@apple.com
Date 2022-01-22 19:38:09 -0800 (Sat, 22 Jan 2022)


Log Message
REGRESSION (Safari 15?): Blob videos slow to pause, affects CBS and CNN
https://bugs.webkit.org/show_bug.cgi?id=234066

Reviewed by Jer Noble.

`MediaPlayerPrivateMediaSourceAVFObjC::playInternal()` calls `[m_synchronizer setRate:]`,
which will make the return value of `MediaPlayerPrivateMediaSourceAVFObjC::paused()` change
from true to false. But it won't push the new `paused` value back to the Web process.

`RemoteMediaPlayerProxy::play()` does call `sendCachedState()` after calling
`m_player->play()`, but because `MediaPlayerPrivateMediaSourceAVFObjC::playInternal()` is not
called in the same run loop, `sendCachedState()` won't send back the updated `paused` value either.

In most cases, this is not an issue, because other member functions of `RemoteMediaPlayerProxy`
will call `sendCachedState()` to push the updated `paused` value back to the Web process later.
However, we did find some videos need the `paused` value to be pushed back the Web process
in a timely manner.

No new tests, manually tested.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (288412 => 288413)

--- trunk/Source/WebCore/ChangeLog	2022-01-23 01:03:39 UTC (rev 288412)
+++ trunk/Source/WebCore/ChangeLog	2022-01-23 03:38:09 UTC (rev 288413)
@@ -1,3 +1,28 @@
+2022-01-22  Peng Liu  
+
+REGRESSION (Safari 15?): Blob videos slow to pause, affects CBS and CNN
+https://bugs.webkit.org/show_bug.cgi?id=234066
+
+Reviewed by Jer Noble.
+
+`MediaPlayerPrivateMediaSourceAVFObjC::playInternal()` calls `[m_synchronizer setRate:]`,
+which will make the return value of `MediaPlayerPrivateMediaSourceAVFObjC::paused()` change
+from true to false. But it won't push the new `paused` value back to the Web process.
+
+`RemoteMediaPlayerProxy::play()` does call `sendCachedState()` after calling
+`m_player->play()`, but because `MediaPlayerPrivateMediaSourceAVFObjC::playInternal()` is not
+called in the same run loop, `sendCachedState()` won't send back the updated `paused` value either.
+
+In most cases, this is not an issue, because other member functions of `RemoteMediaPlayerProxy`
+will call `sendCachedState()` to push the updated `paused` value back to the Web process later.
+However, we did find some videos need the `paused` value to be pushed back the Web process
+in a timely manner.
+
+No new tests, manually tested.
+
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
+
 2022-01-22  Said Abou-Hallawa  
 
 [GPU Process] Add the class 'SourceImage' to represent variants of image


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (288412 => 288413)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2022-01-23 01:03:39 UTC (rev 288412)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2022-01-23 03:38:09 UTC (rev 288413)
@@ -350,6 +350,8 @@
 UNUSED_PARAM(hostTime);
 [m_synchronizer setRate:m_rate];
 #endif
+
+m_player->playbackStateChanged();
 }
 
 void MediaPlayerPrivateMediaSourceAVFObjC::pause()
@@ -380,6 +382,8 @@
 UNUSED_PARAM(hostTime);
 [m_synchronizer setRate:0];
 #endif
+
+m_player->playbackStateChanged();
 }
 
 bool MediaPlayerPrivateMediaSourceAVFObjC::paused() const






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [288221] trunk/LayoutTests

2022-01-19 Thread peng . liu6
Title: [288221] trunk/LayoutTests








Revision 288221
Author peng.l...@apple.com
Date 2022-01-19 11:44:17 -0800 (Wed, 19 Jan 2022)


Log Message
Add a data URL resource loader performance test
https://bugs.webkit.org/show_bug.cgi?id=235325

Reviewed by Eric Carlson.

This patch is a follow-up of r287899. In local tests, the time taken
by a video element to load a data URL is about 2x of the time to load
the binary form of the media file.

* media/video-src-blob-perf-expected.txt: Added.
* media/video-src-blob-perf.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog


Added Paths

trunk/LayoutTests/media/video-src-blob-perf-expected.txt
trunk/LayoutTests/media/video-src-blob-perf.html




Diff

Modified: trunk/LayoutTests/ChangeLog (288220 => 288221)

--- trunk/LayoutTests/ChangeLog	2022-01-19 19:41:50 UTC (rev 288220)
+++ trunk/LayoutTests/ChangeLog	2022-01-19 19:44:17 UTC (rev 288221)
@@ -1,3 +1,17 @@
+2022-01-19  Peng Liu  
+
+Add a data URL resource loader performance test
+https://bugs.webkit.org/show_bug.cgi?id=235325
+
+Reviewed by Eric Carlson.
+
+This patch is a follow-up of r287899. In local tests, the time taken
+by a video element to load a data URL is about 2x of the time to load
+the binary form of the media file.
+
+* media/video-src-blob-perf-expected.txt: Added.
+* media/video-src-blob-perf.html: Added.
+
 2022-01-19  Rob Buis  
 
 Null check player in taintsOrigin


Added: trunk/LayoutTests/media/video-src-blob-perf-expected.txt (0 => 288221)

--- trunk/LayoutTests/media/video-src-blob-perf-expected.txt	(rev 0)
+++ trunk/LayoutTests/media/video-src-blob-perf-expected.txt	2022-01-19 19:44:17 UTC (rev 288221)
@@ -0,0 +1,4 @@
+This tests that a video element loads a blob URL in a reasonable amount of time (should be shorter than 5x of the time to load the binary form of the media file).
+
+END OF TEST
+


Added: trunk/LayoutTests/media/video-src-blob-perf.html (0 => 288221)

--- trunk/LayoutTests/media/video-src-blob-perf.html	(rev 0)
+++ trunk/LayoutTests/media/video-src-blob-perf.html	2022-01-19 19:44:17 UTC (rev 288221)
@@ -0,0 +1,72 @@
+
+
+
+
+var canplaythrough1 = false;
+var canplaythrough2 = false;
+var start1 = 0;
+var start2 = 0;
+var delta1 = 0;
+var delta2 = 0;
+
+function checkElementState() {
+if (canplaythrough1 && canplaythrough2) {
+if (delta1 * 5 > delta2)
+endTest();
+else
+failTest("Loading a data URL takes too long time. delta1 = " + delta1 + ", delta2 = " + delta2 + ".");
+}
+}
+
+function runTest() {
+const videos = document.querySelectorAll('video');
+const video1 = videos[0];
+const video2 = videos[1];
+
+const url = "" "content/long-test");
+
+video1._oncanplaythrough_ = () => {
+canplaythrough1 = true;
+delta1 = Date.now() - start1;
+checkElementState();
+}
+
+video2._oncanplaythrough_ = () => {
+canplaythrough2 = true;
+delta2 = Date.now() - start2;
+checkElementState();
+}
+
+const request = new XMLHttpRequest();
+request.open('GET', url, true);
+request.responseType = 'blob';
+
+request._onload_ = () => {
+const reader = new FileReader();
+reader._onload_ = event => {
+const createdDataUrl = event.target.result;
+video2.src = ""
+video1.src = ""
+
+const now = Date.now();
+start1 = now;
+start2 = now;
+};
+reader.readAsDataURL(request.response);
+};
+request.send();
+
+setTimeout(() => failTest("Cannot complete the test in 10 seconds."), 1);
+}
+
+
+
+
+This tests that a video element loads a blob URL in a reasonable amount of time (should be shorter than 5x of the time to load the binary form of the media file).
+
+
+
+
+






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [288053] trunk/Source/WebCore

2022-01-14 Thread peng . liu6
Title: [288053] trunk/Source/WebCore








Revision 288053
Author peng.l...@apple.com
Date 2022-01-14 23:30:01 -0800 (Fri, 14 Jan 2022)


Log Message
Unable to playback portrait videos on HTML canvas elements
https://bugs.webkit.org/show_bug.cgi?id=235238

Reviewed by Jer Noble.

We need to make sure the destination pixel buffer is IOSurface-backed.
Otherwise, VTImageRotationSession cannot rotate a pixel buffer with
a compressed pixel format.

Manually tested.

Layout tests for this exist, but unless they run on an iPhone 12 or
later HW, they won't fail. For example:
- media/video-orientation-canvas.html

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
* platform/graphics/cv/ImageRotationSessionVT.mm:
(WebCore::ImageRotationSessionVT::rotate):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (288052 => 288053)

--- trunk/Source/WebCore/ChangeLog	2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/ChangeLog	2022-01-15 07:30:01 UTC (rev 288053)
@@ -1,3 +1,25 @@
+2022-01-14  Peng Liu  
+
+Unable to playback portrait videos on HTML canvas elements
+https://bugs.webkit.org/show_bug.cgi?id=235238
+
+Reviewed by Jer Noble.
+
+We need to make sure the destination pixel buffer is IOSurface-backed.
+Otherwise, VTImageRotationSession cannot rotate a pixel buffer with
+a compressed pixel format.
+
+Manually tested.
+
+Layout tests for this exist, but unless they run on an iPhone 12 or
+later HW, they won't fail. For example:
+- media/video-orientation-canvas.html
+
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
+* platform/graphics/cv/ImageRotationSessionVT.mm:
+(WebCore::ImageRotationSessionVT::rotate):
+
 2022-01-14  Frederic Wang  
 
 null ptr deref in WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor()


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (288052 => 288053)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-01-15 07:30:01 UTC (rev 288053)
@@ -2556,7 +2556,7 @@
 };
 }
 
-if (m_imageRotationSession)
+if (m_lastPixelBuffer && m_imageRotationSession)
 m_lastPixelBuffer = m_imageRotationSession->rotate(m_lastPixelBuffer.get());
 
 m_lastImage = nullptr;


Modified: trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm (288052 => 288053)

--- trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm	2022-01-15 07:00:43 UTC (rev 288052)
+++ trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm	2022-01-15 07:30:01 UTC (rev 288053)
@@ -102,9 +102,7 @@
 (__bridge NSString *)kCVPixelBufferHeightKey: @(m_rotatedSize.height()),
 (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(m_pixelFormat),
 (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: (m_isCGImageCompatible == IsCGImageCompatible::Yes ? @YES : @NO),
-#if PLATFORM(IOS_SIMULATOR) || PLATFORM(MAC)
 (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ }
-#endif
 };
 
 CVPixelBufferPoolRef rawPool = nullptr;
@@ -119,7 +117,7 @@
 RetainPtr result;
 CVPixelBufferRef rawRotatedBuffer = nullptr;
 auto status = CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, m_rotationPool.get(), );
-if (status != kCVReturnSuccess) {
+if (status != kCVReturnSuccess || !rawRotatedBuffer) {
 RELEASE_LOG_ERROR(WebRTC, "ImageRotationSessionVT failed creating buffer from pool with error %d", status);
 return nullptr;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287980] trunk/Source/WebCore

2022-01-13 Thread peng . liu6
Title: [287980] trunk/Source/WebCore








Revision 287980
Author peng.l...@apple.com
Date 2022-01-13 09:16:07 -0800 (Thu, 13 Jan 2022)


Log Message
Clean up MediaPlaybackTargetPicker::Client
https://bugs.webkit.org/show_bug.cgi?id=235128

Reviewed by Eric Carlson.

Small cleanup to remove an unused function and change override to final.

* Modules/airplay/WebMediaSessionManager.h:
* platform/graphics/MediaPlaybackTargetPicker.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/airplay/WebMediaSessionManager.h
trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (287979 => 287980)

--- trunk/Source/WebCore/ChangeLog	2022-01-13 16:22:10 UTC (rev 287979)
+++ trunk/Source/WebCore/ChangeLog	2022-01-13 17:16:07 UTC (rev 287980)
@@ -1,3 +1,15 @@
+2022-01-13  Peng Liu  
+
+Clean up MediaPlaybackTargetPicker::Client
+https://bugs.webkit.org/show_bug.cgi?id=235128
+
+Reviewed by Eric Carlson.
+
+Small cleanup to remove an unused function and change override to final.
+
+* Modules/airplay/WebMediaSessionManager.h:
+* platform/graphics/MediaPlaybackTargetPicker.h:
+
 2022-01-13  Ziran Sun  
 
 [css-grid] Fix rounding of distributed free space to flexible tracks


Modified: trunk/Source/WebCore/Modules/airplay/WebMediaSessionManager.h (287979 => 287980)

--- trunk/Source/WebCore/Modules/airplay/WebMediaSessionManager.h	2022-01-13 16:22:10 UTC (rev 287979)
+++ trunk/Source/WebCore/Modules/airplay/WebMediaSessionManager.h	2022-01-13 17:16:07 UTC (rev 287980)
@@ -75,9 +75,9 @@
 WebCore::MediaPlaybackTargetPickerMock& mockPicker();
 
 // MediaPlaybackTargetPicker::Client
-void setPlaybackTarget(Ref&&) override;
-void externalOutputDeviceAvailableDidChange(bool) override;
-void playbackTargetPickerWasDismissed() override;
+void setPlaybackTarget(Ref&&) final;
+void externalOutputDeviceAvailableDidChange(bool) final;
+void playbackTargetPickerWasDismissed() final;
 
 size_t find(WebMediaSessionManagerClient*, PlaybackTargetClientContextIdentifier);
 


Modified: trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h (287979 => 287980)

--- trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2022-01-13 16:22:10 UTC (rev 287979)
+++ trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h	2022-01-13 17:16:07 UTC (rev 287980)
@@ -47,8 +47,6 @@
 virtual void setPlaybackTarget(Ref&&) = 0;
 virtual void externalOutputDeviceAvailableDidChange(bool) = 0;
 virtual void playbackTargetPickerWasDismissed() = 0;
-
-void invalidate();
 };
 
 virtual ~MediaPlaybackTargetPicker();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287899] trunk/Source/WebCore

2022-01-11 Thread peng . liu6
Title: [287899] trunk/Source/WebCore








Revision 287899
Author peng.l...@apple.com
Date 2022-01-11 15:25:09 -0800 (Tue, 11 Jan 2022)


Log Message
DataURLResourceMediaLoader decodes the URL repeatedly during a video playback
https://bugs.webkit.org/show_bug.cgi?id=234940

Reviewed by Darin Adler.

In r264864, we adopted a new SPI to tell AVFoundation that the entire file is available for custom URLs.
As a result, during a video playback, AVFoundation will request small data ranges instead of "caching"
the whole file again.

However, that leads to efficiency issue for DataURLResourceMediaLoader. Because it needs to decode the whole
URL when AVFoundation requests a data range, which is inefficient when the URL is very long.

This patch reverts the change in r264864 for the DataURLResourceMediaLoader case to fix the performance issue.
If DataURLDecoder::decode() supports decoding a data range in the future, we can change it back for better
memory efficiency.

* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (287898 => 287899)

--- trunk/Source/WebCore/ChangeLog	2022-01-11 23:17:02 UTC (rev 287898)
+++ trunk/Source/WebCore/ChangeLog	2022-01-11 23:25:09 UTC (rev 287899)
@@ -1,3 +1,24 @@
+2022-01-11  Peng Liu  
+
+DataURLResourceMediaLoader decodes the URL repeatedly during a video playback
+https://bugs.webkit.org/show_bug.cgi?id=234940
+
+Reviewed by Darin Adler.
+
+In r264864, we adopted a new SPI to tell AVFoundation that the entire file is available for custom URLs.
+As a result, during a video playback, AVFoundation will request small data ranges instead of "caching"
+the whole file again.
+
+However, that leads to efficiency issue for DataURLResourceMediaLoader. Because it needs to decode the whole
+URL when AVFoundation requests a data range, which is inefficient when the URL is very long.
+
+This patch reverts the change in r264864 for the DataURLResourceMediaLoader case to fix the performance issue.
+If DataURLDecoder::decode() supports decoding a data range in the future, we can change it back for better
+memory efficiency.
+
+* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+(WebCore::WebCoreAVFResourceLoader::responseReceived):
+
 2022-01-11  Antoine Quint  
 
 css/css-transitions/KeyframeEffect-setKeyframes.tentative.html is a failure (part 2)


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (287898 => 287899)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2022-01-11 23:17:02 UTC (rev 287898)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2022-01-11 23:25:09 UTC (rev 287899)
@@ -357,8 +357,12 @@
 
 [contentInfo setContentLength:contentRange.isValid() ? contentRange.instanceLength() : response.expectedContentLength()];
 [contentInfo setByteRangeAccessSupported:YES];
-
-if ([contentInfo respondsToSelector:@selector(setEntireLengthAvailableOnDemand:)])
+
+// Do not set "EntireLengthAvailableOnDemand" to YES when the loader is DataURLResourceMediaLoader.
+// When the property is YES, AVAssetResourceLoader will request small data ranges over and over again
+// during the playback. For DataURLResourceMediaLoader, that means it needs to decode the URL repeatedly,
+// which is very inefficient for long URLs.
+if (!m_dataURLMediaLoader && [contentInfo respondsToSelector:@selector(setEntireLengthAvailableOnDemand:)])
 [contentInfo setEntireLengthAvailableOnDemand:YES];
 
 if (![m_avRequest dataRequest]) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287755] trunk/Source/WebKit

2022-01-07 Thread peng . liu6
Title: [287755] trunk/Source/WebKit








Revision 287755
Author peng.l...@apple.com
Date 2022-01-07 09:44:46 -0800 (Fri, 07 Jan 2022)


Log Message
Clean up FullscreenClient
https://bugs.webkit.org/show_bug.cgi?id=233076

Reviewed by Jer Noble.

This patch is a follow-up to r285741.
- Get rid of `WKFullscreenClientView` and use `WKWebView` instead.

* UIProcess/Cocoa/FullscreenClient.h:
* UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::FullscreenClient):
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.h
trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (287754 => 287755)

--- trunk/Source/WebKit/ChangeLog	2022-01-07 17:37:09 UTC (rev 287754)
+++ trunk/Source/WebKit/ChangeLog	2022-01-07 17:44:46 UTC (rev 287755)
@@ -1,3 +1,21 @@
+2022-01-07  Peng Liu  
+
+Clean up FullscreenClient
+https://bugs.webkit.org/show_bug.cgi?id=233076
+
+Reviewed by Jer Noble.
+
+This patch is a follow-up to r285741.
+- Get rid of `WKFullscreenClientView` and use `WKWebView` instead.
+
+* UIProcess/Cocoa/FullscreenClient.h:
+* UIProcess/Cocoa/FullscreenClient.mm:
+(WebKit::FullscreenClient::FullscreenClient):
+(WebKit::FullscreenClient::willEnterFullscreen):
+(WebKit::FullscreenClient::didEnterFullscreen):
+(WebKit::FullscreenClient::willExitFullscreen):
+(WebKit::FullscreenClient::didExitFullscreen):
+
 2022-01-07  Per Arne Vollan  
 
 [MacCatalyst] Add required syscall


Modified: trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.h (287754 => 287755)

--- trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.h	2022-01-07 17:37:09 UTC (rev 287754)
+++ trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.h	2022-01-07 17:44:46 UTC (rev 287755)
@@ -28,12 +28,10 @@
 #import "WKFoundation.h"
 
 #import "APIFullscreenClient.h"
+#import "WKWebView.h"
 #import 
 #import 
 
-@class WKWebView;
-using WKFullscreenClientView = WKWebView;
-
 @protocol _WKFullscreenDelegate;
 
 namespace WebKit {
@@ -40,7 +38,7 @@
 
 class FullscreenClient : public API::FullscreenClient {
 public:
-explicit FullscreenClient(WKFullscreenClientView *);
+explicit FullscreenClient(WKWebView *);
 ~FullscreenClient() { };
 
 bool isType(API::FullscreenClient::Type target) const override { return target == API::FullscreenClient::WebKitType; };
@@ -54,7 +52,7 @@
 void didExitFullscreen(WebPageProxy*) override;
 
 private:
-WKFullscreenClientView *m_webView;
+WKWebView *m_webView;
 WeakObjCPtr > m_delegate;
 
 struct {


Modified: trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm (287754 => 287755)

--- trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm	2022-01-07 17:37:09 UTC (rev 287754)
+++ trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm	2022-01-07 17:44:46 UTC (rev 287755)
@@ -30,7 +30,7 @@
 
 namespace WebKit {
 
-FullscreenClient::FullscreenClient(WKFullscreenClientView *webView)
+FullscreenClient::FullscreenClient(WKWebView *webView)
 : m_webView(webView)
 {
 }
@@ -63,7 +63,7 @@
 [m_webView didChangeValueForKey:@"fullscreenState"];
 #if PLATFORM(MAC)
 if (m_delegateMethods.webViewWillEnterFullscreen)
-[m_delegate.get() _webViewWillEnterFullscreen:static_cast(m_webView)];
+[m_delegate.get() _webViewWillEnterFullscreen:m_webView];
 #else
 if (m_delegateMethods.webViewWillEnterElementFullscreen)
 [m_delegate.get() _webViewWillEnterElementFullscreen:m_webView];
@@ -76,7 +76,7 @@
 [m_webView didChangeValueForKey:@"fullscreenState"];
 #if PLATFORM(MAC)
 if (m_delegateMethods.webViewDidEnterFullscreen)
-[m_delegate.get() _webViewDidEnterFullscreen:static_cast(m_webView)];
+[m_delegate.get() _webViewDidEnterFullscreen:m_webView];
 #else
 if (m_delegateMethods.webViewDidEnterElementFullscreen)
 [m_delegate.get() _webViewDidEnterElementFullscreen:m_webView];
@@ -89,7 +89,7 @@
 [m_webView didChangeValueForKey:@"fullscreenState"];
 #if PLATFORM(MAC)
 if (m_delegateMethods.webViewWillExitFullscreen)
-[m_delegate.get() _webViewWillExitFullscreen:static_cast(m_webView)];
+[m_delegate.get() _webViewWillExitFullscreen:m_webView];
 #else
 if (m_delegateMethods.webViewWillExitElementFullscreen)
 [m_delegate.get() _webViewWillExitElementFullscreen:m_webView];
@@ -102,7 +102,7 @@
 [m_webView didChangeValueForKey:@"fullscreenState"];
 #if PLATFORM(MAC)
 if (m_delegateMethods.webViewDidExitFullscreen)
-[m_delegate.get() _webViewDidExitFullscreen:static_cast(m_webView)];
+[m_delegate.get() _webViewDidExitFullscreen:m_webView];
 #else
 if 

[webkit-changes] [285741] trunk

2021-11-12 Thread peng . liu6
Title: [285741] trunk








Revision 285741
Author peng.l...@apple.com
Date 2021-11-12 14:14:26 -0800 (Fri, 12 Nov 2021)


Log Message
Promote WKPreferences._fullScreenEnabled to API
https://bugs.webkit.org/show_bug.cgi?id=230784


Reviewed by Jer Noble.

Source/WebKit:

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences isElementFullscreenEnabled]):
(-[WKPreferences setElementFullscreenEnabled:]):
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView fullscreenState]):
* UIProcess/Cocoa/FullscreenClient.h:
* UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
* UIProcess/WebFullScreenManagerProxy.h:
(WebKit::WebFullScreenManagerProxy::fullscreenState const):

Tools:

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate defaultConfiguration]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.h
trunk/Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp
trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h
trunk/Tools/ChangeLog
trunk/Tools/MiniBrowser/mac/AppDelegate.m




Diff

Modified: trunk/Source/WebKit/ChangeLog (285740 => 285741)

--- trunk/Source/WebKit/ChangeLog	2021-11-12 22:11:13 UTC (rev 285740)
+++ trunk/Source/WebKit/ChangeLog	2021-11-12 22:14:26 UTC (rev 285741)
@@ -1,3 +1,34 @@
+2021-11-12  Peng Liu  
+
+Promote WKPreferences._fullScreenEnabled to API
+https://bugs.webkit.org/show_bug.cgi?id=230784
+
+
+Reviewed by Jer Noble.
+
+* UIProcess/API/Cocoa/WKPreferences.h:
+* UIProcess/API/Cocoa/WKPreferences.mm:
+(-[WKPreferences isElementFullscreenEnabled]):
+(-[WKPreferences setElementFullscreenEnabled:]):
+* UIProcess/API/Cocoa/WKWebView.h:
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView fullscreenState]):
+* UIProcess/Cocoa/FullscreenClient.h:
+* UIProcess/Cocoa/FullscreenClient.mm:
+(WebKit::FullscreenClient::willEnterFullscreen):
+(WebKit::FullscreenClient::didEnterFullscreen):
+(WebKit::FullscreenClient::willExitFullscreen):
+(WebKit::FullscreenClient::didExitFullscreen):
+* UIProcess/Cocoa/WebViewImpl.mm:
+(WebKit::WebViewImpl::WebViewImpl):
+* UIProcess/WebFullScreenManagerProxy.cpp:
+(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
+(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
+(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
+(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
+* UIProcess/WebFullScreenManagerProxy.h:
+(WebKit::WebFullScreenManagerProxy::fullscreenState const):
+
 2021-11-12  Chris Dumez  
 
 Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h (285740 => 285741)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h	2021-11-12 22:11:13 UTC (rev 285740)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h	2021-11-12 22:14:26 UTC (rev 285741)
@@ -70,6 +70,11 @@
  */
 @property (nonatomic, getter=isSiteSpecificQuirksModeEnabled) BOOL siteSpecificQuirksModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
+/*! @abstract A Boolean value indicating whether Fullscreen API is enabled.
+ @discussion The default value is NO. We can set it to YES to enable support for the fullscreen API.
+ */
+@property (nonatomic, getter=isElementFullscreenEnabled) BOOL elementFullscreenEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 @end
 
 @interface WKPreferences (WKDeprecated)


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (285740 => 285741)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-11-12 22:11:13 UTC (rev 285740)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-11-12 22:14:26 UTC (rev 285741)
@@ -163,6 +163,16 @@
 _preferences->setNeedsSiteSpecificQuirks(enabled);
 }
 
+- (BOOL)isElementFullscreenEnabled
+{
+return _preferences->fullScreenEnabled();
+}
+
+- 

[webkit-changes] [285447] trunk

2021-11-08 Thread peng . liu6
Title: [285447] trunk








Revision 285447
Author peng.l...@apple.com
Date 2021-11-08 16:52:14 -0800 (Mon, 08 Nov 2021)


Log Message
Update Peng Liu's contributor status to reviewer
https://bugs.webkit.org/show_bug.cgi?id=232859

Unreviewed.


* metadata/contributors.json:

Modified Paths

trunk/ChangeLog
trunk/metadata/contributors.json




Diff

Modified: trunk/ChangeLog (285446 => 285447)

--- trunk/ChangeLog	2021-11-09 00:44:55 UTC (rev 285446)
+++ trunk/ChangeLog	2021-11-09 00:52:14 UTC (rev 285447)
@@ -1,3 +1,12 @@
+2021-11-08  Peng Liu  
+
+Update Peng Liu's contributor status to reviewer
+https://bugs.webkit.org/show_bug.cgi?id=232859
+
+Unreviewed.
+
+* metadata/contributors.json:
+
 2021-11-08  Cameron McCormack  
 
 Update my status to reviewer


Modified: trunk/metadata/contributors.json (285446 => 285447)

--- trunk/metadata/contributors.json	2021-11-09 00:44:55 UTC (rev 285446)
+++ trunk/metadata/contributors.json	2021-11-09 00:52:14 UTC (rev 285447)
@@ -5212,13 +5212,14 @@
},
{
   "emails" : [
- "peng.l...@apple.com"
+ "peng.l...@apple.com",
+ "peng.l...@icloud.com"
   ],
   "name" : "Peng Liu",
   "nicks" : [
  "peng"
   ],
-  "status" : "committer"
+  "status" : "reviewer"
},
{
   "emails" : [






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [284214] trunk

2021-10-14 Thread peng . liu6
Title: [284214] trunk








Revision 284214
Author peng.l...@apple.com
Date 2021-10-14 16:35:37 -0700 (Thu, 14 Oct 2021)


Log Message
Promote WKPreferences._needsSiteSpecificQuirks to API
https://bugs.webkit.org/show_bug.cgi?id=230721


Reviewed by Jer Noble.

Source/WebKit:

Add a new API `WKPreferences.isSetSiteSpecificQuirksModeEnabled`.

No new tests. Updated API tests to use the new API.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences isSiteSpecificQuirksModeEnabled]):
(-[WKPreferences setSiteSpecificQuirksModeEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

Updated API tests to use the new API.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (284213 => 284214)

--- trunk/Source/WebKit/ChangeLog	2021-10-14 23:30:09 UTC (rev 284213)
+++ trunk/Source/WebKit/ChangeLog	2021-10-14 23:35:37 UTC (rev 284214)
@@ -1,3 +1,21 @@
+2021-10-14  Peng Liu  
+
+Promote WKPreferences._needsSiteSpecificQuirks to API
+https://bugs.webkit.org/show_bug.cgi?id=230721
+
+
+Reviewed by Jer Noble.
+
+Add a new API `WKPreferences.isSetSiteSpecificQuirksModeEnabled`.
+
+No new tests. Updated API tests to use the new API.
+
+* UIProcess/API/Cocoa/WKPreferences.h:
+* UIProcess/API/Cocoa/WKPreferences.mm:
+(-[WKPreferences isSiteSpecificQuirksModeEnabled]):
+(-[WKPreferences setSiteSpecificQuirksModeEnabled:]):
+* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+
 2021-10-14  Alex Christensen  
 
 Remove Variant.h


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h (284213 => 284214)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h	2021-10-14 23:30:09 UTC (rev 284213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h	2021-10-14 23:35:37 UTC (rev 284214)
@@ -64,6 +64,12 @@
 */
 @property (nonatomic, getter=isTextInteractionEnabled) BOOL textInteractionEnabled WK_API_AVAILABLE(macos(11.3), ios(14.5));
 
+/*! @abstract A Boolean value indicating whether WebKit will apply built-in workarounds (quirks)
+ to improve compatibility with certain known websites. You can disable site-specific quirks
+ to help test your website without these workarounds. Enabled by default.
+ */
+@property (nonatomic, getter=isSiteSpecificQuirksModeEnabled) BOOL siteSpecificQuirksModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 @end
 
 @interface WKPreferences (WKDeprecated)


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (284213 => 284214)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-10-14 23:30:09 UTC (rev 284213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-10-14 23:35:37 UTC (rev 284214)
@@ -153,6 +153,16 @@
 _preferences->setTextInteractionEnabled(textInteractionEnabled);
 }
 
+- (BOOL)isSiteSpecificQuirksModeEnabled
+{
+return _preferences->needsSiteSpecificQuirks();
+}
+
+- (void)setSiteSpecificQuirksModeEnabled:(BOOL)enabled
+{
+_preferences->setNeedsSiteSpecificQuirks(enabled);
+}
+
 #pragma mark OS X-specific methods
 
 #if PLATFORM(MAC)


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (284213 => 284214)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2021-10-14 23:30:09 UTC (rev 284213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2021-10-14 23:35:37 UTC (rev 284214)
@@ -157,7 +157,7 @@
 @property (nonatomic, setter=_setShouldIgnoreMetaViewport:) BOOL _shouldIgnoreMetaViewport WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
 @property (nonatomic, setter=_setVideoQualityIncludesDisplayCompositingEnabled:) BOOL _videoQualityIncludesDisplayCompositingEnabled WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
 @property (nonatomic, setter=_setDeviceOrientationEventEnabled:) BOOL _deviceOrientationEventEnabled WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
-@property (nonatomic, setter=_setNeedsSiteSpecificQuirks:) BOOL _needsSiteSpecificQuirks WK_API_AVAILABLE(macos(10.13.4), ios(13.0));
+@property (nonatomic, setter=_setNeedsSiteSpecificQuirks:) BOOL _needsSiteSpecificQuirks WK_API_DEPRECATED_WITH_REPLACEMENT("siteSpecificQuirksModeEnabled", macos(10.13.4, WK_MAC_TBA), ios(13.0, WK_IOS_TBA));
 @property (nonatomic, setter=_setItpDebugModeEnabled:) BOOL _itpDebugModeEnabled WK_API_AVAILABLE(macos(10.15), ios(13.0));
 @property (nonatomic, setter=_setMediaSourceEnabled:) BOOL _mediaSourceEnabled WK_API_AVAILABLE(macos(10.13.4), ios(13.0));
 @property (nonatomic, setter=_setSecureContextChecksEnabled:) BOOL _secureContextChecksEnabled 

[webkit-changes] [282774] trunk/Source/WebCore

2021-09-20 Thread peng . liu6
Title: [282774] trunk/Source/WebCore








Revision 282774
Author peng.l...@apple.com
Date 2021-09-20 13:37:57 -0700 (Mon, 20 Sep 2021)


Log Message
[GPUP] Videos appear black but audio plays normally
https://bugs.webkit.org/show_bug.cgi?id=230471


Reviewed by Youenn Fablet.

For some videos, the media player (MediaPlayerPrivateAVFoundation) starts
with the "MediaRenderingToContext" mode, and it switches to the "MediaRenderingToLayer"
mode later. When the mode switch happens, we have to destroy the context
video renderer before creating the video layer. Otherwise, we won't receive
the notification regarding "readyForDisplay" key path, which drives the
`firstVideoFrameAvailable` callback.

`destroyContextVideoRenderer()` destroys the `m_videoOutput`, but it will
be recreated by `createVideoLayer()`.

Manually tested.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (282773 => 282774)

--- trunk/Source/WebCore/ChangeLog	2021-09-20 20:18:36 UTC (rev 282773)
+++ trunk/Source/WebCore/ChangeLog	2021-09-20 20:37:57 UTC (rev 282774)
@@ -1,3 +1,26 @@
+2021-09-20  Peng Liu  
+
+[GPUP] Videos appear black but audio plays normally
+https://bugs.webkit.org/show_bug.cgi?id=230471
+
+
+Reviewed by Youenn Fablet.
+
+For some videos, the media player (MediaPlayerPrivateAVFoundation) starts
+with the "MediaRenderingToContext" mode, and it switches to the "MediaRenderingToLayer"
+mode later. When the mode switch happens, we have to destroy the context
+video renderer before creating the video layer. Otherwise, we won't receive
+the notification regarding "readyForDisplay" key path, which drives the
+`firstVideoFrameAvailable` callback.
+
+`destroyContextVideoRenderer()` destroys the `m_videoOutput`, but it will
+be recreated by `createVideoLayer()`.
+
+Manually tested.
+
+* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+(WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
+
 2021-09-20  Wenson Hsieh  
 
 Refactor some code that controls Live Text selection behavior


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (282773 => 282774)

--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-09-20 20:18:36 UTC (rev 282773)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2021-09-20 20:37:57 UTC (rev 282774)
@@ -136,6 +136,7 @@
 break;
 
 case MediaRenderingToLayer:
+destroyContextVideoRenderer();
 createVideoLayer();
 break;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282175] trunk/Source/WebKit

2021-09-08 Thread peng . liu6
Title: [282175] trunk/Source/WebKit








Revision 282175
Author peng.l...@apple.com
Date 2021-09-08 15:03:32 -0700 (Wed, 08 Sep 2021)


Log Message
[macOS] -[WKFullScreenWindowController exitFullScreenImmediately] does not exit fullscreen immediately
https://bugs.webkit.org/show_bug.cgi?id=230024

Reviewed by Jer Noble.

A WebContent process may ask the `WKFullScreenWindowController` in
the UI process to exit fullscreen immediately without walking through
the normal exit fullscreen sequence, and the WebContent process won't
expect any IPC message related to fullscreen to come back from the
UI process. If the UI process sends an IPC message to the WebContent
process and expects the response from the WebContent process (e.g., in
`WebPageProxy::forceRepaint()`), the UI process will be stuck.

That will happen when a tab navigates to the previous page while a video
element in the current page is playing in fullscreen. The reason is that
`-[WKFullScreenWindowController exitFullScreen]` is called before
`-[WKFullScreenWindowController exitFullScreenImmediately]`.
`-[WKFullScreenWindowController exitFullScreen]` changes `_fullScreenState`
to `WaitingToExitFullScreen`, so `-[WKFullScreenWindowController exitFullScreenImmediately]`
will return early. This patch fixes this issue by changing the early return condition.

In addition, `-[WKFullScreenWindowController exitFullScreenImmediately]`
does not really exit fullscreen immediately. Instead, it calls
`-[WKFullScreenWindowController finishedExitFullScreenAnimation:]`,
which always calls `WebPageProxy::forceRepaint()` and expects a response
from the WebContet process. This patch fixes this issue as well.

Tested manually.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController exitFullScreenImmediately]):
Update the early return condition to make sure the UI process will proceed
to exit fullscreen unless the current state is `NotInFullScreen`.
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
The `completed` parameter was not used. This patch renames it to `immediately` to
indicate whether `WKFullScreenWindowController` wants to exit fullscreen immediately.
(-[WKFullScreenWindowController close]):
Clean up this function after revising `-[WKFullScreenWindowController exitFullScreenImmediately]`.
(-[WKFullScreenWindowController windowDidFailToExitFullScreen:]):
Update the argument according to the change of `-[WKFullScreenWindowController finishedExitFullScreenAnimation:]`.
(-[WKFullScreenWindowController windowDidExitFullScreen:]): Ditto.

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (282174 => 282175)

--- trunk/Source/WebKit/ChangeLog	2021-09-08 21:56:20 UTC (rev 282174)
+++ trunk/Source/WebKit/ChangeLog	2021-09-08 22:03:32 UTC (rev 282175)
@@ -1,3 +1,48 @@
+2021-09-08  Peng Liu  
+
+[macOS] -[WKFullScreenWindowController exitFullScreenImmediately] does not exit fullscreen immediately
+https://bugs.webkit.org/show_bug.cgi?id=230024
+
+Reviewed by Jer Noble.
+
+A WebContent process may ask the `WKFullScreenWindowController` in
+the UI process to exit fullscreen immediately without walking through
+the normal exit fullscreen sequence, and the WebContent process won't
+expect any IPC message related to fullscreen to come back from the
+UI process. If the UI process sends an IPC message to the WebContent
+process and expects the response from the WebContent process (e.g., in
+`WebPageProxy::forceRepaint()`), the UI process will be stuck.
+
+That will happen when a tab navigates to the previous page while a video
+element in the current page is playing in fullscreen. The reason is that
+`-[WKFullScreenWindowController exitFullScreen]` is called before
+`-[WKFullScreenWindowController exitFullScreenImmediately]`.
+`-[WKFullScreenWindowController exitFullScreen]` changes `_fullScreenState`
+to `WaitingToExitFullScreen`, so `-[WKFullScreenWindowController exitFullScreenImmediately]`
+will return early. This patch fixes this issue by changing the early return condition.
+
+In addition, `-[WKFullScreenWindowController exitFullScreenImmediately]`
+does not really exit fullscreen immediately. Instead, it calls
+`-[WKFullScreenWindowController finishedExitFullScreenAnimation:]`,
+which always calls `WebPageProxy::forceRepaint()` and expects a response
+from the WebContet process. This patch fixes this issue as well.
+
+Tested manually.
+
+* UIProcess/mac/WKFullScreenWindowController.mm:
+(-[WKFullScreenWindowController exitFullScreenImmediately]):
+Update the early return condition to make sure the UI process will proceed
+

[webkit-changes] [282046] trunk/Source/WebCore

2021-09-04 Thread peng . liu6
Title: [282046] trunk/Source/WebCore








Revision 282046
Author peng.l...@apple.com
Date 2021-09-04 09:55:13 -0700 (Sat, 04 Sep 2021)


Log Message
[iOS] Play/pause button's icon does not update when pausing in full screen
https://bugs.webkit.org/show_bug.cgi?id=229904

Reviewed by Eric Carlson.

AVKit expects KVO notification of `rate` to update the play/pause icon.
However, with the changes in r280840, `-[WebAVPlayerController setRate]`
will be called by AVKit only. When a user taps the play/pause button,
`-[WebAVPlayerController setRate:fromJavaScript:]` will be called, which
does not generate the KVO notification.

This patch fixes the issue by manually generate the KVO notification.

To be safe, this patch manually generates the KVO notification for
property `defaultPlaybackRate` as well.

Tested manually.

* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]):
(-[WebAVPlayerController setRate:fromJavaScript:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (282045 => 282046)

--- trunk/Source/WebCore/ChangeLog	2021-09-04 13:20:39 UTC (rev 282045)
+++ trunk/Source/WebCore/ChangeLog	2021-09-04 16:55:13 UTC (rev 282046)
@@ -1,3 +1,27 @@
+2021-09-04  Peng Liu  
+
+[iOS] Play/pause button's icon does not update when pausing in full screen
+https://bugs.webkit.org/show_bug.cgi?id=229904
+
+Reviewed by Eric Carlson.
+
+AVKit expects KVO notification of `rate` to update the play/pause icon.
+However, with the changes in r280840, `-[WebAVPlayerController setRate]`
+will be called by AVKit only. When a user taps the play/pause button,
+`-[WebAVPlayerController setRate:fromJavaScript:]` will be called, which
+does not generate the KVO notification.
+
+This patch fixes the issue by manually generate the KVO notification.
+
+To be safe, this patch manually generates the KVO notification for
+property `defaultPlaybackRate` as well.
+
+Tested manually.
+
+* platform/ios/WebAVPlayerController.mm:
+(-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]):
+(-[WebAVPlayerController setRate:fromJavaScript:]):
+
 2021-09-04  Antti Koivisto  
 
 REGRESSION(r275515): pointer-events:none may get stuck in LFC runs


Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (282045 => 282046)

--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2021-09-04 13:20:39 UTC (rev 282045)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2021-09-04 16:55:13 UTC (rev 282046)
@@ -173,7 +173,9 @@
 if (defaultPlaybackRate == _defaultPlaybackRate)
 return;
 
+[self willChangeValueForKey:@"defaultPlaybackRate"];
 _defaultPlaybackRate = defaultPlaybackRate;
+[self didChangeValueForKey:@"defaultPlaybackRate"];
 
 if (!fromJavaScript && self.delegate && self.delegate->defaultPlaybackRate() != _defaultPlaybackRate)
 self.delegate->setDefaultPlaybackRate(_defaultPlaybackRate);
@@ -197,7 +199,9 @@
 if (rate == _rate)
 return;
 
+[self willChangeValueForKey:@"rate"];
 _rate = rate;
+[self didChangeValueForKey:@"rate"];
 
 // AVKit doesn't have a separate variable for "paused", instead representing it by a `rate` of
 // `0`. Unfortunately, `HTMLMediaElement::play` doesn't call `HTMLMediaElement::setPlaybackRate`






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [281996] trunk/Source/WebCore

2021-09-03 Thread peng . liu6
Title: [281996] trunk/Source/WebCore








Revision 281996
Author peng.l...@apple.com
Date 2021-09-03 09:02:40 -0700 (Fri, 03 Sep 2021)


Log Message
[iOS] Media playback continues after backgrounding Safari
https://bugs.webkit.org/show_bug.cgi?id=229827

Reviewed by Eric Carlson.

In r277766, we make a video element ignore the background playback restriction
(`HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()` returns true)
if the video element can *potentially* enter picture-in-picture automatically
(either the video element is currently in the video fullscreen mode
or m_videoFullscreenStandby is true).

Unfortunately, this is not the correct fix if the OS has disabled the
"Start PiP Automatically" feature. The problem is that a video continues
playing after Safari is in the background.

Only when the video element is in the picture-in-picture mode, the video element
can ignore the background playback restriction.

The UI process will receive "didStartPictureInPicture" notification (if any)
and "applicationDidEnterBackground" notification in order. The UI process will
send IPC messages to the WebContent process regarding the notifications.

1) For the "didStartPictureInPicture" notification, the WebContent process will
modify the corresponding video element's presentation mode to picture-in-picture.
2) For the "applicationDidEnterBackground" notification, the WebContent process
will call `PlatformMediaSession::beginInterruption()` to suspend media playback
if needed.

It is guaranteed that 1) happens before 2). Therefore, when
`PlatformMediaSession::beginInterruption()` calls `HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()`,
if the video element enters picture-in-picture ("Start PiP Automatically" is enabled),
`m_videoFullscreenMode` must be `VideoFullscreenModePictureInPicture`.
Therefore, `HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()`
should return true when `m_videoFullscreenMode == VideoFullscreenModePictureInPicture`.

Tested manually.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (281995 => 281996)

--- trunk/Source/WebCore/ChangeLog	2021-09-03 15:26:51 UTC (rev 281995)
+++ trunk/Source/WebCore/ChangeLog	2021-09-03 16:02:40 UTC (rev 281996)
@@ -1,3 +1,45 @@
+2021-09-03  Peng Liu  
+
+[iOS] Media playback continues after backgrounding Safari
+https://bugs.webkit.org/show_bug.cgi?id=229827
+
+Reviewed by Eric Carlson.
+
+In r277766, we make a video element ignore the background playback restriction
+(`HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()` returns true)
+if the video element can *potentially* enter picture-in-picture automatically
+(either the video element is currently in the video fullscreen mode
+or m_videoFullscreenStandby is true).
+
+Unfortunately, this is not the correct fix if the OS has disabled the
+"Start PiP Automatically" feature. The problem is that a video continues
+playing after Safari is in the background.
+
+Only when the video element is in the picture-in-picture mode, the video element
+can ignore the background playback restriction.
+
+The UI process will receive "didStartPictureInPicture" notification (if any)
+and "applicationDidEnterBackground" notification in order. The UI process will
+send IPC messages to the WebContent process regarding the notifications.
+
+1) For the "didStartPictureInPicture" notification, the WebContent process will
+modify the corresponding video element's presentation mode to picture-in-picture.
+2) For the "applicationDidEnterBackground" notification, the WebContent process
+will call `PlatformMediaSession::beginInterruption()` to suspend media playback
+if needed.
+
+It is guaranteed that 1) happens before 2). Therefore, when
+`PlatformMediaSession::beginInterruption()` calls `HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()`,
+if the video element enters picture-in-picture ("Start PiP Automatically" is enabled),
+`m_videoFullscreenMode` must be `VideoFullscreenModePictureInPicture`.
+Therefore, `HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()`
+should return true when `m_videoFullscreenMode == VideoFullscreenModePictureInPicture`.
+
+Tested manually.
+
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
+
 2021-08-18  Sergio Villar Senin  
 
 [css-writing-modes] Fix absolutely positioning with orthogonal writing modes


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (281995 => 281996)

--- 

[webkit-changes] [281557] trunk

2021-08-25 Thread peng . liu6
Title: [281557] trunk








Revision 281557
Author peng.l...@apple.com
Date 2021-08-25 09:41:19 -0700 (Wed, 25 Aug 2021)


Log Message
[Monterey] LayoutTest media/element-containing-pip-video-going-into-fullscreen.html is flaky timeout/crash
https://bugs.webkit.org/show_bug.cgi?id=229453


Reviewed by Eric Carlson.

Source/WebCore:

No new tests. Fix a flaky test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
We need to initialize `m_changingVideoFullscreenMode` to false in the constructor.
Otherwise, it might be initialized to true and ignore requests to change video
presentation mode.

Source/WebKit:

* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
When the mock video presentation mode is enabled, the UI process still needs to
notify the Web process that the mode change has been done.

* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::didCleanupFullscreen):
Return immediately if the element is not in fullscreen to avoid
an assertion later in `enterVideoFullscreenForVideoElement()`.

LayoutTests:

* media/element-containing-pip-video-going-into-fullscreen.html:
Enable the mock video presentation mode for testing.
* platform/mac-wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/element-containing-pip-video-going-into-fullscreen.html
trunk/LayoutTests/platform/mac-wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm




Diff

Modified: trunk/LayoutTests/ChangeLog (281556 => 281557)

--- trunk/LayoutTests/ChangeLog	2021-08-25 16:38:23 UTC (rev 281556)
+++ trunk/LayoutTests/ChangeLog	2021-08-25 16:41:19 UTC (rev 281557)
@@ -1,3 +1,15 @@
+2021-08-25  Peng Liu  
+
+[Monterey] LayoutTest media/element-containing-pip-video-going-into-fullscreen.html is flaky timeout/crash
+https://bugs.webkit.org/show_bug.cgi?id=229453
+
+
+Reviewed by Eric Carlson.
+
+* media/element-containing-pip-video-going-into-fullscreen.html:
+Enable the mock video presentation mode for testing.
+* platform/mac-wk2/TestExpectations:
+
 2021-08-25  Tyler Wilcock  
 
 AX: Return radiobuttons part of ad-hoc radiogroups from AX search queries


Modified: trunk/LayoutTests/media/element-containing-pip-video-going-into-fullscreen.html (281556 => 281557)

--- trunk/LayoutTests/media/element-containing-pip-video-going-into-fullscreen.html	2021-08-25 16:38:23 UTC (rev 281556)
+++ trunk/LayoutTests/media/element-containing-pip-video-going-into-fullscreen.html	2021-08-25 16:41:19 UTC (rev 281557)
@@ -1,3 +1,4 @@
+
 
 
 Test element containing pip video going into fullscreen should exit pip
@@ -4,8 +5,10 @@
 

[webkit-changes] [281461] trunk/Tools

2021-08-23 Thread peng . liu6
Title: [281461] trunk/Tools








Revision 281461
Author peng.l...@apple.com
Date 2021-08-23 12:04:25 -0700 (Mon, 23 Aug 2021)


Log Message
Add a new option '--show-window' to run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=229253

Reviewed by Simon Fraser.

Add the new option so that we can let WKTR show a window with webview.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/driver.py:
(Driver.cmd_line):
* WebKitTestRunner/Options.cpp:
(WTR::handleOptionShowWindow):
(WTR::OptionsHandler::OptionsHandler):
(WTR::handleOptionShowWebView): Deleted.
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):
(WTR::TestOptions::keyTypeMapping):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::shouldShowWindow const):
(WTR::TestOptions::shouldShowWebView const): Deleted.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::finishCreatingPlatformWebView):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::setWindowFrame):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
trunk/Tools/Scripts/webkitpy/port/driver.py
trunk/Tools/WebKitTestRunner/Options.cpp
trunk/Tools/WebKitTestRunner/TestOptions.cpp
trunk/Tools/WebKitTestRunner/TestOptions.h
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp




Diff

Modified: trunk/Tools/ChangeLog (281460 => 281461)

--- trunk/Tools/ChangeLog	2021-08-23 18:59:07 UTC (rev 281460)
+++ trunk/Tools/ChangeLog	2021-08-23 19:04:25 UTC (rev 281461)
@@ -1,3 +1,33 @@
+2021-08-23  Peng Liu  
+
+Add a new option '--show-window' to run-webkit-tests
+https://bugs.webkit.org/show_bug.cgi?id=229253
+
+Reviewed by Simon Fraser.
+
+Add the new option so that we can let WKTR show a window with webview.
+
+* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+(parse_args):
+* Scripts/webkitpy/port/driver.py:
+(Driver.cmd_line):
+* WebKitTestRunner/Options.cpp:
+(WTR::handleOptionShowWindow):
+(WTR::OptionsHandler::OptionsHandler):
+(WTR::handleOptionShowWebView): Deleted.
+* WebKitTestRunner/TestOptions.cpp:
+(WTR::TestOptions::defaults):
+(WTR::TestOptions::keyTypeMapping):
+* WebKitTestRunner/TestOptions.h:
+(WTR::TestOptions::shouldShowWindow const):
+(WTR::TestOptions::shouldShowWebView const): Deleted.
+* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+(WTR::TestController::finishCreatingPlatformWebView):
+* WebKitTestRunner/mac/PlatformWebViewMac.mm:
+(WTR::PlatformWebView::PlatformWebView):
+* WebKitTestRunner/win/PlatformWebViewWin.cpp:
+(WTR::PlatformWebView::setWindowFrame):
+
 2021-08-23  Jonathan Bedard  
 
 [Cygwin] Support Python 3 in run-webkit-tests


Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (281460 => 281461)

--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2021-08-23 18:59:07 UTC (rev 281460)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2021-08-23 19:04:25 UTC (rev 281461)
@@ -343,6 +343,7 @@
 optparse.make_option(
 "--prefer-integrated-gpu", action="" default=False,
 help=("Prefer using the lower-power integrated GPU on a dual-GPU system. Note that other running applications and the tests themselves can override this request.")),
+optparse.make_option('--show-window', action="" default=False, help="Make the test runner window visible during testing."),
 ]))
 
 option_group_definitions.append(("Web Platform Test Server Options", [


Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (281460 => 281461)

--- trunk/Tools/Scripts/webkitpy/port/driver.py	2021-08-23 18:59:07 UTC (rev 281460)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py	2021-08-23 19:04:25 UTC (rev 281461)
@@ -537,6 +537,8 @@
 cmd.append('--no-timeout')
 if self._port.get_option('show_touches'):
 cmd.append('--show-touches')
+if self._port.get_option('show_window'):
+cmd.append('--show-window')
 if self._port.get_option('accessibility_isolated_tree'):
 cmd.append('--accessibility-isolated-tree')
 


Modified: trunk/Tools/WebKitTestRunner/Options.cpp (281460 => 281461)

--- trunk/Tools/WebKitTestRunner/Options.cpp	2021-08-23 18:59:07 UTC (rev 281460)
+++ trunk/Tools/WebKitTestRunner/Options.cpp	2021-08-23 19:04:25 UTC (rev 281461)
@@ -76,9 +76,9 @@
 return true;
 }
 
-static bool handleOptionShowWebView(Options& options, const char*, const char*)
+static bool handleOptionShowWindow(Options& options, const char*, const char*)
 {
-

[webkit-changes] [281007] trunk/Source/WebKit

2021-08-12 Thread peng . liu6
Title: [281007] trunk/Source/WebKit








Revision 281007
Author peng.l...@apple.com
Date 2021-08-12 20:58:52 -0700 (Thu, 12 Aug 2021)


Log Message
REGRESSION (r280951): [ Big Sur ] TestWebKitAPI.AudioRoutingArbitration.Close is failing
https://bugs.webkit.org/show_bug.cgi?id=229040

Reviewed by Eric Carlson.

Function `AudioSessionRoutingArbitratorProxy::processDidTerminate()` should
be called only in the case that the corresponding WebContent process exits,
whereas `GPUProcessConnection::didClose()` (in WebContent process) deals with
the case that the GPU process crashes.

No new tests. Fix an API test failure.

* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::gpuProcessExited):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (281006 => 281007)

--- trunk/Source/WebKit/ChangeLog	2021-08-13 03:34:00 UTC (rev 281006)
+++ trunk/Source/WebKit/ChangeLog	2021-08-13 03:58:52 UTC (rev 281007)
@@ -1,3 +1,22 @@
+2021-08-12  Peng Liu  
+
+REGRESSION (r280951): [ Big Sur ] TestWebKitAPI.AudioRoutingArbitration.Close is failing
+https://bugs.webkit.org/show_bug.cgi?id=229040
+
+Reviewed by Eric Carlson.
+
+Function `AudioSessionRoutingArbitratorProxy::processDidTerminate()` should
+be called only in the case that the corresponding WebContent process exits,
+whereas `GPUProcessConnection::didClose()` (in WebContent process) deals with
+the case that the GPU process crashes.
+
+No new tests. Fix an API test failure.
+
+* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
+(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
+* UIProcess/WebProcessProxy.cpp:
+(WebKit::WebProcessProxy::gpuProcessExited):
+
 2021-08-12  Wenson Hsieh  
 
 [ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing


Modified: trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm (281006 => 281007)

--- trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-13 03:34:00 UTC (rev 281006)
+++ trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-13 03:58:52 UTC (rev 281007)
@@ -52,6 +52,8 @@
 
 void AudioSessionRoutingArbitratorProxy::processDidTerminate()
 {
+if (SharedRoutingArbitrator::sharedInstance().isInRoutingArbitrationForToken(m_token))
+endRoutingArbitration();
 }
 
 void AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory(WebCore::AudioSession::CategoryType category, ArbitrationCallback&& callback)


Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (281006 => 281007)

--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-08-13 03:34:00 UTC (rev 281006)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-08-13 03:58:52 UTC (rev 281007)
@@ -820,10 +820,6 @@
 
 for (auto& page : copyToVectorOf>(m_pageMap.values()))
 page->gpuProcessExited(reason);
-
-#if ENABLE(ROUTING_ARBITRATION)
-m_routingArbitrator->processDidTerminate();
-#endif
 }
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280957] trunk/Source

2021-08-11 Thread peng . liu6
Title: [280957] trunk/Source








Revision 280957
Author peng.l...@apple.com
Date 2021-08-11 21:35:22 -0700 (Wed, 11 Aug 2021)


Log Message
Function _os_feature_enabled_impl() expects compile-time static strings as arguments
https://bugs.webkit.org/show_bug.cgi?id=229017


Reviewed by Tim Horton.

There are multiple issues in the current implementation of `isFeatureFlagEnabled()`.
1. `_os_feature_enabled_impl()` expects compile-time static strings as arguments.
So we should not use `String` here.
2. As Simon Fraser pointed out, `String::characters8()` is not null terminated.

Source/WebKit:

* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::isFeatureFlagEnabled):
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::isFeatureFlagEnabled):
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferencesDefaultValues.h:
* WebView/WebPreferencesDefaultValues.mm:
(WebKit::isFeatureFlagEnabled):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280956 => 280957)

--- trunk/Source/WebKit/ChangeLog	2021-08-12 04:29:25 UTC (rev 280956)
+++ trunk/Source/WebKit/ChangeLog	2021-08-12 04:35:22 UTC (rev 280957)
@@ -1,3 +1,22 @@
+2021-08-11  Peng Liu  
+
+Function _os_feature_enabled_impl() expects compile-time static strings as arguments
+https://bugs.webkit.org/show_bug.cgi?id=229017
+
+
+Reviewed by Tim Horton.
+
+There are multiple issues in the current implementation of `isFeatureFlagEnabled()`.
+1. `_os_feature_enabled_impl()` expects compile-time static strings as arguments.
+So we should not use `String` here.
+2. As Simon Fraser pointed out, `String::characters8()` is not null terminated.
+
+* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
+(WebKit::isFeatureFlagEnabled):
+* Shared/WebPreferencesDefaultValues.cpp:
+(WebKit::isFeatureFlagEnabled):
+* Shared/WebPreferencesDefaultValues.h:
+
 2021-08-11  Jean-Yves Avenard  
 
 [Monterey] WebContent process immediately crash when GPU Process is disabled


Modified: trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (280956 => 280957)

--- trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-08-12 04:29:25 UTC (rev 280956)
+++ trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-08-12 04:35:22 UTC (rev 280957)
@@ -38,7 +38,7 @@
 namespace WebKit {
 
 // Because of , WebKit has to parse the feature flags plist file
-bool isFeatureFlagEnabled(const String& featureName, bool defaultValue)
+bool isFeatureFlagEnabled(const char* featureName, bool defaultValue)
 {
 #if HAVE(SYSTEM_FEATURE_FLAGS)
 
@@ -49,12 +49,12 @@
 }();
 
 if (isSystemWebKit)
-return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());
+return _os_feature_enabled_impl("WebKit", featureName);
 
 return defaultValue;
 #else
 UNUSED_PARAM(defaultValue);
-return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());
+return _os_feature_enabled_impl("WebKit", featureName);
 #endif // PLATFORM(MAC)
 
 #else


Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (280956 => 280957)

--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-08-12 04:29:25 UTC (rev 280956)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-08-12 04:35:22 UTC (rev 280957)
@@ -42,7 +42,7 @@
 namespace WebKit {
 
 #if !PLATFORM(COCOA)
-bool isFeatureFlagEnabled(const String&, bool defaultValue)
+bool isFeatureFlagEnabled(const char*, bool defaultValue)
 {
 return defaultValue;
 }


Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (280956 => 280957)

--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2021-08-12 04:29:25 UTC (rev 280956)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2021-08-12 04:35:22 UTC (rev 280957)
@@ -35,7 +35,7 @@
 
 namespace WebKit {
 
-bool isFeatureFlagEnabled(const String&, bool defaultValue = false);
+bool isFeatureFlagEnabled(const char*, bool defaultValue = false);
 
 #if PLATFORM(IOS_FAMILY)
 bool defaultPassiveTouchListenersAsDefaultOnDocument();


Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (280956 => 280957)

--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-08-12 04:29:25 UTC (rev 280956)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-08-12 04:35:22 UTC (rev 280957)
@@ -1,3 +1,20 @@
+2021-08-11  Peng Liu  
+
+Function _os_feature_enabled_impl() expects compile-time static strings as arguments
+

[webkit-changes] [280951] trunk

2021-08-11 Thread peng . liu6
Title: [280951] trunk








Revision 280951
Author peng.l...@apple.com
Date 2021-08-11 18:11:15 -0700 (Wed, 11 Aug 2021)


Log Message
[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
https://bugs.webkit.org/show_bug.cgi?id=227728


Reviewed by Jer Noble.

Source/WebKit:

After the GPU process crashes, the UI process will clean up the
`SharedRoutingArbitrator`, while a WebContent process might be resuming
the media playback and setup `AudioSessionRoutingArbitrator`.
There is a race condition here. If the WebContent process runs faster,
`SharedRoutingArbitrator` in the UI process will try to begin a duplicated
routing arbitration and lead to an assertion failure.

No new tests. Fixed following two API test failures:
- TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
- TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource

* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
* WebProcess/GPU/GPUProcessConnection.cpp:
(WebKit::GPUProcessConnection::didClose):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
(TEST):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm
trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280950 => 280951)

--- trunk/Source/WebKit/ChangeLog	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/ChangeLog	2021-08-12 01:11:15 UTC (rev 280951)
@@ -1,5 +1,29 @@
 2021-08-11  Peng Liu  
 
+[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
+https://bugs.webkit.org/show_bug.cgi?id=227728
+
+
+Reviewed by Jer Noble.
+
+After the GPU process crashes, the UI process will clean up the
+`SharedRoutingArbitrator`, while a WebContent process might be resuming
+the media playback and setup `AudioSessionRoutingArbitrator`.
+There is a race condition here. If the WebContent process runs faster,
+`SharedRoutingArbitrator` in the UI process will try to begin a duplicated
+routing arbitration and lead to an assertion failure.
+
+No new tests. Fixed following two API test failures:
+- TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
+- TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource
+
+* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
+(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
+* WebProcess/GPU/GPUProcessConnection.cpp:
+(WebKit::GPUProcessConnection::didClose):
+
+2021-08-11  Peng Liu  
+
 [BigSur] TestWebKitAPI.AudioRoutingArbitration.Updating fails after r280726
 https://bugs.webkit.org/show_bug.cgi?id=228966
 


Modified: trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm (280950 => 280951)

--- trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-12 01:11:15 UTC (rev 280951)
@@ -52,8 +52,6 @@
 
 void AudioSessionRoutingArbitratorProxy::processDidTerminate()
 {
-if (SharedRoutingArbitrator::sharedInstance().isInRoutingArbitrationForToken(m_token))
-endRoutingArbitration();
 }
 
 void AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory(WebCore::AudioSession::CategoryType category, ArbitrationCallback&& callback)


Modified: trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp (280950 => 280951)

--- trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2021-08-12 01:11:15 UTC (rev 280951)
@@ -127,6 +127,11 @@
 auto protector = makeRef(*this);
 WebProcess::singleton().gpuProcessConnectionClosed(*this);
 
+#if ENABLE(ROUTING_ARBITRATION)
+if (auto* arbitrator = WebProcess::singleton().supplement())
+arbitrator->leaveRoutingAbritration();
+#endif
+
 auto clients = m_clients;
 for (auto& client : clients)
 client.gpuProcessConnectionDidClose(*this);


Modified: trunk/Tools/ChangeLog (280950 => 280951)

--- trunk/Tools/ChangeLog	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Tools/ChangeLog	2021-08-12 01:11:15 UTC (rev 280951)
@@ -1,3 +1,14 @@
+2021-08-11  Peng Liu  
+
+[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)

[webkit-changes] [280936] trunk/Source/WebKit

2021-08-11 Thread peng . liu6
Title: [280936] trunk/Source/WebKit








Revision 280936
Author peng.l...@apple.com
Date 2021-08-11 15:54:12 -0700 (Wed, 11 Aug 2021)


Log Message
[BigSur] TestWebKitAPI.AudioRoutingArbitration.Updating fails after r280726
https://bugs.webkit.org/show_bug.cgi?id=228966

Reviewed by Eric Carlson.

Add an IPC message `RemoteAudioSessionProxy::SetIsPlayingToBluetoothOverride`
for testing purpose, so that the test `AudioRoutingArbitration.Updating` will
work as expected when "Media in GPU Process" is enabled.

No new tests. Fix an API test failure.

* GPUProcess/media/RemoteAudioSessionProxy.cpp:
(WebKit::RemoteAudioSessionProxy::setCategory):
(WebKit::RemoteAudioSessionProxy::setIsPlayingToBluetoothOverride):
* GPUProcess/media/RemoteAudioSessionProxy.h:
* GPUProcess/media/RemoteAudioSessionProxy.messages.in:
* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setCategory):
(WebKit::RemoteAudioSession::setIsPlayingToBluetoothOverride):
* WebProcess/GPU/media/RemoteAudioSession.h:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h




Diff

Modified: trunk/Source/WebKit/ChangeLog (280935 => 280936)

--- trunk/Source/WebKit/ChangeLog	2021-08-11 22:33:17 UTC (rev 280935)
+++ trunk/Source/WebKit/ChangeLog	2021-08-11 22:54:12 UTC (rev 280936)
@@ -1,3 +1,26 @@
+2021-08-11  Peng Liu  
+
+[BigSur] TestWebKitAPI.AudioRoutingArbitration.Updating fails after r280726
+https://bugs.webkit.org/show_bug.cgi?id=228966
+
+Reviewed by Eric Carlson.
+
+Add an IPC message `RemoteAudioSessionProxy::SetIsPlayingToBluetoothOverride`
+for testing purpose, so that the test `AudioRoutingArbitration.Updating` will
+work as expected when "Media in GPU Process" is enabled.
+
+No new tests. Fix an API test failure.
+
+* GPUProcess/media/RemoteAudioSessionProxy.cpp:
+(WebKit::RemoteAudioSessionProxy::setCategory):
+(WebKit::RemoteAudioSessionProxy::setIsPlayingToBluetoothOverride):
+* GPUProcess/media/RemoteAudioSessionProxy.h:
+* GPUProcess/media/RemoteAudioSessionProxy.messages.in:
+* WebProcess/GPU/media/RemoteAudioSession.cpp:
+(WebKit::RemoteAudioSession::setCategory):
+(WebKit::RemoteAudioSession::setIsPlayingToBluetoothOverride):
+* WebProcess/GPU/media/RemoteAudioSession.h:
+
 2021-08-11  David Kilzer  
 
 ThreadSanitizer: data race in WTF::StringImpl::deref() under WebKit::NetworkCache::IOChannel::~IOChannel()


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp (280935 => 280936)

--- trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp	2021-08-11 22:33:17 UTC (rev 280935)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp	2021-08-11 22:54:12 UTC (rev 280936)
@@ -73,11 +73,12 @@
 
 void RemoteAudioSessionProxy::setCategory(AudioSession::CategoryType category, RouteSharingPolicy policy)
 {
-if (m_category == category && m_routeSharingPolicy == policy)
+if (m_category == category && m_routeSharingPolicy == policy && !m_isPlayingToBluetoothOverrideChanged)
 return;
 
 m_category = category;
 m_routeSharingPolicy = policy;
+m_isPlayingToBluetoothOverrideChanged = false;
 audioSessionManager().updateCategory();
 }
 
@@ -93,6 +94,12 @@
 completion(m_active);
 }
 
+void RemoteAudioSessionProxy::setIsPlayingToBluetoothOverride(std::optional&& value)
+{
+m_isPlayingToBluetoothOverrideChanged = true;
+audioSessionManager().session().setIsPlayingToBluetoothOverride(WTFMove(value));
+}
+
 void RemoteAudioSessionProxy::configurationChanged()
 {
 connection().send(Messages::RemoteAudioSession::ConfigurationChanged(configuration()), { });


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h (280935 => 280936)

--- trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h	2021-08-11 22:33:17 UTC (rev 280935)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h	2021-08-11 22:54:12 UTC (rev 280936)
@@ -74,6 +74,7 @@
 void setPreferredBufferSize(uint64_t);
 using SetActiveCompletion = CompletionHandler;
 void tryToSetActive(bool, SetActiveCompletion&&);
+void setIsPlayingToBluetoothOverride(std::optional&& value);
 
 RemoteAudioSessionProxyManager& audioSessionManager();
 IPC::Connection& connection();
@@ -83,6 +84,7 @@
 WebCore::RouteSharingPolicy m_routeSharingPolicy { WebCore::RouteSharingPolicy::Default };
 size_t m_preferredBufferSize { 0 };
 bool m_active { false };
+bool m_isPlayingToBluetoothOverrideChanged { false };
 };
 
 }


Modified: 

[webkit-changes] [280885] trunk/Source/WTF

2021-08-11 Thread peng . liu6
Title: [280885] trunk/Source/WTF








Revision 280885
Author peng.l...@apple.com
Date 2021-08-10 23:57:42 -0700 (Tue, 10 Aug 2021)


Log Message
Disable SYSTEM_FEATURE_FLAGS on iOS 14
https://bugs.webkit.org/show_bug.cgi?id=228979


Reviewed by Tim Horton.

Stop using feature flags mechanism on iOS 14 to avoid some issues on iOS simulators.

* wtf/PlatformHave.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/PlatformHave.h




Diff

Modified: trunk/Source/WTF/ChangeLog (280884 => 280885)

--- trunk/Source/WTF/ChangeLog	2021-08-11 06:10:27 UTC (rev 280884)
+++ trunk/Source/WTF/ChangeLog	2021-08-11 06:57:42 UTC (rev 280885)
@@ -1,3 +1,15 @@
+2021-08-10  Peng Liu  
+
+Disable SYSTEM_FEATURE_FLAGS on iOS 14
+https://bugs.webkit.org/show_bug.cgi?id=228979
+
+
+Reviewed by Tim Horton.
+
+Stop using feature flags mechanism on iOS 14 to avoid some issues on iOS simulators.
+
+* wtf/PlatformHave.h:
+
 2021-08-10  Stephan Szabo  
 
 [WTF][PlayStation] REGRESSION(r280795) error: undefined symbol: WTF::logLevelString()


Modified: trunk/Source/WTF/wtf/PlatformHave.h (280884 => 280885)

--- trunk/Source/WTF/wtf/PlatformHave.h	2021-08-11 06:10:27 UTC (rev 280884)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-08-11 06:57:42 UTC (rev 280885)
@@ -671,7 +671,7 @@
 #endif
 
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 11) \
-|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 14) \
+|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 15) \
 || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 7) \
 || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 14) \
 || PLATFORM(WIN)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280884] trunk/Source/WebKitLegacy/mac

2021-08-11 Thread peng . liu6
Title: [280884] trunk/Source/WebKitLegacy/mac








Revision 280884
Author peng.l...@apple.com
Date 2021-08-10 23:10:27 -0700 (Tue, 10 Aug 2021)


Log Message
REGRESSION (r280726): [ Big Sur wk1 ] 25 imported/w3c/web-platform-tests/fetch/ failing
https://bugs.webkit.org/show_bug.cgi?id=228926

Reviewed by Jer Noble.

Revert a part of r280726 while investigating the test failures.

* WebView/WebPreferencesDefaultValues.mm:
(WebKit::isFeatureFlagEnabled):

Modified Paths

trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm




Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (280883 => 280884)

--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-08-11 05:28:15 UTC (rev 280883)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-08-11 06:10:27 UTC (rev 280884)
@@ -1,3 +1,15 @@
+2021-08-10  Peng Liu  
+
+REGRESSION (r280726): [ Big Sur wk1 ] 25 imported/w3c/web-platform-tests/fetch/ failing
+https://bugs.webkit.org/show_bug.cgi?id=228926
+
+Reviewed by Jer Noble.
+
+Revert a part of r280726 while investigating the test failures.
+
+* WebView/WebPreferencesDefaultValues.mm:
+(WebKit::isFeatureFlagEnabled):
+
 2021-08-10  Chris Dumez  
 
 Add Cross-Origin-Opener-Policy support for Blob URLs


Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm (280883 => 280884)

--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm	2021-08-11 05:28:15 UTC (rev 280883)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm	2021-08-11 06:10:27 UTC (rev 280884)
@@ -49,17 +49,9 @@
 {
 #if HAVE(SYSTEM_FEATURE_FLAGS)
 
-#if PLATFORM(MAC)
-static bool isSystemWebKit = [] {
-NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"WebView")];
-return [bundle.bundlePath hasPrefix:@"/System/"];
-}();
-
-if (isSystemWebKit)
-return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());
-
-return defaultValue;
-#else
+// FIXME: On MacOS, we need to deal with the cases when system feature flags are not available.
+// But we need to fix  first.
+#if PLATFORM(COCOA)
 UNUSED_PARAM(defaultValue);
 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());
 #endif // PLATFORM(MAC)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280852] trunk/Source/WebKit

2021-08-10 Thread peng . liu6
Title: [280852] trunk/Source/WebKit








Revision 280852
Author peng.l...@apple.com
Date 2021-08-10 10:33:08 -0700 (Tue, 10 Aug 2021)


Log Message
RemoteImageDecoderAVF::clearFrameBufferCache() uses a weak pointer without checking its validity
https://bugs.webkit.org/show_bug.cgi?id=228925

Reviewed by Eric Carlson.

Only use `m_gpuProcessConnection` when it is a valid pointer.

* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
(WebKit::RemoteImageDecoderAVF::clearFrameBufferCache):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (280851 => 280852)

--- trunk/Source/WebKit/ChangeLog	2021-08-10 17:30:03 UTC (rev 280851)
+++ trunk/Source/WebKit/ChangeLog	2021-08-10 17:33:08 UTC (rev 280852)
@@ -1,3 +1,15 @@
+2021-08-10  Peng Liu  
+
+RemoteImageDecoderAVF::clearFrameBufferCache() uses a weak pointer without checking its validity
+https://bugs.webkit.org/show_bug.cgi?id=228925
+
+Reviewed by Eric Carlson.
+
+Only use `m_gpuProcessConnection` when it is a valid pointer.
+
+* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
+(WebKit::RemoteImageDecoderAVF::clearFrameBufferCache):
+
 2021-08-10  Megan Gardner  
 
 Don't instantiate a SYNotesActivationObserver to just say that it's not active or visible. 


Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp (280851 => 280852)

--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp	2021-08-10 17:30:03 UTC (rev 280851)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp	2021-08-10 17:33:08 UTC (rev 280852)
@@ -229,7 +229,8 @@
 for (size_t i = 0; i < std::min(index + 1, m_frameCount); ++i)
 m_frameImages.remove(i);
 
-m_gpuProcessConnection->connection().send(Messages::RemoteImageDecoderAVFProxy::ClearFrameBufferCache(m_identifier, index), 0);
+if (m_gpuProcessConnection)
+m_gpuProcessConnection->connection().send(Messages::RemoteImageDecoderAVFProxy::ClearFrameBufferCache(m_identifier, index), 0);
 }
 
 void RemoteImageDecoderAVF::encodedDataStatusChanged(size_t frameCount, const WebCore::IntSize& size, bool hasTrack)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280726] trunk

2021-08-06 Thread peng . liu6
Title: [280726] trunk








Revision 280726
Author peng.l...@apple.com
Date 2021-08-06 09:38:28 -0700 (Fri, 06 Aug 2021)


Log Message
[macOS] Clean up Feature Flags related code
https://bugs.webkit.org/show_bug.cgi?id=228803


Reviewed by Tim Horton.

Source/WebKit:

On macOS, Safari Technology Preview or a local build WebKit/Safari will always
get the default preference values through the "Feature Flags" SPI. Unfortunately,
this approach won't work if the OS does not provide correct default preference values.

With this patch, we only get default preference values with the SPI for system
WebKit on macOS. For all other cases, we use hardcoded values. So that
WebKit will always get the correct default preference values.

This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder".

* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-macos.plist:
* FeatureFlags/WebKit-watchos.plist:

* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::isFeatureFlagEnabled):
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::isFeatureFlagEnabled):
(WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
(WebKit::defaultUseGPUProcessForCanvasRenderingEnabled):
(WebKit::defaultUseGPUProcessForDOMRenderingEnabled):
(WebKit::defaultUseGPUProcessForMediaEnabled):
(WebKit::defaultUseGPUProcessForWebGLEnabled):
(WebKit::defaultCaptureAudioInGPUProcessEnabled):
(WebKit::defaultCaptureVideoInGPUProcessEnabled):
(WebKit::defaultWebRTCCodecsInGPUProcess):
(WebKit::defaultIncrementalPDFEnabled):
(WebKit::defaultWebMFormatReaderEnabled):
(WebKit::defaultVP8DecoderEnabled):
(WebKit::defaultVP9DecoderEnabled):
(WebKit::defaultVP9SWDecoderEnabledOnBattery):
(WebKit::defaultWebMParserEnabled):
(WebKit::defaultWebMWebAudioEnabled):
(WebKit::defaultInAppBrowserPrivacy): Deleted.
* Shared/WebPreferencesDefaultValues.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Fix a typo.

Source/WebKitLegacy/mac:

On macOS, Safari Technology Preview or a local build WebKit/Safari will always
get the default preference values through the "Feature Flags" SPI. Unfortunately,
this approach won't work if the OS does not provide correct default preference values.

With this patch, we only get default preference values with the SPI for system
WebKit on macOS. For all other cases, we use hardcoded values. So that
WebKit will always get the correct default preference values.

This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder".

* WebView/WebPreferencesDefaultValues.h:
* WebView/WebPreferencesDefaultValues.mm:
(WebKit::isFeatureFlagEnabled):
(WebKit::defaultIncrementalPDFEnabled):
(WebKit::defaultWebXREnabled):
(WebKit::defaultWebMParserEnabled):
(WebKit::defaultWebMWebAudioEnabled):
(WebKit::defaultVP8DecoderEnabled):
(WebKit::defaultVP9DecoderEnabled):

LayoutTests:

Update a mac-bigsur specific test expectation file because the test is passing now.

* platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: Removed.
* platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist
trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist
trunk/Source/WebKit/FeatureFlags/WebKit-macos.plist
trunk/Source/WebKit/FeatureFlags/WebKit-watchos.plist
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm


Removed Paths

trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (280725 => 280726)

--- trunk/LayoutTests/ChangeLog	2021-08-06 16:25:55 UTC (rev 280725)
+++ trunk/LayoutTests/ChangeLog	2021-08-06 16:38:28 UTC (rev 280726)
@@ -1,3 +1,16 @@
+2021-08-06  Peng Liu  
+
+[macOS] Clean up Feature Flags related code
+https://bugs.webkit.org/show_bug.cgi?id=228803
+
+
+Reviewed by Tim Horton.
+
+Update a mac-bigsur specific test expectation file because the test is passing now.
+
+* platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: Removed.
+* platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt:
+
 2021-08-06  Antti Koivisto  
 
 REGRESSION (r274038): Keyframe animation with 

[webkit-changes] [280664] trunk

2021-08-04 Thread peng . liu6
Title: [280664] trunk








Revision 280664
Author peng.l...@apple.com
Date 2021-08-04 14:36:38 -0700 (Wed, 04 Aug 2021)


Log Message
[Catalina][GPUP] Some API tests fail after GPU Process features are enabled
https://bugs.webkit.org/show_bug.cgi?id=228589

Reviewed by Jer Noble.

Source/WebCore:

When "Media in GPU Process" is enabled, `AudioSession[IOS|Mac]` runs in
the GPU process. `HTMLMediaElement`, which is an observer of audio session,
runs in a WebContent process. It cannot get its AudioSession's configuration
directly. We need a mechanism to "push" the latest audio session configuration
from the GPU process to the WebContent process.

This patch replaces the `MutedStateObserver` with an audio session configuration
change observer interface, so that an audio session will notify its observers
after changing its configurations, including buffer size, muted state, sample rate.
Currently, this observer interface is used on macOS only.

No new tests. Fix an API test failure.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::initializeMediaSession):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
* html/HTMLMediaElement.h:

* platform/audio/AudioSession.cpp:
(WebCore::AudioSession::addConfigurationChangeObserver):
(WebCore::AudioSession::removeConfigurationChangeObserver):
* platform/audio/AudioSession.h:
* platform/audio/ios/AudioSessionIOS.h:
Move `m_interruptionObservers` to this class because only `AudioSessionIOS`
supports interruption observers.
* platform/audio/mac/AudioSessionMac.h:
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSessionMac::handleSampleRateChange):
(WebCore::AudioSessionMac::handleSampleRateChange const):
(WebCore::AudioSessionMac::handleBufferSizeChange):
(WebCore::AudioSessionMac::handleBufferSizeChange const):
(WebCore::AudioSessionMac::sampleRate const):
(WebCore::AudioSessionMac::setPreferredBufferSize):
(WebCore::AudioSessionMac::handleMutedStateChange):
(WebCore::AudioSessionMac::addConfigurationChangeObserver):
(WebCore::AudioSessionMac::removeConfigurationChangeObserver):
(WebCore::AudioSessionMac::addMutedStateObserver): Deleted.
(WebCore::AudioSessionMac::removeMutedStateObserver): Deleted.

Source/WebKit:

When an audio session's configuration changes, let `RemoteAudioSessionProxy`
in the GPU process send the latest audio session configuration to `RemoteAudioSession`
in the WebContent process through an IPC message (`RemoteAudioSession::ConfigurationChanged`).

* GPUProcess/media/RemoteAudioSessionProxy.cpp:
(WebKit::RemoteAudioSessionProxy::configurationChanged):
* GPUProcess/media/RemoteAudioSessionProxy.h:

* GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
(WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager):
(WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
(WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
(WebKit::RemoteAudioSessionProxyManager::hardwareMutedStateDidChange):
(WebKit::RemoteAudioSessionProxyManager::bufferSizeDidChange):
(WebKit::RemoteAudioSessionProxyManager::sampleRateDidChange):
(WebKit::RemoteAudioSessionProxyManager::configurationDidChange):

* GPUProcess/media/RemoteAudioSessionProxyManager.h:
* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::addConfigurationChangeObserver):
(WebKit::RemoteAudioSession::removeConfigurationChangeObserver):
(WebKit::RemoteAudioSession::configurationChanged):
* WebProcess/GPU/media/RemoteAudioSession.h:
* WebProcess/GPU/media/RemoteAudioSession.messages.in:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/html/HTMLMediaElement.h
trunk/Source/WebCore/platform/audio/AudioSession.cpp
trunk/Source/WebCore/platform/audio/AudioSession.h
trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.h
trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.h
trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.h
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.messages.in
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (280663 => 280664)

--- trunk/Source/WebCore/ChangeLog	2021-08-04 21:29:09 UTC (rev 280663)
+++ trunk/Source/WebCore/ChangeLog	2021-08-04 21:36:38 UTC (rev 280664)
@@ -1,3 +1,50 @@
+2021-08-04  

[webkit-changes] [280576] trunk

2021-08-02 Thread peng . liu6
Title: [280576] trunk








Revision 280576
Author peng.l...@apple.com
Date 2021-08-02 18:05:39 -0700 (Mon, 02 Aug 2021)


Log Message
[GPUP] RemoteAudioSession::setPreferredBufferSize() does not change its preferredBufferSize
https://bugs.webkit.org/show_bug.cgi?id=228720

Reviewed by Jer Noble.

Source/WebKit:

`RemoteAudioSession` should update its `preferredBufferSize` in
`setPreferredBufferSize()`. Otherwise, the `preferredBufferSize`
will become inconsistent with the value in the GPU process.

No new tests. Fix API test failures.

* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setPreferredBufferSize):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
(TEST_F):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280575 => 280576)

--- trunk/Source/WebKit/ChangeLog	2021-08-03 00:55:12 UTC (rev 280575)
+++ trunk/Source/WebKit/ChangeLog	2021-08-03 01:05:39 UTC (rev 280576)
@@ -1,3 +1,19 @@
+2021-08-02  Peng Liu  
+
+[GPUP] RemoteAudioSession::setPreferredBufferSize() does not change its preferredBufferSize
+https://bugs.webkit.org/show_bug.cgi?id=228720
+
+Reviewed by Jer Noble.
+
+`RemoteAudioSession` should update its `preferredBufferSize` in
+`setPreferredBufferSize()`. Otherwise, the `preferredBufferSize`
+will become inconsistent with the value in the GPU process.
+
+No new tests. Fix API test failures.
+
+* WebProcess/GPU/media/RemoteAudioSession.cpp:
+(WebKit::RemoteAudioSession::setPreferredBufferSize):
+
 2021-08-02  Kate Cheney  
 
 [App Privacy Report] Domains are deleted for ephemeral website data stores


Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp (280575 => 280576)

--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp	2021-08-03 00:55:12 UTC (rev 280575)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp	2021-08-03 01:05:39 UTC (rev 280576)
@@ -109,6 +109,7 @@
 
 void RemoteAudioSession::setPreferredBufferSize(size_t size)
 {
+configuration().preferredBufferSize = size;
 ensureConnection().send(Messages::RemoteAudioSessionProxy::SetPreferredBufferSize(size), { });
 }
 


Modified: trunk/Tools/ChangeLog (280575 => 280576)

--- trunk/Tools/ChangeLog	2021-08-03 00:55:12 UTC (rev 280575)
+++ trunk/Tools/ChangeLog	2021-08-03 01:05:39 UTC (rev 280576)
@@ -1,3 +1,13 @@
+2021-08-02  Peng Liu  
+
+[GPUP] RemoteAudioSession::setPreferredBufferSize() does not change its preferredBufferSize
+https://bugs.webkit.org/show_bug.cgi?id=228720
+
+Reviewed by Jer Noble.
+
+* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
+(TEST_F):
+
 2021-08-02  Alex Christensen  
 
 Don't change invalid baseURLs from loadData or loadHTMLString to about:blank


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm (280575 => 280576)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm	2021-08-03 00:55:12 UTC (rev 280575)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm	2021-08-03 01:05:39 UTC (rev 280576)
@@ -79,32 +79,32 @@
 EXPECT_EQ(512, preferredAudioBufferSize());
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_AudioElement)
+TEST_F(PreferredAudioBufferSize, AudioElement)
 {
 runPlayingTestWithPageNamed(@"audio-only", 4096);
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_WebAudio)
+TEST_F(PreferredAudioBufferSize, WebAudio)
 {
 runPlayingTestWithPageNamed(@"web-audio-only", 128);
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_VideoOnly)
+TEST_F(PreferredAudioBufferSize, VideoOnly)
 {
 runPlayingTestWithPageNamed(@"video-without-audio", 4096);
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_VideoWithAudio)
+TEST_F(PreferredAudioBufferSize, VideoWithAudio)
 {
 runPlayingTestWithPageNamed(@"video-with-audio", 4096);
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_AudioWithWebAudio)
+TEST_F(PreferredAudioBufferSize, AudioWithWebAudio)
 {
 runPlayingTestWithPageNamed(@"audio-with-web-audio", 128);
 }
 
-TEST_F(PreferredAudioBufferSize, DISABLED_VideoWithAudioAndWebAudio)
+TEST_F(PreferredAudioBufferSize, VideoWithAudioAndWebAudio)
 {
 runPlayingTestWithPageNamed(@"video-with-audio-and-web-audio", 128);
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280439] trunk/Tools

2021-07-29 Thread peng . liu6
Title: [280439] trunk/Tools








Revision 280439
Author peng.l...@apple.com
Date 2021-07-29 12:04:52 -0700 (Thu, 29 Jul 2021)


Log Message
[Catalina][GPUP] Some API tests fail after GPU Process features are enabled
https://bugs.webkit.org/show_bug.cgi?id=228589

Reviewed by Aakash Jain.

Disable a few API tests while the investigation is ongoing.

* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
* TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm:
(TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
(TEST_F):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm




Diff

Modified: trunk/Tools/ChangeLog (280438 => 280439)

--- trunk/Tools/ChangeLog	2021-07-29 18:58:04 UTC (rev 280438)
+++ trunk/Tools/ChangeLog	2021-07-29 19:04:52 UTC (rev 280439)
@@ -1,3 +1,20 @@
+2021-07-29  Peng Liu  
+
+[Catalina][GPUP] Some API tests fail after GPU Process features are enabled
+https://bugs.webkit.org/show_bug.cgi?id=228589
+
+Reviewed by Aakash Jain.
+
+Disable a few API tests while the investigation is ongoing.
+
+* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
+* TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm:
+(TestWebKitAPI::TEST):
+* TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm:
+(TEST_F):
+* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
+(TEST_F):
+
 2021-07-29  Aakash Jain  
 
 Send email notification when VerifyGitHubIntegrity step fails


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm (280438 => 280439)

--- trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm	2021-07-29 18:58:04 UTC (rev 280438)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm	2021-07-29 19:04:52 UTC (rev 280439)
@@ -648,7 +648,7 @@
 EXPECT_EQ(webViewPID, [webView _webProcessIdentifier]);
 }
 
-TEST(WebKit2, CrashGPUProcessAfterApplyingConstraints)
+TEST(WebKit2, DISABLED_CrashGPUProcessAfterApplyingConstraints)
 {
 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
 auto preferences = [configuration preferences];


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm (280438 => 280439)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm	2021-07-29 18:58:04 UTC (rev 280438)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioBufferSize.mm	2021-07-29 19:04:52 UTC (rev 280439)
@@ -56,7 +56,7 @@
 return 0;
 }
 
-TEST(WebKit, AudioBufferSize)
+TEST(WebKit, DISABLED_AudioBufferSize)
 {
 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
 auto context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm (280438 => 280439)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm	2021-07-29 18:58:04 UTC (rev 280438)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm	2021-07-29 19:04:52 UTC (rev 280439)
@@ -203,7 +203,7 @@
 HashMap _callbacks;
 };
 
-TEST_F(NowPlayingTest, AudioElement)
+TEST_F(NowPlayingTest, DISABLED_AudioElement)
 {
 executeAndWaitForWebViewToBecomeNowPlaying([&] {
 executeAndWaitForPlaying([&] {
@@ -214,7 +214,7 @@
 });
 }
 
-TEST_F(NowPlayingTest, VideoElementWithAudio)
+TEST_F(NowPlayingTest, DISABLED_VideoElementWithAudio)
 {
 executeAndWaitForWebViewToBecomeNowPlaying([&] {
 executeAndWaitForPlaying([&] {
@@ -246,7 +246,7 @@
 ASSERT_NE(webViewPid(), getNowPlayingClientPid());
 }
 
-TEST_F(NowPlayingTest, VideoElementWithMutedAudioUnmutedWithUserGesture)
+TEST_F(NowPlayingTest, DISABLED_VideoElementWithMutedAudioUnmutedWithUserGesture)
 {
 executeAndWaitForPlaying([&] {
 loadPage("now-playing");


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm (280438 => 280439)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm	2021-07-29 18:58:04 UTC (rev 280438)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm	2021-07-29 19:04:52 UTC (rev 280439)
@@ -79,32 +79,32 @@
 EXPECT_EQ(512, preferredAudioBufferSize());
 }
 
-TEST_F(PreferredAudioBufferSize, AudioElement)
+TEST_F(PreferredAudioBufferSize, DISABLED_AudioElement)
 {
 runPlayingTestWithPageNamed(@"audio-only", 4096);
 }
 
-TEST_F(PreferredAudioBufferSize, WebAudio)
+TEST_F(PreferredAudioBufferSize, DISABLED_WebAudio)
 {
 runPlayingTestWithPageNamed(@"web-audio-only", 128);
 }
 
-TEST_F(PreferredAudioBufferSize, VideoOnly)
+TEST_F(PreferredAudioBufferSize, DISABLED_VideoOnly)
 {
 runPlayingTestWithPageNamed(@"video-without-audio", 4096);
 }
 

[webkit-changes] [280433] trunk/Source/WebKit

2021-07-29 Thread peng . liu6
Title: [280433] trunk/Source/WebKit








Revision 280433
Author peng.l...@apple.com
Date 2021-07-29 10:50:38 -0700 (Thu, 29 Jul 2021)


Log Message
The bundle path of downlevel Safari is wrong
https://bugs.webkit.org/show_bug.cgi?id=228339

Reviewed by Tim Horton.

Use the same approach as `isSystemWebKit` to check whether the WebKit bundle
is from the staged framework.

* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::isFeatureFlagEnabled):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280432 => 280433)

--- trunk/Source/WebKit/ChangeLog	2021-07-29 17:48:28 UTC (rev 280432)
+++ trunk/Source/WebKit/ChangeLog	2021-07-29 17:50:38 UTC (rev 280433)
@@ -1,3 +1,16 @@
+2021-07-29  Peng Liu  
+
+The bundle path of downlevel Safari is wrong
+https://bugs.webkit.org/show_bug.cgi?id=228339
+
+Reviewed by Tim Horton.
+
+Use the same approach as `isSystemWebKit` to check whether the WebKit bundle
+is from the staged framework.
+
+* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
+(WebKit::isFeatureFlagEnabled):
+
 2021-07-29  Kate Cheney  
 
 CORS preflight checks not attributed to the correct application


Modified: trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (280432 => 280433)

--- trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-29 17:48:28 UTC (rev 280432)
+++ trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-29 17:50:38 UTC (rev 280433)
@@ -40,7 +40,10 @@
 // Because of , WebKit has to parse the feature flags plist file
 bool isFeatureFlagEnabled(const String& featureName)
 {
-BOOL isWebKitBundleFromStagedFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari"];
+static bool isWebKitBundleFromStagedFramework = [] {
+NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
+return [webkit2Bundle.bundlePath hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari/"];
+}();
 
 if (!isWebKitBundleFromStagedFramework)
 return _os_feature_enabled_impl("WebKit", (const char*)featureName.utf8().data());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280424] trunk/Source/WebKit

2021-07-29 Thread peng . liu6
Title: [280424] trunk/Source/WebKit








Revision 280424
Author peng.l...@apple.com
Date 2021-07-29 09:27:43 -0700 (Thu, 29 Jul 2021)


Log Message
[macOS Catalina] Some feature preferences have wrong default values
https://bugs.webkit.org/show_bug.cgi?id=228564

Reviewed by Tim Horton.

When `HAVE(SYSTEM_FEATURE_FLAGS)` is false, we still need to enable
some features by default.

This patch makes sure the following features are enabled by default
on macOS (consistent with the properties in WebKit-macos.plist):
- async_frame_and_overflow_scrolling
- gpu_process_canvas_rendering
- gpu_process_media
- gpu_process_webrtc
- incremental_pdf
- vp9_decoder
- webm_format_reader
- webm_parser

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultUseGPUProcessForCanvasRenderingEnabled):
(WebKit::defaultUseGPUProcessForDOMRenderingEnabled):
(WebKit::defaultUseGPUProcessForMediaEnabled):
(WebKit::defaultCaptureAudioInGPUProcessEnabled):
(WebKit::defaultCaptureVideoInGPUProcessEnabled):
(WebKit::defaultWebRTCCodecsInGPUProcess):
(WebKit::defaultIncrementalPDFEnabled):
(WebKit::defaultWebMFormatReaderEnabled):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (280423 => 280424)

--- trunk/Source/WebKit/ChangeLog	2021-07-29 15:16:03 UTC (rev 280423)
+++ trunk/Source/WebKit/ChangeLog	2021-07-29 16:27:43 UTC (rev 280424)
@@ -1,3 +1,34 @@
+2021-07-29  Peng Liu  
+
+[macOS Catalina] Some feature preferences have wrong default values
+https://bugs.webkit.org/show_bug.cgi?id=228564
+
+Reviewed by Tim Horton.
+
+When `HAVE(SYSTEM_FEATURE_FLAGS)` is false, we still need to enable
+some features by default.
+
+This patch makes sure the following features are enabled by default
+on macOS (consistent with the properties in WebKit-macos.plist):
+- async_frame_and_overflow_scrolling
+- gpu_process_canvas_rendering
+- gpu_process_media
+- gpu_process_webrtc
+- incremental_pdf
+- vp9_decoder
+- webm_format_reader
+- webm_parser
+
+* Shared/WebPreferencesDefaultValues.cpp:
+(WebKit::defaultUseGPUProcessForCanvasRenderingEnabled):
+(WebKit::defaultUseGPUProcessForDOMRenderingEnabled):
+(WebKit::defaultUseGPUProcessForMediaEnabled):
+(WebKit::defaultCaptureAudioInGPUProcessEnabled):
+(WebKit::defaultCaptureVideoInGPUProcessEnabled):
+(WebKit::defaultWebRTCCodecsInGPUProcess):
+(WebKit::defaultIncrementalPDFEnabled):
+(WebKit::defaultWebMFormatReaderEnabled):
+
 2021-07-29  Youenn Fablet  
 
 NetworkRTCUDPSocketCocoaConnections nw_listener_set_state_changed_handler callback should hold a reference to its listener


Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (280423 => 280424)

--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-07-29 15:16:03 UTC (rev 280423)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2021-07-29 16:27:43 UTC (rev 280424)
@@ -149,29 +149,41 @@
 
 bool defaultUseGPUProcessForCanvasRenderingEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS) && ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if HAVE(SYSTEM_FEATURE_FLAGS)
 return isFeatureFlagEnabled("gpu_process_canvas_rendering");
+#else
+return true;
+#endif // HAVE(SYSTEM_FEATURE_FLAGS)
+#else
+return false;
 #endif
-
-return false;
 }
 
 bool defaultUseGPUProcessForDOMRenderingEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS) && ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if HAVE(SYSTEM_FEATURE_FLAGS)
 return isFeatureFlagEnabled("gpu_process_dom_rendering");
+#else
+return false;
+#endif // HAVE(SYSTEM_FEATURE_FLAGS)
+#else
+return false;
 #endif
-
-return false;
 }
 
 bool defaultUseGPUProcessForMediaEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS) && ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if HAVE(SYSTEM_FEATURE_FLAGS)
 return isFeatureFlagEnabled("gpu_process_media");
+#else
+return true;
+#endif // HAVE(SYSTEM_FEATURE_FLAGS)
+#else
+return false;
 #endif
-
-return false;
 }
 
 bool defaultUseGPUProcessForWebGLEnabled()
@@ -189,14 +201,21 @@
 
 bool defaultCaptureAudioInGPUProcessEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS) && ENABLE(GPU_PROCESS_BY_DEFAULT)
+#if ENABLE(GPU_PROCESS_BY_DEFAULT)
+
+#if HAVE(SYSTEM_FEATURE_FLAGS)
 #if PLATFORM(MAC)
 return isFeatureFlagEnabled("gpu_process_webrtc");
 #elif PLATFORM(IOS_FAMILY)
 return isFeatureFlagEnabled("gpu_process_media");
 #endif
+#else
+return true;
+#endif // HAVE(SYSTEM_FEATURE_FLAGS)
+
+#else
+return false;
 #endif
-return false;
 }
 
 bool defaultCaptureAudioInUIProcessEnabled()
@@ -210,9 +229,13 @@
 
 bool defaultCaptureVideoInGPUProcessEnabled()
 {
-#if HAVE(SYSTEM_FEATURE_FLAGS) && ENABLE(GPU_PROCESS_BY_DEFAULT)

[webkit-changes] [280358] trunk/Source/WebKit

2021-07-27 Thread peng . liu6
Title: [280358] trunk/Source/WebKit








Revision 280358
Author peng.l...@apple.com
Date 2021-07-27 16:19:32 -0700 (Tue, 27 Jul 2021)


Log Message
Safari hangs when entering PiP from (element) fullscreen
https://bugs.webkit.org/show_bug.cgi?id=228332

Reviewed by Eric Carlson.

When a video element's ancestor element is in fullscreen and the video element
is entering picture-in-picture, `WKFullScreenWindowController` in the UI process
will notify the WebContent process that the ancestor element needs to exit fullscreen.
However, some sites call `document.webkitExitFullscreen()` to request the ancestor
element to exit fullscreen proactively. Both WebContent process and UI process will
try to do the same thing and may lead to a race condition.

That was not an issue before r274460 because `WebFullScreenManager::requestExitFullScreen()`
will ignore the request from the UI process if the WebContent process has already
started the steps to exit fullscreen.

This patch stops the UI process sending the exit fullscreen request if a WebContent
process has started the steps to exit fullscreen.

Manually tested.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController didEnterPictureInPicture]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280357 => 280358)

--- trunk/Source/WebKit/ChangeLog	2021-07-27 23:17:23 UTC (rev 280357)
+++ trunk/Source/WebKit/ChangeLog	2021-07-27 23:19:32 UTC (rev 280358)
@@ -1,3 +1,29 @@
+2021-07-27  Peng Liu  
+
+Safari hangs when entering PiP from (element) fullscreen
+https://bugs.webkit.org/show_bug.cgi?id=228332
+
+Reviewed by Eric Carlson.
+
+When a video element's ancestor element is in fullscreen and the video element
+is entering picture-in-picture, `WKFullScreenWindowController` in the UI process
+will notify the WebContent process that the ancestor element needs to exit fullscreen.
+However, some sites call `document.webkitExitFullscreen()` to request the ancestor
+element to exit fullscreen proactively. Both WebContent process and UI process will
+try to do the same thing and may lead to a race condition.
+
+That was not an issue before r274460 because `WebFullScreenManager::requestExitFullScreen()`
+will ignore the request from the UI process if the WebContent process has already
+started the steps to exit fullscreen.
+
+This patch stops the UI process sending the exit fullscreen request if a WebContent
+process has started the steps to exit fullscreen.
+
+Manually tested.
+
+* UIProcess/mac/WKFullScreenWindowController.mm:
+(-[WKFullScreenWindowController didEnterPictureInPicture]):
+
 2021-07-27  Myles C. Maxfield  
 
 [GPU Process] Start tracking resource uses for NativeImages and Fonts


Modified: trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm (280357 => 280358)

--- trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm	2021-07-27 23:17:23 UTC (rev 280357)
+++ trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm	2021-07-27 23:19:32 UTC (rev 280358)
@@ -641,7 +641,8 @@
 
 - (void)didEnterPictureInPicture
 {
-[self requestExitFullScreen];
+if ([self isFullScreen])
+[self requestExitFullScreen];
 }
 
 - (void)didExitPictureInPicture






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280351] trunk/Source/WebKit

2021-07-27 Thread peng . liu6
Title: [280351] trunk/Source/WebKit








Revision 280351
Author peng.l...@apple.com
Date 2021-07-27 15:15:45 -0700 (Tue, 27 Jul 2021)


Log Message
The bundle path of downlevel Safari is wrong
https://bugs.webkit.org/show_bug.cgi?id=228339

Reviewed by Jer Noble.

Fix the bundle path. The correct path is "/Library/Apple/System/Library/StagedFrameworks/Safari".

* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::isFeatureFlagEnabled):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280350 => 280351)

--- trunk/Source/WebKit/ChangeLog	2021-07-27 21:44:07 UTC (rev 280350)
+++ trunk/Source/WebKit/ChangeLog	2021-07-27 22:15:45 UTC (rev 280351)
@@ -1,3 +1,15 @@
+2021-07-27  Peng Liu  
+
+The bundle path of downlevel Safari is wrong
+https://bugs.webkit.org/show_bug.cgi?id=228339
+
+Reviewed by Jer Noble.
+
+Fix the bundle path. The correct path is "/Library/Apple/System/Library/StagedFrameworks/Safari".
+
+* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
+(WebKit::isFeatureFlagEnabled):
+
 2021-07-27  Saagar Jha  
 
 Fix WebProcess sandbox profile when ENABLE_SANDBOX_MESSAGE_FILTER is disabled


Modified: trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (280350 => 280351)

--- trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-27 21:44:07 UTC (rev 280350)
+++ trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-27 22:15:45 UTC (rev 280351)
@@ -40,7 +40,7 @@
 // Because of , WebKit has to parse the feature flags plist file
 bool isFeatureFlagEnabled(const String& featureName)
 {
-BOOL isWebKitBundleFromStagedFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/WebKit"];
+BOOL isWebKitBundleFromStagedFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari"];
 
 if (!isWebKitBundleFromStagedFramework)
 return _os_feature_enabled_impl("WebKit", (const char*)featureName.utf8().data());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280180] trunk/Tools

2021-07-22 Thread peng . liu6
Title: [280180] trunk/Tools








Revision 280180
Author peng.l...@apple.com
Date 2021-07-22 10:28:57 -0700 (Thu, 22 Jul 2021)


Log Message
[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
https://bugs.webkit.org/show_bug.cgi?id=227728

Unreviewed API test gardening.


* TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
(TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm




Diff

Modified: trunk/Tools/ChangeLog (280179 => 280180)

--- trunk/Tools/ChangeLog	2021-07-22 17:18:20 UTC (rev 280179)
+++ trunk/Tools/ChangeLog	2021-07-22 17:28:57 UTC (rev 280180)
@@ -1,3 +1,13 @@
+2021-07-22  Peng Liu  
+
+[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
+https://bugs.webkit.org/show_bug.cgi?id=227728
+
+Unreviewed API test gardening.
+
+* TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
+(TEST):
+
 2021-07-22  Frédéric Wang  
 
 nullptr crash in ApplyStyleCommand::applyRelativeFontStyleChange


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm (280179 => 280180)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm	2021-07-22 17:18:20 UTC (rev 280179)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm	2021-07-22 17:28:57 UTC (rev 280180)
@@ -368,7 +368,8 @@
 EXPECT_EQ(webViewPID, [webView _webProcessIdentifier]);
 }
 
-TEST(GPUProcess, CrashWhilePlayingAudioViaCreateMediaElementSource)
+// FIXME: Re-enable this test once  is resolved
+TEST(GPUProcess, DISABLED_CrashWhilePlayingAudioViaCreateMediaElementSource)
 {
 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
 WKPreferencesSetBoolValueForKeyForTesting((__bridge WKPreferencesRef)[configuration preferences], true, WKStringCreateWithUTF8CString("UseGPUProcessForMediaEnabled"));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279964] trunk/Source/WebCore

2021-07-15 Thread peng . liu6
Title: [279964] trunk/Source/WebCore








Revision 279964
Author peng.l...@apple.com
Date 2021-07-15 14:08:46 -0700 (Thu, 15 Jul 2021)


Log Message
Reddit PiP video pauses when scrolling
https://bugs.webkit.org/show_bug.cgi?id=227999

Reviewed by Jer Noble.

Enable the `requiresUserGestureToPauseInPictureInPicture` quirk for reddit.com.

* page/Quirks.cpp:
(WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Quirks.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (279963 => 279964)

--- trunk/Source/WebCore/ChangeLog	2021-07-15 21:04:58 UTC (rev 279963)
+++ trunk/Source/WebCore/ChangeLog	2021-07-15 21:08:46 UTC (rev 279964)
@@ -1,3 +1,15 @@
+2021-07-15  Peng Liu  
+
+Reddit PiP video pauses when scrolling
+https://bugs.webkit.org/show_bug.cgi?id=227999
+
+Reviewed by Jer Noble.
+
+Enable the `requiresUserGestureToPauseInPictureInPicture` quirk for reddit.com.
+
+* page/Quirks.cpp:
+(WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const):
+
 2021-07-15  Megan Gardner  
 
 Rename scrollRectIntoView to scrollContainingScrollViewsToRevealRect for clarity.


Modified: trunk/Source/WebCore/page/Quirks.cpp (279963 => 279964)

--- trunk/Source/WebCore/page/Quirks.cpp	2021-07-15 21:04:58 UTC (rev 279963)
+++ trunk/Source/WebCore/page/Quirks.cpp	2021-07-15 21:08:46 UTC (rev 279964)
@@ -1338,15 +1338,15 @@
 bool Quirks::requiresUserGestureToPauseInPictureInPicture() const
 {
 #if ENABLE(VIDEO_PRESENTATION_MODE)
-// Facebook and Twitter will naively pause a  element that has scrolled out of the viewport,
+// Facebook, Twitter, and Reddit will naively pause a  element that has scrolled out of the viewport,
 // regardless of whether that element is currently in PiP mode.
-// We should remove the quirk once  and  have been fixed.
+// We should remove the quirk once , , and  have been fixed.
 if (!needsQuirks())
 return false;
 
 if (!m_requiresUserGestureToPauseInPictureInPicture) {
 auto domain = RegistrableDomain(m_document->topDocument().url()).string();
-m_requiresUserGestureToPauseInPictureInPicture = domain == "facebook.com"_s || domain == "twitter.com"_s;
+m_requiresUserGestureToPauseInPictureInPicture = domain == "facebook.com"_s || domain == "twitter.com"_s || domain == "reddit.com"_s;
 }
 
 return *m_requiresUserGestureToPauseInPictureInPicture;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279891] trunk/Source/WebKit

2021-07-13 Thread peng . liu6
Title: [279891] trunk/Source/WebKit








Revision 279891
Author peng.l...@apple.com
Date 2021-07-13 14:08:25 -0700 (Tue, 13 Jul 2021)


Log Message
[GPUP] RemoteMediaPlayerProxy may not send the latest "naturalSize" to MediaPlayerPrivateRemote
https://bugs.webkit.org/show_bug.cgi?id=227894

Reviewed by Jer Noble.

When a `MediaPlayerPrivateMediaSourceAVFObjC` in the GPU process changes its `naturalSize`,
the new value will be sent to the WebContent process in the IPC message
`MediaPlayerPrivateRemote::SizeChanged`. However, `RemoteMediaPlayerProxy` won't update
`m_cachedState.naturalSize`. So the next `MediaPlayerPrivateRemote::UpdateCachedState`
message will use the old `naturalSize` and the WebContent process will drop the correct value
after receiving the message.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerSizeChanged):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (279890 => 279891)

--- trunk/Source/WebKit/ChangeLog	2021-07-13 20:56:39 UTC (rev 279890)
+++ trunk/Source/WebKit/ChangeLog	2021-07-13 21:08:25 UTC (rev 279891)
@@ -1,3 +1,20 @@
+2021-07-13  Peng Liu  
+
+[GPUP] RemoteMediaPlayerProxy may not send the latest "naturalSize" to MediaPlayerPrivateRemote
+https://bugs.webkit.org/show_bug.cgi?id=227894
+
+Reviewed by Jer Noble.
+
+When a `MediaPlayerPrivateMediaSourceAVFObjC` in the GPU process changes its `naturalSize`,
+the new value will be sent to the WebContent process in the IPC message
+`MediaPlayerPrivateRemote::SizeChanged`. However, `RemoteMediaPlayerProxy` won't update
+`m_cachedState.naturalSize`. So the next `MediaPlayerPrivateRemote::UpdateCachedState`
+message will use the old `naturalSize` and the WebContent process will drop the correct value
+after receiving the message.
+
+* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+(WebKit::RemoteMediaPlayerProxy::mediaPlayerSizeChanged):
+
 2021-07-13  Alex Christensen  
 
 Unreviewed, reverting r279647.


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp (279890 => 279891)

--- trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-07-13 20:56:39 UTC (rev 279890)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-07-13 21:08:25 UTC (rev 279891)
@@ -659,7 +659,8 @@
 
 void RemoteMediaPlayerProxy::mediaPlayerSizeChanged()
 {
-m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::SizeChanged(m_player->naturalSize()), m_id);
+m_cachedState.naturalSize = m_player->naturalSize();
+m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::SizeChanged(m_cachedState.naturalSize), m_id);
 }
 
 void RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged()






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279319] trunk/Source/WebCore

2021-06-27 Thread peng . liu6
Title: [279319] trunk/Source/WebCore








Revision 279319
Author peng.l...@apple.com
Date 2021-06-27 12:17:19 -0700 (Sun, 27 Jun 2021)


Log Message
Backgrounding and returning to a FaceTime call in MobileSafari leads to a blank black sreen
https://bugs.webkit.org/show_bug.cgi?id=227406

Reviewed by Eric Carlson.

The `RequireUserGestureForFullscreen` restriction will be kept in a `MediaElementSession`
if the corresponding media element is `autoplay`. Therefore, the request to enter
picture-in-picture from the UI process will be ignored by the media element, and the
state machine managing video presentation mode in the UI process will be an inconsistent state.

This patch creates a `UserGestureIndicator` before requesting the media element
to change its presentation mode to make sure the request will be handled.

* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::fullscreenModeChanged):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (279318 => 279319)

--- trunk/Source/WebCore/ChangeLog	2021-06-27 19:16:51 UTC (rev 279318)
+++ trunk/Source/WebCore/ChangeLog	2021-06-27 19:17:19 UTC (rev 279319)
@@ -1,3 +1,21 @@
+2021-06-27  Peng Liu  
+
+Backgrounding and returning to a FaceTime call in MobileSafari leads to a blank black sreen
+https://bugs.webkit.org/show_bug.cgi?id=227406
+
+Reviewed by Eric Carlson.
+
+The `RequireUserGestureForFullscreen` restriction will be kept in a `MediaElementSession`
+if the corresponding media element is `autoplay`. Therefore, the request to enter
+picture-in-picture from the UI process will be ignored by the media element, and the
+state machine managing video presentation mode in the UI process will be an inconsistent state.
+
+This patch creates a `UserGestureIndicator` before requesting the media element
+to change its presentation mode to make sure the request will be handled.
+
+* platform/cocoa/VideoFullscreenModelVideoElement.mm:
+(WebCore::VideoFullscreenModelVideoElement::fullscreenModeChanged):
+
 2021-06-27  Alan Bujtas  
 
 [LFC][TFC] Add support for shrinking over-constrained columns based on the width type priority list


Modified: trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm (279318 => 279319)

--- trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm	2021-06-27 19:16:51 UTC (rev 279318)
+++ trunk/Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm	2021-06-27 19:17:19 UTC (rev 279319)
@@ -192,8 +192,10 @@
 
 void VideoFullscreenModelVideoElement::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
 {
-if (m_videoElement)
+if (m_videoElement) {
+UserGestureIndicator gestureIndicator(ProcessingUserGesture, _videoElement->document());
 m_videoElement->setPresentationMode(HTMLVideoElement::toPresentationMode(videoFullscreenMode));
+}
 }
 
 void VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID(CompletionHandler&& completionHandler)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279287] trunk/Source/WebKit

2021-06-25 Thread peng . liu6
Title: [279287] trunk/Source/WebKit








Revision 279287
Author peng.l...@apple.com
Date 2021-06-25 09:31:29 -0700 (Fri, 25 Jun 2021)


Log Message
Explicitly invalidate WKFullScreenViewController after a video exits fullscreen
https://bugs.webkit.org/show_bug.cgi?id=227372

Reviewed by Eric Carlson.

Since `WKFullScreenWindowController` owns `WKFullScreenViewController`,
we had better let `WKFullScreenWindowController` manage the life cycle
of `WKFullScreenViewController`.

* UIProcess/ios/fullscreen/WKFullScreenViewController.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController initWithWebView:]):
(-[WKFullScreenViewController invalidate]):
(-[WKFullScreenViewController dealloc]):
(-[WKFullScreenViewController showUI]):
(-[WKFullScreenViewController hideUI]):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController setAnimatingViewAlpha:]):
(-[WKFullScreenViewController setPrefersStatusBarHidden:]):
(-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):
(-[WKFullScreenViewController setPlaying:]):
(-[WKFullScreenViewController setPictureInPictureActive:]):
(-[WKFullScreenViewController setAnimating:]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _effectiveFullscreenInsets]):
(-[WKFullScreenViewController _cancelAction:]):
(-[WKFullScreenViewController _togglePiPAction:]):
(-[WKFullScreenViewController _touchDetected:]):
(-[WKFullScreenViewController _statusBarFrameDidChange:]):
(-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
(-[WKFullScreenViewController _showPhishingAlert]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _completedExitFullScreen]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h
trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (279286 => 279287)

--- trunk/Source/WebKit/ChangeLog	2021-06-25 15:42:07 UTC (rev 279286)
+++ trunk/Source/WebKit/ChangeLog	2021-06-25 16:31:29 UTC (rev 279287)
@@ -1,3 +1,39 @@
+2021-06-25  Peng Liu  
+
+Explicitly invalidate WKFullScreenViewController after a video exits fullscreen
+https://bugs.webkit.org/show_bug.cgi?id=227372
+
+Reviewed by Eric Carlson.
+
+Since `WKFullScreenWindowController` owns `WKFullScreenViewController`,
+we had better let `WKFullScreenWindowController` manage the life cycle
+of `WKFullScreenViewController`.
+
+* UIProcess/ios/fullscreen/WKFullScreenViewController.h:
+* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+(-[WKFullScreenViewController initWithWebView:]):
+(-[WKFullScreenViewController invalidate]):
+(-[WKFullScreenViewController dealloc]):
+(-[WKFullScreenViewController showUI]):
+(-[WKFullScreenViewController hideUI]):
+(-[WKFullScreenViewController videoControlsManagerDidChange]):
+(-[WKFullScreenViewController setAnimatingViewAlpha:]):
+(-[WKFullScreenViewController setPrefersStatusBarHidden:]):
+(-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):
+(-[WKFullScreenViewController setPlaying:]):
+(-[WKFullScreenViewController setPictureInPictureActive:]):
+(-[WKFullScreenViewController setAnimating:]):
+(-[WKFullScreenViewController _manager]):
+(-[WKFullScreenViewController _effectiveFullscreenInsets]):
+(-[WKFullScreenViewController _cancelAction:]):
+(-[WKFullScreenViewController _togglePiPAction:]):
+(-[WKFullScreenViewController _touchDetected:]):
+(-[WKFullScreenViewController _statusBarFrameDidChange:]):
+(-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
+(-[WKFullScreenViewController _showPhishingAlert]):
+* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+(-[WKFullScreenWindowController _completedExitFullScreen]):
+
 2021-06-25  Commit Queue  
 
 Unreviewed, reverting r279266.


Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h (279286 => 279287)

--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h	2021-06-25 15:42:07 UTC (rev 279286)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h	2021-06-25 16:31:29 UTC (rev 279287)
@@ -42,6 +42,7 @@
 @property (assign, nonatomic, getter=isAnimating) BOOL animating;
 
 - (id)initWithWebView:(WKWebView *)webView;
+- (void)invalidate;
 - (void)showUI;
 - (void)hideUI;
 - (void)videoControlsManagerDidChange;


Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm (279286 => 279287)

--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm	

[webkit-changes] [279206] trunk/Source/WebCore

2021-06-23 Thread peng . liu6
Title: [279206] trunk/Source/WebCore








Revision 279206
Author peng.l...@apple.com
Date 2021-06-23 20:34:52 -0700 (Wed, 23 Jun 2021)


Log Message
[iPadOS] A video cannot enter picture-in-picture when Safari is suspended
https://bugs.webkit.org/show_bug.cgi?id=227325

Reviewed by Eric Carlson.

When an element goes into the element fullscreen mode, a descendant video element
gains the ability to automatically enter picture-in-picture on application suspend.
However, the video element may lose the ability after some stress tests.

The root cause is related to `m_restoringFullscreenForPictureInPictureStop`.
Under stress tests, `-[AVPlayerViewController enterFullScreenAnimated:completionHandler]`
may call the completion handler with `success == NO`. The current implementation
will keep `m_restoringFullscreenForPictureInPictureStop` with a wrong value,
so that the video cannot enter picture-in-picture automatically when the browser
is suspended.

This patch removes `m_restoringFullscreenForPictureInPictureStop` since it is not needed
after r269557.

Manually tested.

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::doEnterFullscreen):
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (279205 => 279206)

--- trunk/Source/WebCore/ChangeLog	2021-06-24 03:32:41 UTC (rev 279205)
+++ trunk/Source/WebCore/ChangeLog	2021-06-24 03:34:52 UTC (rev 279206)
@@ -1,3 +1,34 @@
+2021-06-23  Peng Liu  
+
+[iPadOS] A video cannot enter picture-in-picture when Safari is suspended
+https://bugs.webkit.org/show_bug.cgi?id=227325
+
+Reviewed by Eric Carlson.
+
+When an element goes into the element fullscreen mode, a descendant video element
+gains the ability to automatically enter picture-in-picture on application suspend.
+However, the video element may lose the ability after some stress tests.
+
+The root cause is related to `m_restoringFullscreenForPictureInPictureStop`.
+Under stress tests, `-[AVPlayerViewController enterFullScreenAnimated:completionHandler]`
+may call the completion handler with `success == NO`. The current implementation
+will keep `m_restoringFullscreenForPictureInPictureStop` with a wrong value,
+so that the video cannot enter picture-in-picture automatically when the browser
+is suspended.
+
+This patch removes `m_restoringFullscreenForPictureInPictureStop` since it is not needed
+after r269557.
+
+Manually tested.
+
+* platform/ios/VideoFullscreenInterfaceAVKit.h:
+* platform/ios/VideoFullscreenInterfaceAVKit.mm:
+(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
+(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
+(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
+(VideoFullscreenInterfaceAVKit::doEnterFullscreen):
+(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
+
 2021-06-23  Alex Christensen  
 
 Fix some PerformanceNavigationTiming bugs


Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (279205 => 279206)

--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-06-24 03:32:41 UTC (rev 279205)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-06-24 03:34:52 UTC (rev 279206)
@@ -192,7 +192,6 @@
 bool m_wirelessVideoPlaybackDisabled { true };
 bool m_shouldReturnToFullscreenWhenStoppingPictureInPicture { false };
 bool m_blocksReturnToFullscreenFromPictureInPicture { false };
-bool m_restoringFullscreenForPictureInPictureStop { false };
 bool m_returningToStandby { false };
 
 bool m_setupNeedsInlineRect { false };


Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (279205 => 279206)

--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2021-06-24 03:32:41 UTC (rev 279205)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2021-06-24 03:34:52 UTC (rev 279206)
@@ -1166,7 +1166,7 @@
 m_exitingPictureInPicture = true;
 m_shouldReturnToFullscreenWhenStoppingPictureInPicture = false;
 
-if (m_currentMode.hasFullscreen() || m_restoringFullscreenForPictureInPictureStop)
+if (m_currentMode.hasFullscreen())
 return;
 
 if (m_videoFullscreenModel)
@@ -1188,8 +1188,8 @@
 return;
 }
 
-if (m_currentMode.hasFullscreen() || 

[webkit-changes] [279122] trunk/Source/WebKit

2021-06-22 Thread peng . liu6
Title: [279122] trunk/Source/WebKit








Revision 279122
Author peng.l...@apple.com
Date 2021-06-22 10:00:38 -0700 (Tue, 22 Jun 2021)


Log Message
ASSERTION FAILED: videoFullscreenManager->client() == nullptr in WKFullScreenWindowController.mm
https://bugs.webkit.org/show_bug.cgi?id=227243

Reviewed by Eric Carlson.

`-[WKFullScreenWindowController windowDidExitFullScreen:]` needs to clear
its client like `-[WKFullScreenWindowController didExitPictureInPicture]` does.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController windowDidExitFullScreen:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (279121 => 279122)

--- trunk/Source/WebKit/ChangeLog	2021-06-22 16:55:58 UTC (rev 279121)
+++ trunk/Source/WebKit/ChangeLog	2021-06-22 17:00:38 UTC (rev 279122)
@@ -1,3 +1,16 @@
+2021-06-22  Peng Liu  
+
+ASSERTION FAILED: videoFullscreenManager->client() == nullptr in WKFullScreenWindowController.mm
+https://bugs.webkit.org/show_bug.cgi?id=227243
+
+Reviewed by Eric Carlson.
+
+`-[WKFullScreenWindowController windowDidExitFullScreen:]` needs to clear
+its client like `-[WKFullScreenWindowController didExitPictureInPicture]` does.
+
+* UIProcess/mac/WKFullScreenWindowController.mm:
+(-[WKFullScreenWindowController windowDidExitFullScreen:]):
+
 2021-06-22  Truitt Savell  
 
 Unreviewed, reverting r279083.


Modified: trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm (279121 => 279122)

--- trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm	2021-06-22 16:55:58 UTC (rev 279121)
+++ trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm	2021-06-22 17:00:38 UTC (rev 279122)
@@ -698,6 +698,11 @@
 - (void)windowDidExitFullScreen:(NSNotification *)notification
 {
 [self finishedExitFullScreenAnimation:YES];
+
+if (auto* videoFullscreenManager = self._videoFullscreenManager) {
+ASSERT(videoFullscreenManager->client() == &_videoFullscreenManagerProxyClient);
+videoFullscreenManager->setClient(nullptr);
+}
 }
 
 - (NSWindow *)destinationWindowToExitFullScreenForWindow:(NSWindow *)window






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279043] trunk/Source

2021-06-18 Thread peng . liu6
Title: [279043] trunk/Source








Revision 279043
Author peng.l...@apple.com
Date 2021-06-18 12:15:40 -0700 (Fri, 18 Jun 2021)


Log Message
[iOS] Fullscreen video playback gets stuck after interacting with the playback controls
https://bugs.webkit.org/show_bug.cgi?id=227047

Reviewed by Eric Carlson.

When we scrub a playing video, the video element may enter a temporarily stalled
state - the player is still playing, but it does not have enough data. In WebKit,
the `rate` of the player will be 0. But we cannot set the rate of `WebAVPlayerController`
to 0 in this case, because AVKit will believe the video playback is paused when
its rate is 0. In r261587, we defined a magic rate (0.0001f) for this case.

Unfortunately, with the changes in r275956, `WebAVPlayerController` will
align its `defaultPlaybackRate` with `rate` when `rate` is not 0. Under stress
tests, e.g., keep scrubbing a video, a video element will eventually enter a state
in which both `defaultPlaybackRate` and `rate` are the magic rate. And the video
appears to be stuck for users.

To fix the issue, this patch removes the magic rate and defines a new state: `stalled`.
A video will be in the stalled state when it is playing but does not have enough data.
WebKit will only change the rate of `WebAVPlayerController` when the video
is not stalled.

To avoid potential problems due to the conversions between "float" and "double"
back and forth, this patch updates the types of `playbackRate` and `defaultPlaybackRate`.

Source/WebCore:

* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::rateChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::setDefaultPlaybackRate):
(WebCore::PlaybackSessionModelMediaElement::setPlaybackRate):
(WebCore::PlaybackSessionModelMediaElement::defaultPlaybackRate const):
(WebCore::PlaybackSessionModelMediaElement::playbackRate const):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::rateChanged):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::rateChanged):
(VideoFullscreenControllerContext::setDefaultPlaybackRate):
(VideoFullscreenControllerContext::setPlaybackRate):
(VideoFullscreenControllerContext::isStalled const):
(VideoFullscreenControllerContext::defaultPlaybackRate const):
(VideoFullscreenControllerContext::playbackRate const):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
* platform/mac/VideoFullscreenInterfaceMac.h:
* platform/mac/VideoFullscreenInterfaceMac.mm:
(WebCore::VideoFullscreenInterfaceMac::rateChanged):

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::setDefaultPlaybackRate):
(WebKit::PlaybackSessionModelContext::setPlaybackRate):
(WebKit::PlaybackSessionModelContext::rateChanged):
(WebKit::PlaybackSessionManagerProxy::rateChanged):
(WebKit::PlaybackSessionManagerProxy::setDefaultPlaybackRate):
(WebKit::PlaybackSessionManagerProxy::setPlaybackRate):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::rateChanged):
(WebKit::PlaybackSessionManager::rateChanged):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h
trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm
trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h
trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm
trunk/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.h
trunk/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Scripts/webkit/messages.py
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h
trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm




Diff

Modified: 

[webkit-changes] [278958] trunk/Source/WebCore

2021-06-16 Thread peng . liu6
Title: [278958] trunk/Source/WebCore








Revision 278958
Author peng.l...@apple.com
Date 2021-06-16 15:22:06 -0700 (Wed, 16 Jun 2021)


Log Message
Some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
https://bugs.webkit.org/show_bug.cgi?id=226896

Reviewed by Darin Adler.

A follow-up patch to fix an issue in r278922. Remove the call to `contains()`
before `remove()` on a `WeakHashSet`.

* platform/audio/mac/SharedRoutingArbitrator.mm:
(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (278957 => 278958)

--- trunk/Source/WebCore/ChangeLog	2021-06-16 22:18:38 UTC (rev 278957)
+++ trunk/Source/WebCore/ChangeLog	2021-06-16 22:22:06 UTC (rev 278958)
@@ -1,3 +1,16 @@
+2021-06-16  Peng Liu  
+
+Some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
+https://bugs.webkit.org/show_bug.cgi?id=226896
+
+Reviewed by Darin Adler.
+
+A follow-up patch to fix an issue in r278922. Remove the call to `contains()`
+before `remove()` on a `WeakHashSet`.
+
+* platform/audio/mac/SharedRoutingArbitrator.mm:
+(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):
+
 2021-06-16  Chris Dumez  
 
 FileReader.readAsArrayBuffer misses checking for the type of blob param


Modified: trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm (278957 => 278958)

--- trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm	2021-06-16 22:18:38 UTC (rev 278957)
+++ trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm	2021-06-16 22:22:06 UTC (rev 278958)
@@ -120,8 +120,7 @@
 
 void SharedRoutingArbitrator::endRoutingArbitrationForToken(const Token& token)
 {
-if (m_tokens.contains(token))
-m_tokens.remove(token);
+m_tokens.remove(token);
 
 if (!m_tokens.computesEmpty())
 return;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278922] trunk/Source/WebCore

2021-06-15 Thread peng . liu6
Title: [278922] trunk/Source/WebCore








Revision 278922
Author peng.l...@apple.com
Date 2021-06-15 22:40:26 -0700 (Tue, 15 Jun 2021)


Log Message
some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
https://bugs.webkit.org/show_bug.cgi?id=226896

Reviewed by Eric Carlson.

When the `RoutingArbiter` fails to `-[beginArbitrationWithCategory:completionHandler:]`,
a token won't be added to `m_tokens`. Therefore, we should remove the assertion
in `SharedRoutingArbitrator::endRoutingArbitrationForToken()`.

* platform/audio/mac/SharedRoutingArbitrator.mm:
(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (278921 => 278922)

--- trunk/Source/WebCore/ChangeLog	2021-06-16 04:55:24 UTC (rev 278921)
+++ trunk/Source/WebCore/ChangeLog	2021-06-16 05:40:26 UTC (rev 278922)
@@ -1,3 +1,17 @@
+2021-06-15  Peng Liu  
+
+some http/tests/ are crashing with ASSERTION FAILED: isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing
+https://bugs.webkit.org/show_bug.cgi?id=226896
+
+Reviewed by Eric Carlson.
+
+When the `RoutingArbiter` fails to `-[beginArbitrationWithCategory:completionHandler:]`,
+a token won't be added to `m_tokens`. Therefore, we should remove the assertion
+in `SharedRoutingArbitrator::endRoutingArbitrationForToken()`.
+
+* platform/audio/mac/SharedRoutingArbitrator.mm:
+(WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken):
+
 2021-06-15  Alan Bujtas  
 
 Cleanup RenderElement::RendererCreationType


Modified: trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm (278921 => 278922)

--- trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm	2021-06-16 04:55:24 UTC (rev 278921)
+++ trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm	2021-06-16 05:40:26 UTC (rev 278922)
@@ -120,8 +120,8 @@
 
 void SharedRoutingArbitrator::endRoutingArbitrationForToken(const Token& token)
 {
-ASSERT(isInRoutingArbitrationForToken(token) || m_setupArbitrationOngoing);
-m_tokens.remove(token);
+if (m_tokens.contains(token))
+m_tokens.remove(token);
 
 if (!m_tokens.computesEmpty())
 return;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278811] trunk/Source/WebKit

2021-06-12 Thread peng . liu6
Title: [278811] trunk/Source/WebKit








Revision 278811
Author peng.l...@apple.com
Date 2021-06-12 10:37:25 -0700 (Sat, 12 Jun 2021)


Log Message
REGRESSION (r278374): [Big Sur] ASSERTION FAILED: !isInRoutingArbitrationForToken(token) in WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken()
https://bugs.webkit.org/show_bug.cgi?id=226787

Reviewed by Eric Carlson.

A WebContent process will resume a video element playback after the GPU process crashes
and restarts. During that process, the WebContent process will set category of the audio
session, and the UI process will be asked to begin routing arbitration with the new
category. However, the `SharedRoutingArbitrator` at the UI process will have stale
routing arbitrator tokens, which lead to the assertion failure.

To fix this issue, this patch cleans up the `SharedRoutingArbitrator` when the GPU
process crashes.

No new tests. Fix an API test:
- TestWebKitAPI.GPUProcess.CrashWhilePlayingVideo

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::gpuProcessExited):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (278810 => 278811)

--- trunk/Source/WebKit/ChangeLog	2021-06-12 17:17:27 UTC (rev 278810)
+++ trunk/Source/WebKit/ChangeLog	2021-06-12 17:37:25 UTC (rev 278811)
@@ -1,3 +1,25 @@
+2021-06-12  Peng Liu  
+
+REGRESSION (r278374): [Big Sur] ASSERTION FAILED: !isInRoutingArbitrationForToken(token) in WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken()
+https://bugs.webkit.org/show_bug.cgi?id=226787
+
+Reviewed by Eric Carlson.
+
+A WebContent process will resume a video element playback after the GPU process crashes
+and restarts. During that process, the WebContent process will set category of the audio
+session, and the UI process will be asked to begin routing arbitration with the new
+category. However, the `SharedRoutingArbitrator` at the UI process will have stale
+routing arbitrator tokens, which lead to the assertion failure.
+
+To fix this issue, this patch cleans up the `SharedRoutingArbitrator` when the GPU
+process crashes.
+
+No new tests. Fix an API test:
+- TestWebKitAPI.GPUProcess.CrashWhilePlayingVideo
+
+* UIProcess/WebProcessProxy.cpp:
+(WebKit::WebProcessProxy::gpuProcessExited):
+
 2021-06-11  Ryan Haddad  
 
 Unreviewed, reverting r278754.


Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (278810 => 278811)

--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-06-12 17:17:27 UTC (rev 278810)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-06-12 17:37:25 UTC (rev 278811)
@@ -790,6 +790,10 @@
 {
 for (auto& page : copyToVectorOf>(m_pageMap.values()))
 page->gpuProcessExited(reason);
+
+#if ENABLE(ROUTING_ARBITRATION)
+m_routingArbitrator->processDidTerminate();
+#endif
 }
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278784] trunk/Tools

2021-06-11 Thread peng . liu6
Title: [278784] trunk/Tools








Revision 278784
Author peng.l...@apple.com
Date 2021-06-11 15:18:23 -0700 (Fri, 11 Jun 2021)


Log Message
Fix the references to audio-buffer-size.html in project.pbxproj
https://bugs.webkit.org/show_bug.cgi?id=226932

Reviewed by Eric Carlson.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj




Diff

Modified: trunk/Tools/ChangeLog (278783 => 278784)

--- trunk/Tools/ChangeLog	2021-06-11 21:24:13 UTC (rev 278783)
+++ trunk/Tools/ChangeLog	2021-06-11 22:18:23 UTC (rev 278784)
@@ -1,3 +1,12 @@
+2021-06-11  Peng Liu  
+
+Fix the references to audio-buffer-size.html in project.pbxproj
+https://bugs.webkit.org/show_bug.cgi?id=226932
+
+Reviewed by Eric Carlson.
+
+* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+
 2021-06-11  Jonathan Bedard  
 
 [Monterey] Support building WebKit


Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (278783 => 278784)

--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2021-06-11 21:24:13 UTC (rev 278783)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2021-06-11 22:18:23 UTC (rev 278784)
@@ -49,7 +49,6 @@
 		04DB2396235E43EC00328F17 /* BumpPointerAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0451A5A6235E438E009DF945 /* BumpPointerAllocator.cpp */; };
 		0711DF52226A95FC003DD2F7 /* AVFoundationSoftLinkTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */; };
 		0713704A265320E500CA2C9A /* AudioBufferSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07137049265320E500CA2C9A /* AudioBufferSize.mm */; };
-		0713705526532E3900CA2C9A /* audio-buffer-size.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 0713705426532E3900CA2C9A /* audio-buffer-size.html */; };
 		07492B3B1DF8B14C00633DE1 /* EnumerateMediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */; };
 		07492B3C1DF8B86600633DE1 /* enumerateMediaDevices.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */; };
 		074994421EA5034B000DA44E /* getUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB5 /* getUserMedia.html */; };
@@ -1384,7 +1383,6 @@
 F42BD7D9245CC508001E207A /* attributedStringNewlineAtEndOfDocument.html in Copy Resources */,
 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */,
 37137E4B21124D01002BEEA4 /* AttrStyle.html in Copy Resources */,
-0713705526532E3900CA2C9A /* audio-buffer-size.html in Copy Resources */,
 46F03C1C255B2D5A00AA51C5 /* audio-context-playing.html in Copy Resources */,
 CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */,
 C944160021430E8900B1EDDA /* audio-with-controls.html in Copy Resources */,
@@ -1784,7 +1782,6 @@
 		0451A5A6235E438E009DF945 /* BumpPointerAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BumpPointerAllocator.cpp; sourceTree = ""; };
 		0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationSoftLinkTest.mm; sourceTree = ""; };
 		07137049265320E500CA2C9A /* AudioBufferSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioBufferSize.mm; sourceTree = ""; };
-		0713705426532E3900CA2C9A /* audio-buffer-size.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = "audio-buffer-size.html"; path = "Tests/WebKit/audio-buffer-size.html"; sourceTree = ""; };
 		0746645722FF62D000E3451A /* AccessibilityTestSupportProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilityTestSupportProtocol.h; sourceTree = ""; };
 		0746645822FF630500E3451A /* AccessibilityTestPlugin.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTestPlugin.mm; sourceTree = ""; };
 		07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = enumerateMediaDevices.html; sourceTree = ""; };
@@ -1886,6 +1883,7 @@
 		1CF59AE021E68925006E37EC /* ForceLightAppearanceInBundle_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ForceLightAppearanceInBundle_Bundle.mm; sourceTree = ""; };
 		1CF59AE421E696FB006E37EC /* dark-mode.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "dark-mode.html"; sourceTree = ""; };
 		1D12BEBF245BEF85004C0B7A /* ExitPiPOnSuspendVideoElement.mm */ = {isa = PBXFileReference; lastKnownFileType = 

[webkit-changes] [278663] trunk/Source/WebKit

2021-06-09 Thread peng . liu6
Title: [278663] trunk/Source/WebKit








Revision 278663
Author peng.l...@apple.com
Date 2021-06-09 09:33:46 -0700 (Wed, 09 Jun 2021)


Log Message
[iOS] UIDelegate::UIClient::fullscreenMayReturnToInline() is not called when a video exits fullscreen
https://bugs.webkit.org/show_bug.cgi?id=226785

Reviewed by Eric Carlson.

On iOS, `UIDelegate::UIClient::fullscreenMayReturnToInline()` is called when
a video exits picture-in-picture, but not when a video exits fullscreen.
This patch fixes that.

We cannot add a regression test for this patch before fixing webkit.org/b/212654.

* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (278662 => 278663)

--- trunk/Source/WebKit/ChangeLog	2021-06-09 16:31:25 UTC (rev 278662)
+++ trunk/Source/WebKit/ChangeLog	2021-06-09 16:33:46 UTC (rev 278663)
@@ -1,3 +1,19 @@
+2021-06-09  Peng Liu  
+
+[iOS] UIDelegate::UIClient::fullscreenMayReturnToInline() is not called when a video exits fullscreen
+https://bugs.webkit.org/show_bug.cgi?id=226785
+
+Reviewed by Eric Carlson.
+
+On iOS, `UIDelegate::UIClient::fullscreenMayReturnToInline()` is called when
+a video exits picture-in-picture, but not when a video exits fullscreen.
+This patch fixes that.
+
+We cannot add a regression test for this patch before fixing webkit.org/b/212654.
+
+* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
+
 2021-06-09  Diego Pino Garcia  
 
 [GTK] Do not depend on resources provided by the GNOME icon theme


Modified: trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (278662 => 278663)

--- trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm	2021-06-09 16:31:25 UTC (rev 278662)
+++ trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm	2021-06-09 16:33:46 UTC (rev 278663)
@@ -625,6 +625,9 @@
 #if !PLATFORM(IOS_FAMILY)
 IntRect finalWindowRect;
 m_page->rootViewToWindow(enclosingIntRect(finalRect), finalWindowRect);
+#else
+if (hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenModeStandard))
+m_page->fullscreenMayReturnToInline();
 #endif
 
 if (m_mockVideoPresentationModeEnabled) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278169] trunk

2021-05-27 Thread peng . liu6
Title: [278169] trunk








Revision 278169
Author peng.l...@apple.com
Date 2021-05-27 10:56:20 -0700 (Thu, 27 May 2021)


Log Message
Calling -[WKWebView _closeAllMediaPresentations] crashes
https://bugs.webkit.org/show_bug.cgi?id=226305

Reviewed by Chris Dumez.

Source/WebKit:

Provide an empty completion handler to fix a crash.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _closeAllMediaPresentations]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm:
(TEST):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (278168 => 278169)

--- trunk/Source/WebKit/ChangeLog	2021-05-27 17:54:13 UTC (rev 278168)
+++ trunk/Source/WebKit/ChangeLog	2021-05-27 17:56:20 UTC (rev 278169)
@@ -1,3 +1,15 @@
+2021-05-27  Peng Liu  
+
+Calling -[WKWebView _closeAllMediaPresentations] crashes
+https://bugs.webkit.org/show_bug.cgi?id=226305
+
+Reviewed by Chris Dumez.
+
+Provide an empty completion handler to fix a crash.
+
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView _closeAllMediaPresentations]):
+
 2021-05-27  Alexander Mikhaylenko  
 
 [GTK4] Navigation swipe snapshot always times out


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (278168 => 278169)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-05-27 17:54:13 UTC (rev 278168)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-05-27 17:56:20 UTC (rev 278169)
@@ -2241,7 +2241,7 @@
 - (void)_closeAllMediaPresentations
 {
 THROW_IF_SUSPENDED;
-[self closeAllMediaPresentationsWithCompletionHandler:nil];
+[self closeAllMediaPresentationsWithCompletionHandler:^{ }];
 }
 
 - (void)_stopMediaCapture


Modified: trunk/Tools/ChangeLog (278168 => 278169)

--- trunk/Tools/ChangeLog	2021-05-27 17:54:13 UTC (rev 278168)
+++ trunk/Tools/ChangeLog	2021-05-27 17:56:20 UTC (rev 278169)
@@ -1,3 +1,13 @@
+2021-05-27  Peng Liu  
+
+Calling -[WKWebView _closeAllMediaPresentations] crashes
+https://bugs.webkit.org/show_bug.cgi?id=226305
+
+Reviewed by Chris Dumez.
+
+* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm:
+(TEST):
+
 2021-05-27  Angelos Oikonomopoulos  
 
 [JSC] Implement high-level retry loop for run-jsc-stress-tests


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm (278168 => 278169)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm	2021-05-27 17:54:13 UTC (rev 278168)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm	2021-05-27 17:56:20 UTC (rev 278169)
@@ -70,7 +70,6 @@
 @"WebKit2Logging": @"Fullscreen=debug",
 }];
 
-
 auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES];
 [[configuration preferences] _setAllowsPictureInPictureMediaPlayback:YES];
 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration addToWindow:YES]);
@@ -86,6 +85,34 @@
 EXPECT_TRUE([webView _allMediaPresentationsClosed]);
 }
 
+TEST(WKWebViewCloseAllMediaPresentationsInternal, PictureInPicture)
+{
+if (!WebCore::supportsPictureInPicture())
+return;
+
+[[NSUserDefaults standardUserDefaults] registerDefaults:@{
+@"WebCoreLogging": @"Fullscreen=debug",
+@"WebKit2Logging": @"Fullscreen=debug",
+}];
+
+auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES];
+[[configuration preferences] _setAllowsPictureInPictureMediaPlayback:YES];
+auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration addToWindow:YES]);
+
+loadPictureInPicture(webView);
+
+[webView _closeAllMediaPresentations];
+
+do {
+if (![webView stringByEvaluatingJavaScript:@"window.internals.isChangingPresentationMode(document.querySelector('video'))"].boolValue)
+break;
+
+TestWebKitAPI::Util::sleep(0.5);
+} while (true);
+
+EXPECT_TRUE([webView _allMediaPresentationsClosed]);
+}
+
 #endif
 
 #if ENABLE(FULLSCREEN_API)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277886] trunk/Source/WebCore

2021-05-21 Thread peng . liu6
Title: [277886] trunk/Source/WebCore








Revision 277886
Author peng.l...@apple.com
Date 2021-05-21 14:12:21 -0700 (Fri, 21 May 2021)


Log Message
Video player enters a bad state after trying to enter picture-in-picture on YouTube.com videos
https://bugs.webkit.org/show_bug.cgi?id=226042

Reviewed by Daniel Bates.

The quirk `shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFull` was
always true. This patch fixes that.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Quirks.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (277885 => 277886)

--- trunk/Source/WebCore/ChangeLog	2021-05-21 21:04:43 UTC (rev 277885)
+++ trunk/Source/WebCore/ChangeLog	2021-05-21 21:12:21 UTC (rev 277886)
@@ -1,3 +1,16 @@
+2021-05-21  Peng Liu  
+
+Video player enters a bad state after trying to enter picture-in-picture on YouTube.com videos
+https://bugs.webkit.org/show_bug.cgi?id=226042
+
+Reviewed by Daniel Bates.
+
+The quirk `shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFull` was
+always true. This patch fixes that.
+
+* page/Quirks.cpp:
+(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):
+
 2021-05-21  Chris Dumez  
 
 Replace more static Locks with CheckedLocks in WTF / WebCore


Modified: trunk/Source/WebCore/page/Quirks.cpp (277885 => 277886)

--- trunk/Source/WebCore/page/Quirks.cpp	2021-05-21 21:04:43 UTC (rev 277885)
+++ trunk/Source/WebCore/page/Quirks.cpp	2021-05-21 21:12:21 UTC (rev 277886)
@@ -1425,10 +1425,9 @@
 
 if (!m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk) {
 auto host = m_document->topDocument().url().host();
-m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk = equalLettersIgnoringASCIICase(host, "trailers.apple.com");
+auto domain = RegistrableDomain(m_document->topDocument().url());
 
-auto domain = RegistrableDomain(m_document->topDocument().url());
-m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk = m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk || domain == "espn.com"_s;
+m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk = equalLettersIgnoringASCIICase(host, "trailers.apple.com") || domain == "espn.com"_s;
 }
 
 return *m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277789] trunk/Source/WebCore

2021-05-20 Thread peng . liu6
Title: [277789] trunk/Source/WebCore








Revision 277789
Author peng.l...@apple.com
Date 2021-05-20 09:13:29 -0700 (Thu, 20 May 2021)


Log Message
AirPlay icon of the Vimeo.com video player is missing after reloading the page
https://bugs.webkit.org/show_bug.cgi?id=226005

Reviewed by Eric Carlson.

Some sites, e.g., vimeo.com, depends on the "webkitplaybacktargetavailabilitychanged"
event to setup the player related to AirPlay feature properly. When we reload a
page including media element(s), the element's media session will be constructed
with `m_hasPlaybackTargets` be `true`, so no "webkitplaybacktargetavailabilitychanged"
event will be fired.

This patch ensures that an `HTMLMediaElement` always fires that event when we
reload the page.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/MediaElementSession.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (277788 => 277789)

--- trunk/Source/WebCore/ChangeLog	2021-05-20 16:12:49 UTC (rev 277788)
+++ trunk/Source/WebCore/ChangeLog	2021-05-20 16:13:29 UTC (rev 277789)
@@ -1,5 +1,24 @@
 2021-05-20  Peng Liu  
 
+AirPlay icon of the Vimeo.com video player is missing after reloading the page
+https://bugs.webkit.org/show_bug.cgi?id=226005
+
+Reviewed by Eric Carlson.
+
+Some sites, e.g., vimeo.com, depends on the "webkitplaybacktargetavailabilitychanged"
+event to setup the player related to AirPlay feature properly. When we reload a
+page including media element(s), the element's media session will be constructed
+with `m_hasPlaybackTargets` be `true`, so no "webkitplaybacktargetavailabilitychanged"
+event will be fired.
+
+This patch ensures that an `HTMLMediaElement` always fires that event when we
+reload the page.
+
+* html/MediaElementSession.cpp:
+(WebCore::MediaElementSession::MediaElementSession):
+
+2021-05-20  Peng Liu  
+
 AirPlay icon of the Vimeo.com video player is missing
 https://bugs.webkit.org/show_bug.cgi?id=226004
 


Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (277788 => 277789)

--- trunk/Source/WebCore/html/MediaElementSession.cpp	2021-05-20 16:12:49 UTC (rev 277788)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp	2021-05-20 16:13:29 UTC (rev 277789)
@@ -162,7 +162,6 @@
 , m_restrictions(NoRestrictions)
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 , m_targetAvailabilityChangedTimer(*this, ::targetAvailabilityChangedTimerFired)
-, m_hasPlaybackTargets(manager().hasWirelessTargetsAvailable())
 #endif
 , m_mainContentCheckTimer(*this, ::mainContentCheckTimerFired)
 , m_clientDataBufferingTimer(*this, ::clientDataBufferingTimerFired)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277788] trunk/Source/WebCore

2021-05-20 Thread peng . liu6
Title: [277788] trunk/Source/WebCore








Revision 277788
Author peng.l...@apple.com
Date 2021-05-20 09:12:49 -0700 (Thu, 20 May 2021)


Log Message
AirPlay icon of the Vimeo.com video player is missing
https://bugs.webkit.org/show_bug.cgi?id=226004

Reviewed by Eric Carlson.

With the optimizations in r276883, an `HTMLMediaElement` will activate its
`MediaSession` just before creating its `MediaPlayer` inside `prepareForLoad()`
or `loadNextSourceChild()`, and will deactivate its `MediaSession` after tearing
down its `MediaPlayer` inside `mediaLoadingFailed()`.

However, with these changes, when a new `HTMLMediaElement` is created and an
event handler of "webkitplaybacktargetavailabilitychanged" is added to the element,
the element's `MediaSession` might be inactive when function
`MediaSessionManageriOS::configureWireLessTargetMonitoring()` runs, so its
`MediaSession` won't monitor wireless routes, and no "webkitplaybacktargetavailabilitychanged"
will be fired thereafter.

This patch fixes this issue by activating an `HTMLMediaElement`'s `MediaSession`
when adding the first event handler to "webkitplaybacktargetavailabilitychanged" event.
It also keeps the `MediaSession` active if there is event handler to
"webkitplaybacktargetavailabilitychanged" after tearing down the `HTMLMediaElement`'s
`MediaPlayer` (in `HTMLMediaElement::mediaLoadingFailed()`).

We can improve the fix by refactoring the way to activate/deactivate
an `HTMLMediaElement`'s `MediaSession`.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::loadNextSourceChild):
(WebCore::HTMLMediaElement::mediaLoadingFailed):
(WebCore::HTMLMediaElement::addEventListener):
(WebCore::HTMLMediaElement::createMediaPlayer):
Replace two `mediaSession().setActive(true);` in `prepareForLoad()`
and `loadNextSourceChild()` with one in `createMediaPlayer()`.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (277787 => 277788)

--- trunk/Source/WebCore/ChangeLog	2021-05-20 16:11:24 UTC (rev 277787)
+++ trunk/Source/WebCore/ChangeLog	2021-05-20 16:12:49 UTC (rev 277788)
@@ -1,3 +1,40 @@
+2021-05-20  Peng Liu  
+
+AirPlay icon of the Vimeo.com video player is missing
+https://bugs.webkit.org/show_bug.cgi?id=226004
+
+Reviewed by Eric Carlson.
+
+With the optimizations in r276883, an `HTMLMediaElement` will activate its
+`MediaSession` just before creating its `MediaPlayer` inside `prepareForLoad()`
+or `loadNextSourceChild()`, and will deactivate its `MediaSession` after tearing
+down its `MediaPlayer` inside `mediaLoadingFailed()`.
+
+However, with these changes, when a new `HTMLMediaElement` is created and an
+event handler of "webkitplaybacktargetavailabilitychanged" is added to the element,
+the element's `MediaSession` might be inactive when function
+`MediaSessionManageriOS::configureWireLessTargetMonitoring()` runs, so its
+`MediaSession` won't monitor wireless routes, and no "webkitplaybacktargetavailabilitychanged"
+will be fired thereafter.
+
+This patch fixes this issue by activating an `HTMLMediaElement`'s `MediaSession`
+when adding the first event handler to "webkitplaybacktargetavailabilitychanged" event.
+It also keeps the `MediaSession` active if there is event handler to
+"webkitplaybacktargetavailabilitychanged" after tearing down the `HTMLMediaElement`'s
+`MediaPlayer` (in `HTMLMediaElement::mediaLoadingFailed()`).
+
+We can improve the fix by refactoring the way to activate/deactivate
+an `HTMLMediaElement`'s `MediaSession`.
+
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::prepareForLoad):
+(WebCore::HTMLMediaElement::loadNextSourceChild):
+(WebCore::HTMLMediaElement::mediaLoadingFailed):
+(WebCore::HTMLMediaElement::addEventListener):
+(WebCore::HTMLMediaElement::createMediaPlayer):
+Replace two `mediaSession().setActive(true);` in `prepareForLoad()`
+and `loadNextSourceChild()` with one in `createMediaPlayer()`.
+
 2021-05-20  Jer Noble  
 
 CRASH: Null-pointer deref in MediaSessionManagerCocoa::setNowPlayingInfo()


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (277787 => 277788)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-05-20 16:11:24 UTC (rev 277787)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-05-20 16:12:49 UTC (rev 277788)
@@ -1137,7 +1137,6 @@
 if (!document().hasBrowsingContext())
 return;
 
-mediaSession().setActive(true);
 createMediaPlayer();
 
 // 2 - Let pending tasks be a list of all tasks from the media element's media element event task source in one of the task queues.
@@ -1424,8 +1423,6 @@
 return;
 }
 
-mediaSession().setActive(true);
-
 // Recreate the media 

[webkit-changes] [277766] trunk/Source/WebCore

2021-05-19 Thread peng . liu6
Title: [277766] trunk/Source/WebCore








Revision 277766
Author peng.l...@apple.com
Date 2021-05-19 17:30:46 -0700 (Wed, 19 May 2021)


Log Message
[iOS] Video playback pauses when switching apps (video enters picture-in-picture from fullscreen)
https://bugs.webkit.org/show_bug.cgi?id=225981

Reviewed by Jer Noble.

Similar to Mac, on iOS devices, we should not pause a video playback
when the video enters picture-in-picture from fullscreen.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (277765 => 277766)

--- trunk/Source/WebCore/ChangeLog	2021-05-20 00:25:44 UTC (rev 277765)
+++ trunk/Source/WebCore/ChangeLog	2021-05-20 00:30:46 UTC (rev 277766)
@@ -1,3 +1,16 @@
+2021-05-19  Peng Liu  
+
+[iOS] Video playback pauses when switching apps (video enters picture-in-picture from fullscreen)
+https://bugs.webkit.org/show_bug.cgi?id=225981
+
+Reviewed by Jer Noble.
+
+Similar to Mac, on iOS devices, we should not pause a video playback
+when the video enters picture-in-picture from fullscreen.
+
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
+
 2021-05-19  Sam Weinig  
 
 Remove ImageBuffer::toBGRA() and replace its uses with the more general ImageBuffer::getPixelBuffer()


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (277765 => 277766)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-05-20 00:25:44 UTC (rev 277765)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-05-20 00:30:46 UTC (rev 277766)
@@ -7694,7 +7694,7 @@
 }
 if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture)
 return true;
-#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+#if PLATFORM(COCOA) && ENABLE(VIDEO_PRESENTATION_MODE)
 if (((m_videoFullscreenMode == VideoFullscreenModeStandard) || m_videoFullscreenStandby) && supportsPictureInPicture() && isPlaying())
 return true;
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277584] trunk/Source

2021-05-17 Thread peng . liu6
Title: [277584] trunk/Source








Revision 277584
Author peng.l...@apple.com
Date 2021-05-17 09:31:39 -0700 (Mon, 17 May 2021)


Log Message
[GPUP] WebContent process should not pull audio session category from the GPU Process
https://bugs.webkit.org/show_bug.cgi?id=225826

Reviewed by Darin Adler.

Source/WebCore:

Change AudioSession::Category to be an enum class.

* platform/audio/AudioSession.cpp:
(WebCore::AudioSession::categoryOverride const):
(WebCore::AudioSession::category const):
* platform/audio/AudioSession.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateSessionState):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSessionPrivate::AudioSessionPrivate):
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::category const):
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSession::setCategory):
* platform/audio/mac/SharedRoutingArbitrator.h:
* platform/audio/mac/SharedRoutingArbitrator.mm:
(WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken):
* platform/mediastream/mac/BaseAudioSharedUnit.cpp:
(WebCore::BaseAudioSharedUnit::startUnit):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
* testing/Internals.cpp:
(WebCore::Internals::audioSessionCategory const):

Source/WebKit:

Remove `category` and `routeSharingPolicy` from `RemoteAudioSessionConfiguration`
because we should not pull these properties from the GPU process.

Remove IPC message `RemoteAudioSession::ConfigurationChanged` because it is not used.

* GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h:
* GPUProcess/media/RemoteAudioSessionProxy.cpp:
(WebKit::RemoteAudioSessionProxy::configuration):
* GPUProcess/media/RemoteAudioSessionProxy.h:

* GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::categoryCanMixWithOthers):
(WebKit::RemoteAudioSessionProxyManager::updateCategory):

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:

* UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:

* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setCategory):
(WebKit::RemoteAudioSession::category const):
(WebKit::RemoteAudioSession::configurationChanged): Deleted.
* WebProcess/GPU/media/RemoteAudioSession.h:
* WebProcess/GPU/media/RemoteAudioSession.messages.in:

* WebProcess/GPU/media/RemoteAudioSessionConfiguration.h:
(WebKit::RemoteAudioSessionConfiguration::encode const):
(WebKit::RemoteAudioSessionConfiguration::decode):

* WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp:

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences setAudioSessionCategoryOverride:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/DeprecatedGlobalSettings.cpp
trunk/Source/WebCore/platform/audio/AudioSession.cpp
trunk/Source/WebCore/platform/audio/AudioSession.h
trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm
trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.mm
trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.h
trunk/Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm
trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp
trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp
trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
trunk/Source/WebKit/UIProcess/Media/AudioSessionRoutingArbitratorProxy.h
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSessionConfiguration.h
trunk/Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm
trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (277583 => 277584)

--- trunk/Source/WebCore/ChangeLog	2021-05-17 16:31:31 UTC (rev 277583)
+++ trunk/Source/WebCore/ChangeLog	2021-05-17 16:31:39 UTC (rev 277584)
@@ -1,3 +1,34 @@
+2021-05-17  Peng Liu  
+
+[GPUP] WebContent process should not pull audio session category from the GPU Process
+https://bugs.webkit.org/show_bug.cgi?id=225826
+
+Reviewed by Darin Adler.
+
+Change AudioSession::Category to be an enum class.
+
+* platform/audio/AudioSession.cpp:
+(WebCore::AudioSession::categoryOverride const):
+ 

[webkit-changes] [277519] trunk

2021-05-14 Thread peng . liu6
Title: [277519] trunk








Revision 277519
Author peng.l...@apple.com
Date 2021-05-14 16:46:10 -0700 (Fri, 14 May 2021)


Log Message
REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=221985

Reviewed by Eric Carlson.

Source/WebCore:

When `MediaSessionManagerCocoa::updateSessionState()` goes through all sessions, it
counts all WebAudio sessions regardless their states, and it may set the shared audio
session's category to be `AudioSession::AmbientSound` if the count of WebAudio sessions
is not zero.

However, when we close a page with WebAudio, we should not count the WebAudio session
here because the corresponding AudioContext is suspended and will be destroyed soon.
Without this patch, the shared audio session's category might be `AudioSession::AmbientSound`
after we close the WebAudio page.

* Modules/webaudio/AudioContext.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac-wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/webaudio/AudioContext.h




Diff

Modified: trunk/LayoutTests/ChangeLog (277518 => 277519)

--- trunk/LayoutTests/ChangeLog	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/LayoutTests/ChangeLog	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1,3 +1,12 @@
+2021-05-14  Peng Liu  
+
+REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
+https://bugs.webkit.org/show_bug.cgi?id=221985
+
+Reviewed by Eric Carlson.
+
+* platform/mac-wk2/TestExpectations:
+
 2021-05-14  Robert Jenner  
 
 [ iOS14-Simulator ] wk2imported/w3c/web-platform-tests/css/css-will-change/will-change-transform-huge-offset-scrolled.html is a flaky ImageOnlyFailure


Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (277518 => 277519)

--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1353,8 +1353,6 @@
 webrtc/peerconnection-new-candidate-page-cache.html [ Pass Crash ]
 http/tests/navigation/page-cache-mediastream.html [ Pass Crash ]
 
-webkit.org/b/221985 fast/mediastream/audio-track-enabled.html [ Pass Failure ]
-
 webkit.org/b/224633 media/presentationmodechanged-fired-once.html [ Pass Timeout ]
 
 webkit.org/b/224690 compositing/video/video-border-radius-clipping.html [ Pass ImageOnlyFailure ]


Modified: trunk/Source/WebCore/ChangeLog (277518 => 277519)

--- trunk/Source/WebCore/ChangeLog	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/Source/WebCore/ChangeLog	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1,3 +1,22 @@
+2021-05-14  Peng Liu  
+
+REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
+https://bugs.webkit.org/show_bug.cgi?id=221985
+
+Reviewed by Eric Carlson.
+
+When `MediaSessionManagerCocoa::updateSessionState()` goes through all sessions, it
+counts all WebAudio sessions regardless their states, and it may set the shared audio
+session's category to be `AudioSession::AmbientSound` if the count of WebAudio sessions
+is not zero.
+
+However, when we close a page with WebAudio, we should not count the WebAudio session
+here because the corresponding AudioContext is suspended and will be destroyed soon.
+Without this patch, the shared audio session's category might be `AudioSession::AmbientSound`
+after we close the WebAudio page.
+
+* Modules/webaudio/AudioContext.h:
+
 2021-05-14  Alan Bujtas  
 
 [showRenderTree] Do not integral floor the overflow values


Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (277518 => 277519)

--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h	2021-05-14 23:46:10 UTC (rev 277519)
@@ -111,7 +111,7 @@
 void pageMutedStateDidChange() override;
 
 // PlatformMediaSessionClient
-PlatformMediaSession::MediaType mediaType() const override { return PlatformMediaSession::MediaType::WebAudio; }
+PlatformMediaSession::MediaType mediaType() const override { return isSuspended() ? PlatformMediaSession::MediaType::None : PlatformMediaSession::MediaType::WebAudio; }
 PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::MediaType::WebAudio; }
 void mayResumePlayback(bool shouldResume) override;
 void suspendPlayback() override;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277433] trunk/Source/WebKit

2021-05-13 Thread peng . liu6
Title: [277433] trunk/Source/WebKit








Revision 277433
Author peng.l...@apple.com
Date 2021-05-13 07:12:22 -0700 (Thu, 13 May 2021)


Log Message
Subtitles in Safari fail to appear after switching language
https://bugs.webkit.org/show_bug.cgi?id=225738

Reviewed by Jer Noble.

`TextTrackPrivateRemote::setMode()` calls `InbandTextTrackPrivate::setMode()`, but
it does not set the value of `TextTrackPrivateRemote::mode` properly. Therefore,
`TextTrackPrivateRemote::mode` will always be `Disabled`. When we switch text track
in the WebContent process side, we will only send the IPC message `TextTrackSetMode`
to `RemoteMediaPlayerProxy` in the GPU process to change the mode from `Disabled`
to `Showing`, but cannot change its value back to `Disabled`. When a user keeps
switching text track, all text tracks in the GPU process will become `Showing`,
and `MediaPlayerPrivateAVFoundation` cannot deal with that. As a result,
the WebContent process won't get the correct subtitles from the GPU process.
`cueFormat()` has the similar issue, it does not impact the functionality though.

Actually, `TextTrackPrivateRemote` can simply use the implementations of its
base class `InbandTextTrackPrivate` regarding mode and cue format.

In addition, `TextTrackPrivateRemote` does not need to get the "mode" value from
`RemoteTextTrackProxy` in the GPU process. So this patch removes the `mode` attribute
of `TextTrackPrivateRemoteConfiguration`.

* GPUProcess/media/RemoteTextTrackProxy.cpp:
(WebKit::RemoteTextTrackProxy::configuration):
* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
(WebKit::TextTrackPrivateRemoteConfiguration::decode):
* WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
(WebKit::TextTrackPrivateRemote::setMode):
(WebKit::TextTrackPrivateRemote::updateConfiguration):
* WebProcess/GPU/media/TextTrackPrivateRemote.h:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp
trunk/Source/WebKit/GPUProcess/media/TextTrackPrivateRemoteConfiguration.h
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h




Diff

Modified: trunk/Source/WebKit/ChangeLog (277432 => 277433)

--- trunk/Source/WebKit/ChangeLog	2021-05-13 13:54:43 UTC (rev 277432)
+++ trunk/Source/WebKit/ChangeLog	2021-05-13 14:12:22 UTC (rev 277433)
@@ -1,3 +1,38 @@
+2021-05-13  Peng Liu  
+
+Subtitles in Safari fail to appear after switching language
+https://bugs.webkit.org/show_bug.cgi?id=225738
+
+Reviewed by Jer Noble.
+
+`TextTrackPrivateRemote::setMode()` calls `InbandTextTrackPrivate::setMode()`, but
+it does not set the value of `TextTrackPrivateRemote::mode` properly. Therefore,
+`TextTrackPrivateRemote::mode` will always be `Disabled`. When we switch text track
+in the WebContent process side, we will only send the IPC message `TextTrackSetMode`
+to `RemoteMediaPlayerProxy` in the GPU process to change the mode from `Disabled`
+to `Showing`, but cannot change its value back to `Disabled`. When a user keeps
+switching text track, all text tracks in the GPU process will become `Showing`,
+and `MediaPlayerPrivateAVFoundation` cannot deal with that. As a result,
+the WebContent process won't get the correct subtitles from the GPU process.
+`cueFormat()` has the similar issue, it does not impact the functionality though.
+
+Actually, `TextTrackPrivateRemote` can simply use the implementations of its
+base class `InbandTextTrackPrivate` regarding mode and cue format.
+
+In addition, `TextTrackPrivateRemote` does not need to get the "mode" value from
+`RemoteTextTrackProxy` in the GPU process. So this patch removes the `mode` attribute
+of `TextTrackPrivateRemoteConfiguration`.
+
+* GPUProcess/media/RemoteTextTrackProxy.cpp:
+(WebKit::RemoteTextTrackProxy::configuration):
+* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
+(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
+(WebKit::TextTrackPrivateRemoteConfiguration::decode):
+* WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
+(WebKit::TextTrackPrivateRemote::setMode):
+(WebKit::TextTrackPrivateRemote::updateConfiguration):
+* WebProcess/GPU/media/TextTrackPrivateRemote.h:
+
 2021-05-13  Carlos Garcia Campos  
 
 REGRESSION(r277262): test imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html is crashing


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp (277432 => 277433)

--- trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-05-13 13:54:43 UTC (rev 277432)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-05-13 14:12:22 UTC (rev 277433)
@@ -69,7 +69,6 @@
 

[webkit-changes] [277424] trunk/Source/WebCore

2021-05-12 Thread peng . liu6
Title: [277424] trunk/Source/WebCore








Revision 277424
Author peng.l...@apple.com
Date 2021-05-12 22:37:17 -0700 (Wed, 12 May 2021)


Log Message
[iPad] SourceBufferPrivateAVFObjC should not report an error to the web page when the video playback is interrupted
https://bugs.webkit.org/show_bug.cgi?id=225620

Reviewed by Jer Noble.

If `SourceBufferPrivateAVFObjC` reports an error to a web page when
`AVSampleBufferDisplayLayer` reports `AVErrorOperationInterrupted` (the playback
was interrupted), the web page will likely destroy the video player (and teardown
the video element). That behavior will lead to an empty picture-in-picture window
if the video was playing in picture-in-picture.

With this patch, `SourceBufferPrivateAVFObjC` will not report an error to the
web page in case of playback interruption. Instead, it takes a note that
the playback was interrupted, so that when we try to resume the playback later,
it will flush the `AVSampleBufferDisplayLayer` to recover the playback state.

In addition, we need to enqueue an IDR frame first before we enqueue more
samples after flushing the `AVSampleBufferDisplayLayer`. That is guaranteed
by `SourceBufferPrivate::reenqueSamples()`.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::flushActiveSourceBuffersIfNeeded):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flushIfNeeded):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm
trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (277423 => 277424)

--- trunk/Source/WebCore/ChangeLog	2021-05-13 05:36:57 UTC (rev 277423)
+++ trunk/Source/WebCore/ChangeLog	2021-05-13 05:37:17 UTC (rev 277424)
@@ -1,3 +1,36 @@
+2021-05-12  Peng Liu  
+
+[iPad] SourceBufferPrivateAVFObjC should not report an error to the web page when the video playback is interrupted
+https://bugs.webkit.org/show_bug.cgi?id=225620
+
+Reviewed by Jer Noble.
+
+If `SourceBufferPrivateAVFObjC` reports an error to a web page when
+`AVSampleBufferDisplayLayer` reports `AVErrorOperationInterrupted` (the playback
+was interrupted), the web page will likely destroy the video player (and teardown
+the video element). That behavior will lead to an empty picture-in-picture window
+if the video was playing in picture-in-picture.
+
+With this patch, `SourceBufferPrivateAVFObjC` will not report an error to the
+web page in case of playback interruption. Instead, it takes a note that
+the playback was interrupted, so that when we try to resume the playback later,
+it will flush the `AVSampleBufferDisplayLayer` to recover the playback state.
+
+In addition, we need to enqueue an IDR frame first before we enqueue more
+samples after flushing the `AVSampleBufferDisplayLayer`. That is guaranteed
+by `SourceBufferPrivate::reenqueSamples()`.
+
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
+* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+(WebCore::MediaSourcePrivateAVFObjC::flushActiveSourceBuffersIfNeeded):
+* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+(WebCore::SourceBufferPrivateAVFObjC::flushIfNeeded):
+(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
+(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
+
 2021-05-12  Chris Dumez  
 
 Notification.requestPermission() should return a Promise


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (277423 => 277424)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2021-05-13 05:36:57 UTC (rev 277423)
+++ 

[webkit-changes] [277372] trunk/Source

2021-05-12 Thread peng . liu6
Title: [277372] trunk/Source








Revision 277372
Author peng.l...@apple.com
Date 2021-05-12 09:59:44 -0700 (Wed, 12 May 2021)


Log Message
Implement TextTrackPrivateRemote::inBandMetadataTrackDispatchType()
https://bugs.webkit.org/show_bug.cgi?id=225674

Reviewed by Eric Carlson.

Source/WebCore:

Remove an unused function in `InbandTextTrackPrivate`.

* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::textTrackIndex const): Deleted.

Source/WebKit:

This patch ensures that `InbandTextTrack::inBandMetadataTrackDispatchType()`
behaviors the same no matter "Media in GPU Process" is enabled or not.

* GPUProcess/media/RemoteTextTrackProxy.cpp:
(WebKit::RemoteTextTrackProxy::configuration):
* WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
(WebKit::TextTrackPrivateRemote::updateConfiguration):
* WebProcess/GPU/media/TextTrackPrivateRemote.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (277371 => 277372)

--- trunk/Source/WebCore/ChangeLog	2021-05-12 15:59:48 UTC (rev 277371)
+++ trunk/Source/WebCore/ChangeLog	2021-05-12 16:59:44 UTC (rev 277372)
@@ -1,3 +1,15 @@
+2021-05-12  Peng Liu  
+
+Implement TextTrackPrivateRemote::inBandMetadataTrackDispatchType()
+https://bugs.webkit.org/show_bug.cgi?id=225674
+
+Reviewed by Eric Carlson.
+
+Remove an unused function in `InbandTextTrackPrivate`.
+
+* platform/graphics/InbandTextTrackPrivate.h:
+(WebCore::InbandTextTrackPrivate::textTrackIndex const): Deleted.
+
 2021-05-12  Sergio Villar Senin  
 
 [css-flexbox] Do not use margins when computing aspect ratio cross sizes


Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h (277371 => 277372)

--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2021-05-12 15:59:48 UTC (rev 277371)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2021-05-12 16:59:44 UTC (rev 277372)
@@ -74,8 +74,6 @@
 AtomString id() const override { return emptyAtom(); }
 virtual AtomString inBandMetadataTrackDispatchType() const { return emptyAtom(); }
 
-virtual int textTrackIndex() const { return 0; }
-
 virtual CueFormat cueFormat() const { return m_format; }
 
 #if !RELEASE_LOG_DISABLED


Modified: trunk/Source/WebKit/ChangeLog (277371 => 277372)

--- trunk/Source/WebKit/ChangeLog	2021-05-12 15:59:48 UTC (rev 277371)
+++ trunk/Source/WebKit/ChangeLog	2021-05-12 16:59:44 UTC (rev 277372)
@@ -1,3 +1,19 @@
+2021-05-12  Peng Liu  
+
+Implement TextTrackPrivateRemote::inBandMetadataTrackDispatchType()
+https://bugs.webkit.org/show_bug.cgi?id=225674
+
+Reviewed by Eric Carlson.
+
+This patch ensures that `InbandTextTrack::inBandMetadataTrackDispatchType()`
+behaviors the same no matter "Media in GPU Process" is enabled or not.
+
+* GPUProcess/media/RemoteTextTrackProxy.cpp:
+(WebKit::RemoteTextTrackProxy::configuration):
+* WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
+(WebKit::TextTrackPrivateRemote::updateConfiguration):
+* WebProcess/GPU/media/TextTrackPrivateRemote.h:
+
 2021-05-12  Youenn Fablet  
 
 Introduce an internal unit to render audio MediaStreamTrack(s)


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp (277371 => 277372)

--- trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-05-12 15:59:48 UTC (rev 277371)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-05-12 16:59:44 UTC (rev 277372)
@@ -65,6 +65,7 @@
 configuration->label = m_trackPrivate->label();
 configuration->language = m_trackPrivate->language();
 configuration->trackIndex = m_trackPrivate->trackIndex();
+configuration->inBandMetadataTrackDispatchType = m_trackPrivate->inBandMetadataTrackDispatchType();
 configuration->startTimeVariance = m_trackPrivate->startTimeVariance();
 
 configuration->cueFormat = m_trackPrivate->cueFormat();


Modified: trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp (277371 => 277372)

--- trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp	2021-05-12 15:59:48 UTC (rev 277371)
+++ trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp	2021-05-12 16:59:44 UTC (rev 277372)
@@ -81,6 +81,7 @@
 }
 
 m_trackIndex = configuration.trackIndex;
+m_inBandMetadataTrackDispatchType = configuration.inBandMetadataTrackDispatchType;
 m_startTimeVariance = configuration.startTimeVariance;
 
 m_format = configuration.cueFormat;


Modified: trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h (277371 => 277372)

--- 

[webkit-changes] [277242] trunk/Source

2021-05-08 Thread peng . liu6
Title: [277242] trunk/Source








Revision 277242
Author peng.l...@apple.com
Date 2021-05-08 21:53:33 -0700 (Sat, 08 May 2021)


Log Message
[GPUP] A small video element enters fullscreen with strange animations
https://bugs.webkit.org/show_bug.cgi?id=225548

Reviewed by Eric Carlson.

Use `FloatRect` instead of `IntRect` to exchange video element location/size
information between WebContent processes and the UI process to avoid information
mismatch due to floating-point rounding.

Source/WebCore:

Manually tested.

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToReturnToInline):
(VideoFullscreenInterfaceAVKit::setInlineRect):

Source/WebKit:

Deal with the video element resizing differently for two cases:
1) Video is playing in the inline mode.
2) Video is entering fullscreen/picture-in-picture.
For the latter case, `-[WKVideoLayerRemote layoutSublayers]` will scale the layer
with the same factor in both X and Y direction.

* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::setVideoInlineSizeIfPossible):
(WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced):

* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
(WebKit::VideoFullscreenManagerProxy::setInlineRect):
(WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::setVideoInlineSizeFenced):
(WebKit::MediaPlayerPrivateRemote::inVideoFullscreenOrPictureInPicture const):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm:
(-[WKVideoLayerRemote layoutSublayers]):
(-[WKVideoLayerRemote resolveBounds]):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::inlineVideoFrame):
(WebKit::VideoFullscreenManager::requestUpdateInlineRect):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
trunk/Source/WebKit/WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (277241 => 277242)

--- trunk/Source/WebCore/ChangeLog	2021-05-09 04:31:43 UTC (rev 277241)
+++ trunk/Source/WebCore/ChangeLog	2021-05-09 04:53:33 UTC (rev 277242)
@@ -1,3 +1,23 @@
+2021-05-08  Peng Liu  
+
+[GPUP] A small video element enters fullscreen with strange animations
+https://bugs.webkit.org/show_bug.cgi?id=225548
+
+Reviewed by Eric Carlson.
+
+Use `FloatRect` instead of `IntRect` to exchange video element location/size
+information between WebContent processes and the UI process to avoid information
+mismatch due to floating-point rounding.
+
+Manually tested.
+
+* platform/ios/VideoFullscreenInterfaceAVKit.h:
+* platform/ios/VideoFullscreenInterfaceAVKit.mm:
+(VideoFullscreenInterfaceAVKit::setupFullscreen):
+(VideoFullscreenInterfaceAVKit::exitFullscreen):
+(VideoFullscreenInterfaceAVKit::preparedToReturnToInline):
+(VideoFullscreenInterfaceAVKit::setInlineRect):
+
 2021-05-08  Sam Weinig  
 
 Factor out pixel buffer from DOM specific ImageData class


Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (277241 => 277242)

--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-05-09 04:31:43 UTC (rev 277241)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-05-09 04:53:33 UTC (rev 277242)
@@ -54,7 +54,7 @@
 OBJC_CLASS NSError;
 
 namespace WebCore {
-class IntRect;
+class FloatRect;
 class FloatSize;
 class VideoFullscreenModel;
 class VideoFullscreenChangeObserver;
@@ -80,16 +80,16 @@
 // PlaybackSessionModelClient
 WEBCORE_EXPORT void externalPlaybackChanged(bool enabled, 

[webkit-changes] [277003] trunk/Source

2021-05-04 Thread peng . liu6
Title: [277003] trunk/Source








Revision 277003
Author peng.l...@apple.com
Date 2021-05-04 22:41:30 -0700 (Tue, 04 May 2021)


Log Message
[GPUP] Implement SourceBufferPrivateRemote::bufferFull()
https://bugs.webkit.org/show_bug.cgi?id=224139

Reviewed by Jer Noble.

Source/WebCore:

* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::setBufferFull): This function will be used
by `SourceBufferPrivateRemote::evictCodedFrames()` and `SourceBufferPrivateRemote::reenqueueMediaIfNeeded()`.

Source/WebKit:

Modify two IPC messages to implement `SourceBufferPrivateRemote::bufferFull()`.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::evictCodedFrames):
(WebKit::RemoteSourceBufferProxy::reenqueueMediaIfNeeded):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:

* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::evictCodedFrames):
(WebKit::SourceBufferPrivateRemote::reenqueueMediaIfNeeded):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (277002 => 277003)

--- trunk/Source/WebCore/ChangeLog	2021-05-05 05:38:21 UTC (rev 277002)
+++ trunk/Source/WebCore/ChangeLog	2021-05-05 05:41:30 UTC (rev 277003)
@@ -1,3 +1,14 @@
+2021-05-04  Peng Liu  
+
+[GPUP] Implement SourceBufferPrivateRemote::bufferFull()
+https://bugs.webkit.org/show_bug.cgi?id=224139
+
+Reviewed by Jer Noble.
+
+* platform/graphics/SourceBufferPrivate.h:
+(WebCore::SourceBufferPrivate::setBufferFull): This function will be used
+by `SourceBufferPrivateRemote::evictCodedFrames()` and `SourceBufferPrivateRemote::reenqueueMediaIfNeeded()`.
+
 2021-05-04  Antti Koivisto  
 
 REGRESSION(iOS 14): Author shadow DOM invalidated unnecessarily on pseudo element change


Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h (277002 => 277003)

--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h	2021-05-05 05:38:21 UTC (rev 277002)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h	2021-05-05 05:41:30 UTC (rev 277003)
@@ -166,6 +166,7 @@
 WEBCORE_EXPORT void didReceiveInitializationSegment(SourceBufferPrivateClient::InitializationSegment&&, CompletionHandler&&);
 WEBCORE_EXPORT void didReceiveSample(Ref&&);
 WEBCORE_EXPORT void setBufferedRanges(const PlatformTimeRanges&);
+void setBufferFull(bool bufferFull) { m_bufferFull = bufferFull; }
 void provideMediaData(const AtomString& trackID);
 uint64_t totalTrackBufferSizeInBytes() const;
 


Modified: trunk/Source/WebKit/ChangeLog (277002 => 277003)

--- trunk/Source/WebKit/ChangeLog	2021-05-05 05:38:21 UTC (rev 277002)
+++ trunk/Source/WebKit/ChangeLog	2021-05-05 05:41:30 UTC (rev 277003)
@@ -1,3 +1,22 @@
+2021-05-04  Peng Liu  
+
+[GPUP] Implement SourceBufferPrivateRemote::bufferFull()
+https://bugs.webkit.org/show_bug.cgi?id=224139
+
+Reviewed by Jer Noble.
+
+Modify two IPC messages to implement `SourceBufferPrivateRemote::bufferFull()`.
+
+* GPUProcess/media/RemoteSourceBufferProxy.cpp:
+(WebKit::RemoteSourceBufferProxy::evictCodedFrames):
+(WebKit::RemoteSourceBufferProxy::reenqueueMediaIfNeeded):
+* GPUProcess/media/RemoteSourceBufferProxy.h:
+* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
+
+* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
+(WebKit::SourceBufferPrivateRemote::evictCodedFrames):
+(WebKit::SourceBufferPrivateRemote::reenqueueMediaIfNeeded):
+
 2021-05-04  Jiewen Tan  
 
 PCM: Find a way to validate source_secret_token and source_secret_token_signature


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp (277002 => 277003)

--- trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp	2021-05-05 05:38:21 UTC (rev 277002)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp	2021-05-05 05:41:30 UTC (rev 277003)
@@ -257,9 +257,10 @@
 });
 }
 
-void RemoteSourceBufferProxy::evictCodedFrames(uint64_t newDataSize, uint64_t pendingAppendDataCapacity, uint64_t maximumBufferSize, const MediaTime& currentTime, const MediaTime& duration, bool isEnded)
+void RemoteSourceBufferProxy::evictCodedFrames(uint64_t newDataSize, uint64_t pendingAppendDataCapacity, uint64_t maximumBufferSize, const MediaTime& currentTime, const MediaTime& duration, bool isEnded, CompletionHandler&& completionHandler)
 {
 m_sourceBufferPrivate->evictCodedFrames(newDataSize, 

[webkit-changes] [276944] trunk/Source/WebCore

2021-05-03 Thread peng . liu6
Title: [276944] trunk/Source/WebCore








Revision 276944
Author peng.l...@apple.com
Date 2021-05-03 21:04:23 -0700 (Mon, 03 May 2021)


Log Message
Remove the quirk to disable "return to element fullscreen from picture-in-picture" for wowhead.com
https://bugs.webkit.org/show_bug.cgi?id=225322

Reviewed by Sam Weinig.

The quirk can be removed since wowhead.com has fixed the issue on the page.

Manually tested.

* page/Quirks.cpp:
(WebCore::Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Quirks.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (276943 => 276944)

--- trunk/Source/WebCore/ChangeLog	2021-05-04 04:03:42 UTC (rev 276943)
+++ trunk/Source/WebCore/ChangeLog	2021-05-04 04:04:23 UTC (rev 276944)
@@ -1,5 +1,19 @@
 2021-05-03  Peng Liu  
 
+Remove the quirk to disable "return to element fullscreen from picture-in-picture" for wowhead.com
+https://bugs.webkit.org/show_bug.cgi?id=225322
+
+Reviewed by Sam Weinig.
+
+The quirk can be removed since wowhead.com has fixed the issue on the page.
+
+Manually tested.
+
+* page/Quirks.cpp:
+(WebCore::Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk const):
+
+2021-05-03  Peng Liu  
+
 Small cleanups in MediaPlayerPrivateMediaSourceAVFObjC and MediaPlayerPrivateAVFoundationObjC
 https://bugs.webkit.org/show_bug.cgi?id=225330
 


Modified: trunk/Source/WebCore/page/Quirks.cpp (276943 => 276944)

--- trunk/Source/WebCore/page/Quirks.cpp	2021-05-04 04:03:42 UTC (rev 276943)
+++ trunk/Source/WebCore/page/Quirks.cpp	2021-05-04 04:04:23 UTC (rev 276944)
@@ -1396,16 +1396,16 @@
 bool Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk() const
 {
 #if ENABLE(FULLSCREEN_API) && ENABLE(VIDEO_PRESENTATION_MODE)
-// Some sites (e.g., wowhead.com and vimeo.com) do not set element's styles properly when a video
+// Some sites (e.g., vimeo.com) do not set element's styles properly when a video
 // returns to fullscreen from picture-in-picture. This quirk disables the "return to fullscreen
-// from picture-in-picture" feature for those sites. We should remove the quirk once rdar://problem/73167861
-// and rdar://problem/73167931 have been fixed.
+// from picture-in-picture" feature for those sites. We should remove the quirk once
+// rdar://problem/73167931 has been fixed.
 if (!needsQuirks())
 return false;
 
 if (!m_blocksReturnToFullscreenFromPictureInPictureQuirk) {
 auto domain = RegistrableDomain { m_document->topDocument().url() };
-m_blocksReturnToFullscreenFromPictureInPictureQuirk = domain == "vimeo.com"_s || domain == "wowhead.com"_s;
+m_blocksReturnToFullscreenFromPictureInPictureQuirk = domain == "vimeo.com"_s;
 }
 
 return *m_blocksReturnToFullscreenFromPictureInPictureQuirk;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276943] trunk/Source/WebCore

2021-05-03 Thread peng . liu6
Title: [276943] trunk/Source/WebCore








Revision 276943
Author peng.l...@apple.com
Date 2021-05-03 21:03:42 -0700 (Mon, 03 May 2021)


Log Message
Small cleanups in MediaPlayerPrivateMediaSourceAVFObjC and MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=225330

Reviewed by Eric Carlson.

Since we have removed `MediaPlayerPrivate::copyVideoTextureToPlatformTexture()` in r273213,
some headers in `MediaPlayerPrivateAVFoundationObjC` and `MediaPlayerPrivateMediaSourceAVFObjC`
can be removed as well. This patch also has some small cleanups.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/cocoa/WebCoreDecompressionSession.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (276942 => 276943)

--- trunk/Source/WebCore/ChangeLog	2021-05-04 02:37:17 UTC (rev 276942)
+++ trunk/Source/WebCore/ChangeLog	2021-05-04 04:03:42 UTC (rev 276943)
@@ -1,3 +1,19 @@
+2021-05-03  Peng Liu  
+
+Small cleanups in MediaPlayerPrivateMediaSourceAVFObjC and MediaPlayerPrivateAVFoundationObjC
+https://bugs.webkit.org/show_bug.cgi?id=225330
+
+Reviewed by Eric Carlson.
+
+Since we have removed `MediaPlayerPrivate::copyVideoTextureToPlatformTexture()` in r273213,
+some headers in `MediaPlayerPrivateAVFoundationObjC` and `MediaPlayerPrivateMediaSourceAVFObjC`
+can be removed as well. This patch also has some small cleanups.
+
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+* platform/graphics/cocoa/WebCoreDecompressionSession.h:
+
 2021-05-03  Julian Gonzalez  
 
 Crash in WebCore::nextBoundary()


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (276942 => 276943)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-05-04 02:37:17 UTC (rev 276942)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-05-04 04:03:42 UTC (rev 276943)
@@ -36,14 +36,12 @@
 #import "AuthenticationChallenge.h"
 #import "CDMInstanceFairPlayStreamingAVFObjC.h"
 #import "CDMSessionAVFoundationObjC.h"
+#import "ColorSpaceCG.h"
 #import "Cookie.h"
 #import "DeprecatedGlobalSettings.h"
 #import "ExtensionsGL.h"
 #import "FloatConversion.h"
 #import "GraphicsContext.h"
-#import "GraphicsContextCG.h"
-#import "GraphicsContextGL.h"
-#import "GraphicsContextGLCV.h"
 #import "ImageRotationSessionVT.h"
 #import "InbandMetadataTextTrackPrivateAVF.h"
 #import "InbandTextTrackPrivateAVFObjC.h"


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (276942 => 276943)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2021-05-04 02:37:17 UTC (rev 276942)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2021-05-04 04:03:42 UTC (rev 276943)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef MediaPlayerPrivateMediaSourceAVFObjC_h
-#define MediaPlayerPrivateMediaSourceAVFObjC_h
+#pragma once
 
 #if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
 
@@ -354,6 +353,3 @@
 } // namespace WTF
 
 #endif // ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
-
-#endif // MediaPlayerPrivateMediaSourceAVFObjC_h
-


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (276942 => 276943)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2021-05-04 02:37:17 UTC (rev 276942)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2021-05-04 04:03:42 UTC (rev 276943)
@@ -32,9 +32,7 @@
 #import "AVAssetTrackUtilities.h"
 #import "AVStreamDataParserMIMETypeCache.h"
 #import "CDMSessionAVStreamSession.h"
-#import "GraphicsContextCG.h"
-#import "GraphicsContextGL.h"
-#import "GraphicsContextGLCV.h"
+#import "GraphicsContext.h"
 #import "Logging.h"
 #import "MediaSourcePrivateAVFObjC.h"
 #import "MediaSourcePrivateClient.h"


Modified: 

[webkit-changes] [276854] trunk/Source/WebKit

2021-04-30 Thread peng . liu6
Title: [276854] trunk/Source/WebKit








Revision 276854
Author peng.l...@apple.com
Date 2021-04-30 14:49:41 -0700 (Fri, 30 Apr 2021)


Log Message
ASSERTION FAILED: Unhandled message RemoteRemoteCommandListenerProxy_UpdateSupportedCommands
https://bugs.webkit.org/show_bug.cgi?id=225234

Reviewed by Darin Adler.

We need to keep dispatching (and ignoring) messages for `RemoteRemoteCommandListenerProxy`
after the object is destroyed. That could happen because other web processes may still have
active `RemoteRemoteCommandListener` after `GPUConnectionToWebProcess::m_remoteRemoteCommandListener`
is destroyed.

No new tests. Fix an assertion failure in tests.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::dispatchMessage):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (276853 => 276854)

--- trunk/Source/WebKit/ChangeLog	2021-04-30 21:30:19 UTC (rev 276853)
+++ trunk/Source/WebKit/ChangeLog	2021-04-30 21:49:41 UTC (rev 276854)
@@ -1,3 +1,20 @@
+2021-04-30  Peng Liu  
+
+ASSERTION FAILED: Unhandled message RemoteRemoteCommandListenerProxy_UpdateSupportedCommands
+https://bugs.webkit.org/show_bug.cgi?id=225234
+
+Reviewed by Darin Adler.
+
+We need to keep dispatching (and ignoring) messages for `RemoteRemoteCommandListenerProxy`
+after the object is destroyed. That could happen because other web processes may still have
+active `RemoteRemoteCommandListener` after `GPUConnectionToWebProcess::m_remoteRemoteCommandListener`
+is destroyed.
+
+No new tests. Fix an assertion failure in tests.
+
+* GPUProcess/GPUConnectionToWebProcess.cpp:
+(WebKit::GPUConnectionToWebProcess::dispatchMessage):
+
 2021-04-30  Wenson Hsieh  
 
 [iOS] Add a heuristic to determine whether a synthetic click triggered any meaningful changes


Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp (276853 => 276854)

--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp	2021-04-30 21:30:19 UTC (rev 276853)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp	2021-04-30 21:49:41 UTC (rev 276854)
@@ -658,8 +658,9 @@
 }
 #endif
 
-if (m_remoteRemoteCommandListener && decoder.messageReceiverName() == Messages::RemoteRemoteCommandListenerProxy::messageReceiverName()) {
-m_remoteRemoteCommandListener->didReceiveMessage(connection, decoder);
+if (decoder.messageReceiverName() == Messages::RemoteRemoteCommandListenerProxy::messageReceiverName()) {
+if (m_remoteRemoteCommandListener)
+m_remoteRemoteCommandListener->didReceiveMessage(connection, decoder);
 return true;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276824] trunk/Source/WebKit

2021-04-29 Thread peng . liu6
Title: [276824] trunk/Source/WebKit








Revision 276824
Author peng.l...@apple.com
Date 2021-04-29 17:20:32 -0700 (Thu, 29 Apr 2021)


Log Message
AVAudioSession throws an exception when WebKit tries to set its routeSharingPolicy to "independent"
https://bugs.webkit.org/show_bug.cgi?id=225213

Reviewed by Jer Noble.

AVAudioSession does not expect WebKit to set its routeSharingPolicy
to AVAudioSessionRouteSharingPolicyIndependent(RouteSharingPolicy::Independent).

* GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::RemoteAudioSessionProxyManager::updateCategory):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (276823 => 276824)

--- trunk/Source/WebKit/ChangeLog	2021-04-30 00:12:00 UTC (rev 276823)
+++ trunk/Source/WebKit/ChangeLog	2021-04-30 00:20:32 UTC (rev 276824)
@@ -1,3 +1,16 @@
+2021-04-29  Peng Liu  
+
+AVAudioSession throws an exception when WebKit tries to set its routeSharingPolicy to "independent"
+https://bugs.webkit.org/show_bug.cgi?id=225213
+
+Reviewed by Jer Noble.
+
+AVAudioSession does not expect WebKit to set its routeSharingPolicy
+to AVAudioSessionRouteSharingPolicyIndependent(RouteSharingPolicy::Independent).
+
+* GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
+(WebKit::RemoteAudioSessionProxyManager::updateCategory):
+
 2021-04-29  Brent Fulgham  
 
 [iOS] Remove unused logd-diagnostic-client rules


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp (276823 => 276824)

--- trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp	2021-04-30 00:12:00 UTC (rev 276823)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp	2021-04-30 00:20:32 UTC (rev 276824)
@@ -95,14 +95,13 @@
 else
 category = AudioSession::None;
 
+policy = RouteSharingPolicy::Default;
 if (policyCounts.contains(RouteSharingPolicy::LongFormVideo))
 policy = RouteSharingPolicy::LongFormVideo;
 else if (policyCounts.contains(RouteSharingPolicy::LongFormAudio))
 policy = RouteSharingPolicy::LongFormAudio;
 else if (policyCounts.contains(RouteSharingPolicy::Independent))
-policy = RouteSharingPolicy::Independent;
-else
-policy = RouteSharingPolicy::Default;
+ASSERT_NOT_REACHED();
 
 m_session->setCategory(category, policy);
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276799] trunk

2021-04-29 Thread peng . liu6
Title: [276799] trunk








Revision 276799
Author peng.l...@apple.com
Date 2021-04-29 13:21:02 -0700 (Thu, 29 Apr 2021)


Log Message
[GPUP] Two message loops between WebContent process and GPU process to enable/select audio/video tracks
https://bugs.webkit.org/show_bug.cgi?id=225193

Reviewed by Eric Carlson.

Source/WebKit:

The current implementation has two message loops between Web process
and GPU process related to enable/select audio/video tracks.

For audio, the message loop is:
Web Process -> GPU process: RemoteMediaPlayerProxy::audioTrackSetEnabled
GPU Process -> Web Process: MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged

The message loop will lead to the following function call loop:

AudioTrackPrivateRemote::updateConfiguration()
AudioTrackPrivateRemote::setEnabled()
RemoteMediaPlayerProxy::audioTrackSetEnabled()
RemoteAudioTrackProxy::setEnabled()
AudioTrackPrivateAVFObjC::setEnabled()
AudioTrackPrivate::setEnabled()
RemoteAudioTrackProxy::enabledChanged()
RemoteAudioTrackProxy::configurationChanged()
MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged()
again, AudioTrackPrivateRemote::updateConfiguration(), and repeat ...

The loop for video tracks is similar.

The loop is bad but normally does not impact a media player's functionality.

However, if a page disables and enables an audio track of a media element with HLS stream
in one run loop, the loop will disable and enable the track repeatedly, as a result,
CoreMedia's HLS player will disable/enable audio segments and send/cancel download
requests repeatedly. Eventually the player won't play audio.

This patch fixes these two message loops.

Test: media/media-video-audio-track.html

* WebProcess/GPU/media/AudioTrackPrivateRemote.cpp:
(WebKit::AudioTrackPrivateRemote::updateConfiguration):
* WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:
(WebKit::VideoTrackPrivateRemote::updateConfiguration):

LayoutTests:

* media/media-video-audio-track-expected.txt: Added.
* media/media-video-audio-track.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/AudioTrackPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/VideoTrackPrivateRemote.cpp


Added Paths

trunk/LayoutTests/media/media-video-audio-track-expected.txt
trunk/LayoutTests/media/media-video-audio-track.html




Diff

Modified: trunk/LayoutTests/ChangeLog (276798 => 276799)

--- trunk/LayoutTests/ChangeLog	2021-04-29 20:15:13 UTC (rev 276798)
+++ trunk/LayoutTests/ChangeLog	2021-04-29 20:21:02 UTC (rev 276799)
@@ -1,3 +1,13 @@
+2021-04-29  Peng Liu  
+
+[GPUP] Two message loops between WebContent process and GPU process to enable/select audio/video tracks
+https://bugs.webkit.org/show_bug.cgi?id=225193
+
+Reviewed by Eric Carlson.
+
+* media/media-video-audio-track-expected.txt: Added.
+* media/media-video-audio-track.html: Added.
+
 2021-04-29  Sam Weinig  
 
 Add support for CanvasRenderingContext2DSettings


Added: trunk/LayoutTests/media/media-video-audio-track-expected.txt (0 => 276799)

--- trunk/LayoutTests/media/media-video-audio-track-expected.txt	(rev 0)
+++ trunk/LayoutTests/media/media-video-audio-track-expected.txt	2021-04-29 20:21:02 UTC (rev 276799)
@@ -0,0 +1,17 @@
+
+1) Disable and enable an audio track in a run loop will enable the audio track.
+2) Deselect and select a video track in a run loop will select the video track.
+
+RUN(mediaElement.src = "" "content/test"))
+
+EVENT(canplaythrough)
+EXPECTED (video.audioTracks.length == '1') OK
+EXPECTED (video.audioTracks[0].enabled == 'true') OK
+EXPECTED (video.videoTracks.length == '1') OK
+EXPECTED (video.videoTracks[0].selected == 'true') OK
+RUN(video.audioTracks[0].enabled = false)
+RUN(video.audioTracks[0].enabled = true)
+RUN(video.videoTracks[0].selected = false)
+RUN(video.videoTracks[0].selected = true)
+END OF TEST
+


Added: trunk/LayoutTests/media/media-video-audio-track.html (0 => 276799)

--- trunk/LayoutTests/media/media-video-audio-track.html	(rev 0)
+++ trunk/LayoutTests/media/media-video-audio-track.html	2021-04-29 20:21:02 UTC (rev 276799)
@@ -0,0 +1,42 @@
+
+
+
+
+function canplaythrough()
+{
+testExpected('video.audioTracks.length', '1');
+testExpected('video.audioTracks[0].enabled', true);
+testExpected('video.videoTracks.length', '1');
+testExpected('video.videoTracks[0].selected', true);
+run('video.audioTracks[0].enabled = false');
+run('video.audioTracks[0].enabled = true');
+run('video.videoTracks[0].selected = false');
+run('video.videoTracks[0].selected = true');
+setTimeout(endTest, 2000);
+setInterval(() => {
+if (!video.audioTracks[0].enabled)
+

[webkit-changes] [276414] trunk

2021-04-21 Thread peng . liu6
Title: [276414] trunk








Revision 276414
Author peng.l...@apple.com
Date 2021-04-21 18:28:38 -0700 (Wed, 21 Apr 2021)


Log Message
[GPUP] Refactor SourceBuffer::enqueuedSamplesForTrackID() for testing purposes
https://bugs.webkit.org/show_bug.cgi?id=224891

Reviewed by Eric Carlson.

Source/WebCore:

This patch is a preparation to run `MockMediaPlayerMediaSource` in the GPU Process.

`SourceBuffer::enqueuedSamplesForTrackID()` is a synchronous function used for testing
purposes. It works fine when "Media in GPU process" is disabled. However, when
"Media in GPU process" is enabled, we have to use a synchronous IPC message to
implement it. This patch changes it to be a function with a completion handler
parameter, so that we can implement it with an asynchronous IPC message when
we run `MockMediaPlayerMediaSource` in the GPU process.

There is no behavior change when "Media in GPU Process" is disabled.

Covered by existing tests.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::enqueuedSamplesForTrackID):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID): Deleted.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID):
* platform/mock/mediasource/MockSourceBufferPrivate.h:

* testing/Internals.cpp:
(WebCore::Internals::enqueuedSamplesForTrackID):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::enqueuedSamplesForTrackID):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::bufferedSamplesForTrackId):
(WebKit::SourceBufferPrivateRemote::enqueuedSamplesForTrackID):
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:

LayoutTests:

Update following tests to use the asynchronous `enqueuedSamplesForTrackID()`.
* media/media-source/media-source-append-acb-no-frame-lost.html:
* media/media-source/media-source-append-acb-tolerance.html:
* media/media-source/media-source-append-presentation-durations.html:
* media/media-source/media-source-dropped-iframe.html:
* media/media-source/media-source-erase-after-last-append.html:
* media/media-source/media-source-first-append-not-starting-at-zero.html:
* media/media-source/media-source-remove-b-frame.html:
* media/media-source/media-source-seek-back.html:
* media/media-source/media-source-timestampoffset-rounding-error.html:

We don't need this platform-specific test expectation now.
* platform/mac/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Removed.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/media-source/media-source-append-acb-no-frame-lost.html
trunk/LayoutTests/media/media-source/media-source-append-acb-tolerance.html
trunk/LayoutTests/media/media-source/media-source-append-presentation-durations.html
trunk/LayoutTests/media/media-source/media-source-dropped-iframe.html
trunk/LayoutTests/media/media-source/media-source-erase-after-last-append.html
trunk/LayoutTests/media/media-source/media-source-first-append-not-starting-at-zero.html
trunk/LayoutTests/media/media-source/media-source-remove-b-frame.html
trunk/LayoutTests/media/media-source/media-source-seek-back.html
trunk/LayoutTests/media/media-source/media-source-timestampoffset-rounding-error.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h
trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp
trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/testing/Internals.h
trunk/Source/WebCore/testing/Internals.idl
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h


Removed Paths

trunk/LayoutTests/platform/mac/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (276413 => 276414)

--- trunk/LayoutTests/ChangeLog	2021-04-22 01:15:13 UTC (rev 276413)
+++ trunk/LayoutTests/ChangeLog	2021-04-22 01:28:38 UTC (rev 276414)
@@ -1,3 +1,24 @@
+2021-04-21  Peng Liu  
+
+[GPUP] Refactor SourceBuffer::enqueuedSamplesForTrackID() 

[webkit-changes] [276367] trunk/Source

2021-04-21 Thread peng . liu6
Title: [276367] trunk/Source








Revision 276367
Author peng.l...@apple.com
Date 2021-04-21 09:20:11 -0700 (Wed, 21 Apr 2021)


Log Message
[GPUP] Refactor the implementation of MediaSource::buffered()
https://bugs.webkit.org/show_bug.cgi?id=224848

Reviewed by Eric Carlson.

Source/WebCore:

This patch is a preparation to run `MockMediaPlayerMediaSource` in the GPU Process.

In the current implementation, `MediaSource::m_buffered` is updated by the caller
of `MediaSource::buffered()`. As a result, when an object from the GPU process
wants to get the value of `m_buffered`, it may need to use a synchronous IPC
message (from the GPU process to a WebContent process), which is bad.
Therefore, there is an `ASSERT_NOT_REACHED()` in `RemoteMediaSourceProxy::buffered()`.
However, `MockMediaPlayerMediaSource` needs to use it for testing purposes.

This patch adds a function `sourceBufferDidChangeBufferedDirty()` to
`MediaSource`, so that `SourceBuffer` can notify the `MediaSource` object to
refresh its `m_buffered` and notify `MediaSourcePrivate` regarding the new value.
When "Media in GPU process" is enabled, `MediaSourcePrivateRemote` will forward
the new value to the GPU process, so that we can avoid the synchronous IPC
message from the GPU process to the WebContent process, and meet the requirement
of `MockMediaPlayerMediaSource`.

There is no behavior change when "Media in GPU Process" is disabled.

Covered by existing tests.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::buffered const):
(WebCore::MediaSource::sourceBufferDidChangeBufferedDirty):
(WebCore::MediaSource::regenerateActiveSourceBuffers):
(WebCore::MediaSource::updateBufferedIfNeeded):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateBufferedDirtyChanged):
* platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::bufferedChanged):

Source/WebKit:

Add an IPC message `BufferedChanged` to forward the buffered ranges of
`MediaSource` from a WebContent process to the GPU process.

* GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::buffered const):
(WebKit::RemoteMediaSourceProxy::bufferedChanged):
* GPUProcess/media/RemoteMediaSourceProxy.h:
* GPUProcess/media/RemoteMediaSourceProxy.messages.in:
* WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:
(WebKit::MediaSourcePrivateRemote::bufferedChanged):
* WebProcess/GPU/media/MediaSourcePrivateRemote.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp
trunk/Source/WebCore/Modules/mediasource/MediaSource.h
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/platform/graphics/MediaSourcePrivate.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (276366 => 276367)

--- trunk/Source/WebCore/ChangeLog	2021-04-21 16:09:03 UTC (rev 276366)
+++ trunk/Source/WebCore/ChangeLog	2021-04-21 16:20:11 UTC (rev 276367)
@@ -1,3 +1,43 @@
+2021-04-21  Peng Liu  
+
+[GPUP] Refactor the implementation of MediaSource::buffered()
+https://bugs.webkit.org/show_bug.cgi?id=224848
+
+Reviewed by Eric Carlson.
+
+This patch is a preparation to run `MockMediaPlayerMediaSource` in the GPU Process.
+
+In the current implementation, `MediaSource::m_buffered` is updated by the caller
+of `MediaSource::buffered()`. As a result, when an object from the GPU process
+wants to get the value of `m_buffered`, it may need to use a synchronous IPC
+message (from the GPU process to a WebContent process), which is bad.
+Therefore, there is an `ASSERT_NOT_REACHED()` in `RemoteMediaSourceProxy::buffered()`.
+However, `MockMediaPlayerMediaSource` needs to use it for testing purposes.
+
+This patch adds a function `sourceBufferDidChangeBufferedDirty()` to
+`MediaSource`, so that `SourceBuffer` can notify the `MediaSource` object to
+refresh its `m_buffered` and notify `MediaSourcePrivate` regarding the new value.
+When "Media in GPU process" is enabled, `MediaSourcePrivateRemote` will forward
+the new value to the GPU process, so that we can avoid the synchronous IPC
+message from the GPU process to the WebContent process, and meet the requirement
+of `MockMediaPlayerMediaSource`.
+
+There is no behavior change when "Media in GPU Process" is disabled.
+
+Covered by existing tests.
+
+* Modules/mediasource/MediaSource.cpp:
+(WebCore::MediaSource::MediaSource):
+

[webkit-changes] [276177] trunk/Source

2021-04-16 Thread peng . liu6
Title: [276177] trunk/Source








Revision 276177
Author peng.l...@apple.com
Date 2021-04-16 15:54:15 -0700 (Fri, 16 Apr 2021)


Log Message
[GPUP] WebContent process should not create AVOutputContext instances when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=224469

Reviewed by Eric Carlson.

Source/WebCore:

This patch modifies `MediaPlaybackTargetContext` to provide interfaces to serialize/deserialize
`AVOutputContext` and modifies `MediaPlaybackTargetCocoa` to use `MediaPlaybackTargetContext` to
manage its `AVOutputContext` instead of keeping a pointer to the `AVOutputContext` object.
With these changes, a WebContent process can forward a serialized `AVOutputContext` object
to other processes (e.g., the GPU process) without deserializing it. Therefore, the WebContent
process does not need access to the CoreMedia routing service. So we can remove the fix (r275669)
for bug 224328.

Covered by existing tests.

* Modules/airplay/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
* Modules/airplay/WebMediaSessionManager.h:

* Headers.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
Modify the project file because `MediaPlaybackTargetContext` is used in Cocoa ports only.

* page/ChromeClient.h:
(WebCore::ChromeClient::setMockMediaPlaybackTargetPickerState):
* page/Page.cpp:
(WebCore::Page::setMockMediaPlaybackTargetPickerState):
* page/Page.h:

* platform/graphics/MediaPlaybackTarget.h:
(WebCore::MediaPlaybackTarget::hasActiveRoute const):
(WebCore::MediaPlaybackTarget::deviceName const):
(WebCore::MediaPlaybackTarget::supportsRemoteVideoPlayback):
(): Deleted.
* platform/graphics/MediaPlaybackTargetContext.h: Removed.
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h:
(WebCore::MediaPlaybackTargetCocoa::outputContext const): Deleted.
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm:
(WebCore::MediaPlaybackTargetCocoa::create):
(WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa):
(WebCore::toMediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::supportsRemoteVideoPlayback const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::targetContext const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::deviceName const): Deleted.
Don't directly use `AVOutputContext` in this class.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):

* platform/graphics/cocoa/MediaPlaybackTargetContext.h: Added.
(WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
(WebCore::MediaPlaybackTargetContext::type const):
(WebCore::MediaPlaybackTargetContext::mockState const):
(WebCore::MediaPlaybackTargetContext::outputContext const):
(WebCore::MediaPlaybackTargetContext::serializedOutputContext const):
(WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData const):
* platform/graphics/cocoa/MediaPlaybackTargetContext.mm: Added.
(WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
(WebCore::MediaPlaybackTargetContext::deviceName const):
(WebCore::MediaPlaybackTargetContext::hasActiveRoute const):
(WebCore::MediaPlaybackTargetContext::supportsRemoteVideoPlayback const):
(WebCore::MediaPlaybackTargetContext::serializeOutputContext):
(WebCore::MediaPlaybackTargetContext::deserializeOutputContext):

* platform/mock/MediaPlaybackTargetMock.cpp:
(WebCore::MediaPlaybackTargetMock::create):
(WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
(WebCore::toMediaPlaybackTargetMock):
(WebCore::MediaPlaybackTargetMock::targetContext const): Deleted.
* platform/mock/MediaPlaybackTargetMock.h:
(WebCore::MediaPlaybackTargetMock::state const):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
(WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
(WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
(WebCore::MediaPlaybackTargetPickerMock::setState):
* platform/mock/MediaPlaybackTargetPickerMock.h:

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setMockMediaPlaybackTargetPickerState):

Source/WebKit:

* Scripts/webkit/messages.py: Fix clean build failures on the WinCairo port.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget):
* GPUProcess/media/RemoteMediaPlayerProxy.h:

* GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
(WebKit::RemoteMediaSessionHelperProxy::activeVideoRouteDidChange):

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

[webkit-changes] [276107] trunk/Source

2021-04-15 Thread peng . liu6
Title: [276107] trunk/Source








Revision 276107
Author peng.l...@apple.com
Date 2021-04-15 19:20:00 -0700 (Thu, 15 Apr 2021)


Log Message
[GPUP] WebContent process should not create AVOutputContext instances when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=224469

Reviewed by Eric Carlson.

Source/WebCore:

This patch modifies `MediaPlaybackTargetContext` to provide interfaces to serialize/deserialize
`AVOutputContext` and modifies `MediaPlaybackTargetCocoa` to use `MediaPlaybackTargetContext` to
manage its `AVOutputContext` instead of keeping a pointer to the `AVOutputContext` object.
With these changes, a WebContent process can forward a serialized `AVOutputContext` object
to other processes (e.g., the GPU process) without deserializing it. Therefore, the WebContent
process does not need access to the CoreMedia routing service. So we can remove the fix (r275669)
for bug 224328.

Covered by existing tests.

* Modules/airplay/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
* Modules/airplay/WebMediaSessionManager.h:

* Headers.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
Modify the project file because `MediaPlaybackTargetContext` is used in Cocoa ports only.

* page/ChromeClient.h:
(WebCore::ChromeClient::setMockMediaPlaybackTargetPickerState):
* page/Page.cpp:
(WebCore::Page::setMockMediaPlaybackTargetPickerState):
* page/Page.h:

* platform/graphics/MediaPlaybackTarget.h:
(WebCore::MediaPlaybackTarget::hasActiveRoute const):
(WebCore::MediaPlaybackTarget::deviceName const):
(WebCore::MediaPlaybackTarget::supportsRemoteVideoPlayback):
(): Deleted.
* platform/graphics/MediaPlaybackTargetContext.h: Removed.
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h:
(WebCore::MediaPlaybackTargetCocoa::outputContext const): Deleted.
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm:
(WebCore::MediaPlaybackTargetCocoa::create):
(WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa):
(WebCore::toMediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::supportsRemoteVideoPlayback const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::targetContext const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const): Deleted.
(WebCore::MediaPlaybackTargetCocoa::deviceName const): Deleted.
Don't directly use `AVOutputContext` in this class.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):

* platform/graphics/cocoa/MediaPlaybackTargetContext.h: Added.
(WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
(WebCore::MediaPlaybackTargetContext::type const):
(WebCore::MediaPlaybackTargetContext::mockState const):
(WebCore::MediaPlaybackTargetContext::outputContext const):
(WebCore::MediaPlaybackTargetContext::serializedOutputContext const):
(WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData const):
* platform/graphics/cocoa/MediaPlaybackTargetContext.mm: Added.
(WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
(WebCore::MediaPlaybackTargetContext::deviceName const):
(WebCore::MediaPlaybackTargetContext::hasActiveRoute const):
(WebCore::MediaPlaybackTargetContext::supportsRemoteVideoPlayback const):
(WebCore::MediaPlaybackTargetContext::serializeOutputContext):
(WebCore::MediaPlaybackTargetContext::deserializeOutputContext):

* platform/mock/MediaPlaybackTargetMock.cpp:
(WebCore::MediaPlaybackTargetMock::create):
(WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
(WebCore::toMediaPlaybackTargetMock):
(WebCore::MediaPlaybackTargetMock::targetContext const): Deleted.
* platform/mock/MediaPlaybackTargetMock.h:
(WebCore::MediaPlaybackTargetMock::state const):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
(WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
(WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
(WebCore::MediaPlaybackTargetPickerMock::setState):
* platform/mock/MediaPlaybackTargetPickerMock.h:

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setMockMediaPlaybackTargetPickerState):

Source/WebKit:

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget):
* GPUProcess/media/RemoteMediaPlayerProxy.h:

* GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
(WebKit::RemoteMediaSessionHelperProxy::activeVideoRouteDidChange):

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder::encodePlatformData):
(IPC::ArgumentCoder::decodePlatformData):
* 

[webkit-changes] [275883] trunk

2021-04-13 Thread peng . liu6
Title: [275883] trunk








Revision 275883
Author peng.l...@apple.com
Date 2021-04-13 07:10:32 -0700 (Tue, 13 Apr 2021)


Log Message
[macOS] Netflix videos opened in background tab never become playable after foregrounding
https://bugs.webkit.org/show_bug.cgi?id=224384

Reviewed by Eric Carlson.

Source/WebKit:

When a page calls `navigator.requestMediaKeySystemAccess()` in a background tab, the request
will be added to a pending request hash map. However, the current implementation of
`MediaKeySystemPermissionRequestManager` does not send the request when the tab switches
to foreground. This patch fixes this issue by adding the `MediaKeySystemPermissionRequestManager`
object as a `MediaCanStartListener` of `Document`, so that it will send its pending requests
when the tab switches to foreground (`mediaCanStart()`).

* WebKit.xcodeproj/project.pbxproj: Add two cpp files to the xcode project.

* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.cpp:
Add the object as a `MediaCanStartListener` so that it can send the `MediaKeySystemRequest`
to the UI process when the tab switches to foreground.
(WebKit::MediaKeySystemPermissionRequestManager::startMediaKeySystemRequest):
(WebKit::MediaKeySystemPermissionRequestManager::cancelMediaKeySystemRequest):
(WebKit::MediaKeySystemPermissionRequestManager::mediaCanStart):
* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.h:

LayoutTests:

* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt: Added.
* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
trunk/Source/WebKit/WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.cpp
trunk/Source/WebKit/WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.h


Added Paths

trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt
trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html




Diff

Modified: trunk/LayoutTests/ChangeLog (275882 => 275883)

--- trunk/LayoutTests/ChangeLog	2021-04-13 14:08:32 UTC (rev 275882)
+++ trunk/LayoutTests/ChangeLog	2021-04-13 14:10:32 UTC (rev 275883)
@@ -1,3 +1,13 @@
+2021-04-13  Peng Liu  
+
+[macOS] Netflix videos opened in background tab never become playable after foregrounding
+https://bugs.webkit.org/show_bug.cgi?id=224384
+
+Reviewed by Eric Carlson.
+
+* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt: Added.
+* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html: Added.
+
 2021-04-13  Frédéric Wang  
 
 ASSERTION FAILED: !m_needExceptionCheck in CloneSerializer::serialize with postMessage({g:42})


Added: trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt (0 => 275883)

--- trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt	(rev 0)
+++ trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background-expected.txt	2021-04-13 14:10:32 UTC (rev 275883)
@@ -0,0 +1,13 @@
+RUN(internals.initializeMockMediaSource())
+RUN(mock = internals.registerMockCDM())
+RUN(mock.supportedDataTypes = ["mock"])
+RUN(capabilities.initDataTypes = ["mock"])
+RUN(capabilities.videoCapabilities = [{ contentType: 'video/mock; codecs="mock"' }] )
+
+Call navigator.requestMediaKeySystemAccess() in a background tab
+RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities]))
+
+Switch the tab to foreground
+Promise resolved OK
+END OF TEST
+


Added: trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html (0 => 275883)

--- trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html	(rev 0)
+++ trunk/LayoutTests/media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-in-background.html	2021-04-13 14:10:32 UTC (rev 275883)
@@ -0,0 +1,39 @@
+
+
+
+
+var mock;
+var promise;
+var capabilities = {};
+
+function runTest()
+{
+if (!window.internals) {
+failTest("Internals is required for this test.")
+return;
+}
+
+run('internals.initializeMockMediaSource()');
+run('mock = internals.registerMockCDM()');
+run('mock.supportedDataTypes = ["mock"]');
+run('capabilities.initDataTypes = ["mock"]');
+run(`capabilities.videoCapabilities = [{ contentType: 'video/mock; codecs="mock"' }] `);
+
+consoleWrite("");
+consoleWrite("Call navigator.requestMediaKeySystemAccess() in a background tab");
+

[webkit-changes] [275857] trunk/Source/WebKitLegacy/mac

2021-04-12 Thread peng . liu6
Title: [275857] trunk/Source/WebKitLegacy/mac








Revision 275857
Author peng.l...@apple.com
Date 2021-04-12 19:06:28 -0700 (Mon, 12 Apr 2021)


Log Message
Fix some issues hidden by unified build
https://bugs.webkit.org/show_bug.cgi?id=224457

Reviewed by Eric Carlson.

Some small fixes and clean-up. The issues are hidden by the unified build mechanism
and were found in a local build.

* DOM/DOMTokenList.mm:
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebFrameLoaderClient.h:
* WebView/WebDataSource.mm:
* WebView/WebFrameView.mm:
* WebView/WebHTMLViewInternal.h:
* WebView/WebImmediateActionController.mm:
* WebView/WebPDFView.mm:

Modified Paths

trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm
trunk/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
trunk/Source/WebKitLegacy/mac/WebView/WebDataSource.mm
trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLViewInternal.h
trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm
trunk/Source/WebKitLegacy/mac/WebView/WebPDFView.mm




Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-13 02:06:28 UTC (rev 275857)
@@ -1,3 +1,22 @@
+2021-04-12  Peng Liu  
+
+Fix some issues hidden by unified build
+https://bugs.webkit.org/show_bug.cgi?id=224457
+
+Reviewed by Eric Carlson.
+
+Some small fixes and clean-up. The issues are hidden by the unified build mechanism
+and were found in a local build.
+
+* DOM/DOMTokenList.mm:
+* Plugins/WebPluginController.mm:
+* WebCoreSupport/WebFrameLoaderClient.h:
+* WebView/WebDataSource.mm:
+* WebView/WebFrameView.mm:
+* WebView/WebHTMLViewInternal.h:
+* WebView/WebImmediateActionController.mm:
+* WebView/WebPDFView.mm:
+
 2021-04-02  Darin Adler  
 
 Use Hasher more, remove IntegerHasher, fix hashing-related mistakes


Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm	2021-04-13 02:06:28 UTC (rev 275857)
@@ -23,7 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #import "DOMTokenListInternal.h"
 
 #import "DOMInternal.h"


Modified: trunk/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm	2021-04-13 02:06:28 UTC (rev 275857)
@@ -26,7 +26,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #import "WebPluginController.h"
 
 #import "DOMNodeInternal.h"


Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h	2021-04-13 02:06:28 UTC (rev 275857)
@@ -34,6 +34,7 @@
 #import 
 #import 
 
+@class WebDataSource;
 @class WebDownload;
 @class WebFrame;
 @class WebFramePolicyListener;


Modified: trunk/Source/WebKitLegacy/mac/WebView/WebDataSource.mm (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/WebView/WebDataSource.mm	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebDataSource.mm	2021-04-13 02:06:28 UTC (rev 275857)
@@ -67,6 +67,7 @@
 #import 
 #import 
 #import 
+#import 
 
 #if PLATFORM(IOS_FAMILY)
 #import "WebPDFViewIOS.h"


Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm	2021-04-13 02:06:28 UTC (rev 275857)
@@ -35,6 +35,7 @@
 #import "WebDynamicScrollBarsViewInternal.h"
 #import "WebFrame.h"
 #import "WebFrameInternal.h"
+#import "WebFrameLoaderClient.h"
 #import "WebFrameViewInternal.h"
 #import "WebFrameViewPrivate.h"
 #import "WebHistoryItemInternal.h"


Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLViewInternal.h (275856 => 275857)

--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLViewInternal.h	2021-04-13 02:04:15 UTC (rev 275856)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLViewInternal.h	2021-04-13 02:06:28 UTC (rev 275857)
@@ -29,6 +29,7 @@
 // Things internal to the WebKit framework; not SPI.
 
 #import "WebHTMLViewPrivate.h"
+#import 
 
 @class CALayer;
 @class WebFrame;


Modified: trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (275856 => 275857)

--- 

[webkit-changes] [275530] trunk/Source/WebKit

2021-04-06 Thread peng . liu6
Title: [275530] trunk/Source/WebKit








Revision 275530
Author peng.l...@apple.com
Date 2021-04-06 10:24:42 -0700 (Tue, 06 Apr 2021)


Log Message
[GPUP] Clean up two messages.in files
https://bugs.webkit.org/show_bug.cgi?id=224153

Reviewed by Eric Carlson.

No new tests, no functional change.

* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in




Diff

Modified: trunk/Source/WebKit/ChangeLog (275529 => 275530)

--- trunk/Source/WebKit/ChangeLog	2021-04-06 17:18:52 UTC (rev 275529)
+++ trunk/Source/WebKit/ChangeLog	2021-04-06 17:24:42 UTC (rev 275530)
@@ -1,3 +1,15 @@
+2021-04-06  Peng Liu  
+
+[GPUP] Clean up two messages.in files
+https://bugs.webkit.org/show_bug.cgi?id=224153
+
+Reviewed by Eric Carlson.
+
+No new tests, no functional change.
+
+* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
+
 2021-04-06  Tyler Wilcock  
 
 Non-unified build fixes, early April 2021


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in (275529 => 275530)

--- trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in	2021-04-06 17:18:52 UTC (rev 275529)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in	2021-04-06 17:24:42 UTC (rev 275530)
@@ -51,9 +51,6 @@
 PrepareForRendering()
 SetVisible(bool visible)
 SetShouldMaintainAspectRatio(bool maintainAspectRatio)
-#if ENABLE(VIDEO_PRESENTATION_MODE)
-SetVideoFullscreenGravity(enum:uint8_t WebCore::MediaPlayerEnums::VideoGravity gravity)
-#endif
 AcceleratedRenderingStateChanged(bool canBeAccelerated)
 SetShouldDisableSleep(bool disable)
 SetRate(double rate)
@@ -62,6 +59,7 @@
 #if ENABLE(VIDEO_PRESENTATION_MODE)
 UpdateVideoFullscreenInlineImage()
 SetVideoFullscreenMode(WebCore::MediaPlayer::VideoFullscreenMode mode)
+SetVideoFullscreenGravity(enum:uint8_t WebCore::MediaPlayerEnums::VideoGravity gravity)
 VideoFullscreenStandbyChanged()
 #endif
 
@@ -73,7 +71,7 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 SetWirelessVideoPlaybackDisabled(bool disabled)
-# SetWirelessPlaybackTarget(WebCore::MediaPlaybackTarget)
+SetWirelessPlaybackTarget(WebCore::MediaPlaybackTargetContext target)
 SetShouldPlayToPlaybackTarget(bool shouldPlay)
 #endif
 
@@ -107,10 +105,6 @@
 VideoTrackSetSelected(WebKit::TrackPrivateRemoteIdentifier identifier, bool selected)
 TextTrackSetMode(WebKit::TrackPrivateRemoteIdentifier identifier, enum:uint8_t WebCore::InbandTextTrackPrivate::Mode mode)
 
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-SetWirelessPlaybackTarget(WebCore::MediaPlaybackTargetContext target)
-#endif
-
 PerformTaskAtMediaTime(MediaTime mediaTime, WallTime messageTime) -> (Optional mediaTime, Optional wallTime) Async
 WouldTaintOrigin(struct WebCore::SecurityOriginData origin) -> (Optional wouldTaint) Synchronous
 SetShouldUpdatePlaybackMetrics(bool should)


Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in (275529 => 275530)

--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in	2021-04-06 17:18:52 UTC (rev 275529)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in	2021-04-06 17:24:42 UTC (rev 275530)
@@ -89,7 +89,6 @@
 #if PLATFORM(IOS_FAMILY)
 GetRawCookies(URL url) -> (Vector result) Async
 #endif
-
 }
 
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [275451] trunk/Source/WebKit

2021-04-05 Thread peng . liu6
Title: [275451] trunk/Source/WebKit








Revision 275451
Author peng.l...@apple.com
Date 2021-04-05 16:43:41 -0700 (Mon, 05 Apr 2021)


Log Message
[GPUP][iPad] Audio only when airplaying a youtube video
https://bugs.webkit.org/show_bug.cgi?id=224132

Reviewed by Eric Carlson.

While `MediaPlayerPrivateAVFoundationObjC` only implements `setWirelessPlaybackTarget()`
on macOS, `MediaPlayerPrivateMediaSourceAVFObjC` implements it on both macOS and iOS.
Therefore, `RemoteMediaPlayerProxy` has to forward the calls of `setWirelessPlaybackTarget()`
from WebContent processes to "MediaPlayerPrivate*" on both macOS and iOS.

Manually tested.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (275450 => 275451)

--- trunk/Source/WebKit/ChangeLog	2021-04-02 23:27:29 UTC (rev 275450)
+++ trunk/Source/WebKit/ChangeLog	2021-04-05 23:43:41 UTC (rev 275451)
@@ -1,3 +1,20 @@
+2021-04-05  Peng Liu  
+
+[GPUP][iPad] Audio only when airplaying a youtube video
+https://bugs.webkit.org/show_bug.cgi?id=224132
+
+Reviewed by Eric Carlson.
+
+While `MediaPlayerPrivateAVFoundationObjC` only implements `setWirelessPlaybackTarget()`
+on macOS, `MediaPlayerPrivateMediaSourceAVFObjC` implements it on both macOS and iOS.
+Therefore, `RemoteMediaPlayerProxy` has to forward the calls of `setWirelessPlaybackTarget()`
+from WebContent processes to "MediaPlayerPrivate*" on both macOS and iOS.
+
+Manually tested.
+
+* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+(WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget):
+
 2021-04-02  Jer Noble  
 
 [GPUP] Power regression: audio hardware is configured for 128 frame preferred buffer size during VideoAudio playback


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp (275450 => 275451)

--- trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-04-02 23:27:29 UTC (rev 275450)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp	2021-04-05 23:43:41 UTC (rev 275451)
@@ -699,21 +699,21 @@
 
 void RemoteMediaPlayerProxy::setWirelessPlaybackTarget(const WebCore::MediaPlaybackTargetContext& targetContext)
 {
-#if !PLATFORM(IOS_FAMILY)
 switch (targetContext.type()) {
 case MediaPlaybackTargetContext::AVOutputContextType:
 m_player->setWirelessPlaybackTarget(WebCore::MediaPlaybackTargetCocoa::create(targetContext.avOutputContext()));
 break;
+#if PLATFORM(MAC)
 case MediaPlaybackTargetContext::MockType:
 m_player->setWirelessPlaybackTarget(WebCore::MediaPlaybackTargetMock::create(targetContext.mockDeviceName(), targetContext.mockState()));
 break;
+#else
+case MediaPlaybackTargetContext::MockType:
+#endif
 case MediaPlaybackTargetContext::None:
 ASSERT_NOT_REACHED();
 break;
 }
-#else
-UNUSED_PARAM(targetContext);
-#endif
 }
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [275328] trunk/LayoutTests

2021-03-31 Thread peng . liu6
Title: [275328] trunk/LayoutTests








Revision 275328
Author peng.l...@apple.com
Date 2021-03-31 17:47:35 -0700 (Wed, 31 Mar 2021)


Log Message
[ macOS wk2 ] media/pip-video-going-into-fullscreen.html is a flakey timeout
https://bugs.webkit.org/show_bug.cgi?id=223762

Reviewed by Eric Carlson.

Fix a flaky test related to video fullscreen by:
1) Wait for a video presentation mode change to complete before moving to the next step in the test.
2) Request the video to exit fullscreen before `endTest()` (to avoid interference with other tests).

* media/pip-video-going-into-fullscreen-expected.txt:
* media/pip-video-going-into-fullscreen.html:
* platform/mac-wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/pip-video-going-into-fullscreen-expected.txt
trunk/LayoutTests/media/pip-video-going-into-fullscreen.html
trunk/LayoutTests/platform/mac-wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (275327 => 275328)

--- trunk/LayoutTests/ChangeLog	2021-04-01 00:39:46 UTC (rev 275327)
+++ trunk/LayoutTests/ChangeLog	2021-04-01 00:47:35 UTC (rev 275328)
@@ -1,3 +1,18 @@
+2021-03-31  Peng Liu  
+
+[ macOS wk2 ] media/pip-video-going-into-fullscreen.html is a flakey timeout
+https://bugs.webkit.org/show_bug.cgi?id=223762
+
+Reviewed by Eric Carlson.
+
+Fix a flaky test related to video fullscreen by:
+1) Wait for a video presentation mode change to complete before moving to the next step in the test.
+2) Request the video to exit fullscreen before `endTest()` (to avoid interference with other tests).
+
+* media/pip-video-going-into-fullscreen-expected.txt:
+* media/pip-video-going-into-fullscreen.html:
+* platform/mac-wk2/TestExpectations:
+
 2021-03-31  Cameron McCormack  
 
 Avoid creating any complex text runs when font-size is zero.


Modified: trunk/LayoutTests/media/pip-video-going-into-fullscreen-expected.txt (275327 => 275328)

--- trunk/LayoutTests/media/pip-video-going-into-fullscreen-expected.txt	2021-04-01 00:39:46 UTC (rev 275327)
+++ trunk/LayoutTests/media/pip-video-going-into-fullscreen-expected.txt	2021-04-01 00:47:35 UTC (rev 275328)
@@ -1,9 +1,14 @@
 Tests pip video going into fullscreen should exit pip
 
 Going into Picture-in-Picture
+EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
 EXPECTED (video.webkitPresentationMode == 'picture-in-picture') OK
 Going into Full Screen from Picture-in-Picture
+EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
+EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLVideoElement]') OK
 EXPECTED (video.webkitPresentationMode == 'fullscreen') OK
+EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
+Exited Full Screen
 END OF TEST
 


Modified: trunk/LayoutTests/media/pip-video-going-into-fullscreen.html (275327 => 275328)

--- trunk/LayoutTests/media/pip-video-going-into-fullscreen.html	2021-04-01 00:39:46 UTC (rev 275327)
+++ trunk/LayoutTests/media/pip-video-going-into-fullscreen.html	2021-04-01 00:47:35 UTC (rev 275328)
@@ -29,29 +29,38 @@
 
 consoleWrite("Going into Picture-in-Picture");
 video.addEventListener('webkitpresentationmodechanged', onfirstpresentationmodechanged);
-runWithKeyDown(function(){ video.webkitSetPresentationMode('picture-in-picture'); });
+runWithKeyDown(function() { video.webkitSetPresentationMode('picture-in-picture'); });
 }
 
-function onfirstpresentationmodechanged()
+async function onfirstpresentationmodechanged()
 {
+if (window.internals)
+await testExpectedEventually("internals.isChangingPresentationMode(video)", false, "==", 2000);
+
 testExpected("video.webkitPresentationMode", "picture-in-picture");
 video.removeEventListener('webkitpresentationmodechanged', onfirstpresentationmodechanged);
 
 consoleWrite("Going into Full Screen from Picture-in-Picture");
-video.addEventListener('webkitfullscreenchange', onfullscreenchange);
+video.addEventListener('webkitfullscreenchange', onbeginfullscreen, { once: true });
 video.addEventListener('webkitpresentationmodechanged', onsecondpresentationmodechanged);
-runWithKeyDown(function(){ video.webkitRequestFullscreen(); });
+runWithKeyDown(function() { video.webkitRequestFullscreen(); });
 }
 
-function onfullscreenchange()
+async function onbeginfullscreen()
 {
+if (window.internals)
+await testExpectedEventually("internals.isChangingPresentationMode(video)", false, "==", 2000);
+
 enteredFullscreen = true;
 if (exitedPIP)
 checkFinalState();
 }
 
-function onsecondpresentationmodechanged()
+  

[webkit-changes] [275235] trunk/Source

2021-03-30 Thread peng . liu6
Title: [275235] trunk/Source








Revision 275235
Author peng.l...@apple.com
Date 2021-03-30 14:23:22 -0700 (Tue, 30 Mar 2021)


Log Message
[GPUP] Add an IPC message to implement RemoteImageDecoderAVF::clearFrameBufferCache()
https://bugs.webkit.org/show_bug.cgi?id=223707

Reviewed by Youenn Fablet.

Source/WebCore:

No change in observable functionality.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
Export method `clearFrameBufferCache()` so that we can call it from WebKit.

Source/WebKit:

* GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
(WebKit::RemoteImageDecoderAVFProxy::deleteDecoder):
Replace `const ImageDecoderIdentifier&` with `ImageDecoderIdentifier`.
(WebKit::RemoteImageDecoderAVFProxy::encodedDataStatusChanged): Ditto.
(WebKit::RemoteImageDecoderAVFProxy::setExpectedContentSize): Ditto.
(WebKit::RemoteImageDecoderAVFProxy::setData): Ditto.
(WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex): Ditto.
(WebKit::RemoteImageDecoderAVFProxy::clearFrameBufferCache):
* GPUProcess/media/RemoteImageDecoderAVFProxy.h:
* GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:
Add IPC message `clearFrameBufferCache()`, and replace `uint32_t` with `size_t`
because IPC messages support it now.

* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
(WebKit::RemoteImageDecoderAVF::setData):
(WebKit::RemoteImageDecoderAVF::clearFrameBufferCache):
Implement the same behavior as `ImageDecoderAVFObjC::clearFrameBufferCache()`.
This change will reduce the peak memory usage.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (275234 => 275235)

--- trunk/Source/WebCore/ChangeLog	2021-03-30 21:14:52 UTC (rev 275234)
+++ trunk/Source/WebCore/ChangeLog	2021-03-30 21:23:22 UTC (rev 275235)
@@ -1,3 +1,15 @@
+2021-03-30  Peng Liu  
+
+[GPUP] Add an IPC message to implement RemoteImageDecoderAVF::clearFrameBufferCache()
+https://bugs.webkit.org/show_bug.cgi?id=223707
+
+Reviewed by Youenn Fablet.
+
+No change in observable functionality.
+
+* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
+Export method `clearFrameBufferCache()` so that we can call it from WebKit.
+
 2021-03-30  Antti Koivisto  
 
 Nullptr crash in applyCommonButtonPaddingToStyle


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h (275234 => 275235)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h	2021-03-30 21:14:52 UTC (rev 275234)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h	2021-03-30 21:23:22 UTC (rev 275235)
@@ -88,7 +88,7 @@
 WEBCORE_EXPORT void setExpectedContentSize(long long) final;
 WEBCORE_EXPORT void setData(SharedBuffer&, bool allDataReceived) final;
 bool isAllDataReceived() const final { return m_isAllDataReceived; }
-void clearFrameBufferCache(size_t) final;
+WEBCORE_EXPORT void clearFrameBufferCache(size_t) final;
 
 bool hasTrack() const { return !!m_track; }
 WEBCORE_EXPORT Vector frameInfos() const;


Modified: trunk/Source/WebKit/ChangeLog (275234 => 275235)

--- trunk/Source/WebKit/ChangeLog	2021-03-30 21:14:52 UTC (rev 275234)
+++ trunk/Source/WebKit/ChangeLog	2021-03-30 21:23:22 UTC (rev 275235)
@@ -1,3 +1,29 @@
+2021-03-30  Peng Liu  
+
+[GPUP] Add an IPC message to implement RemoteImageDecoderAVF::clearFrameBufferCache()
+https://bugs.webkit.org/show_bug.cgi?id=223707
+
+Reviewed by Youenn Fablet.
+
+* GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
+(WebKit::RemoteImageDecoderAVFProxy::deleteDecoder):
+Replace `const ImageDecoderIdentifier&` with `ImageDecoderIdentifier`.
+(WebKit::RemoteImageDecoderAVFProxy::encodedDataStatusChanged): Ditto.
+(WebKit::RemoteImageDecoderAVFProxy::setExpectedContentSize): Ditto.
+(WebKit::RemoteImageDecoderAVFProxy::setData): Ditto.
+(WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex): Ditto.
+(WebKit::RemoteImageDecoderAVFProxy::clearFrameBufferCache):
+* GPUProcess/media/RemoteImageDecoderAVFProxy.h:
+* GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:
+Add IPC message `clearFrameBufferCache()`, and replace `uint32_t` with `size_t`
+because IPC messages support it now.
+
+* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
+(WebKit::RemoteImageDecoderAVF::setData):
+(WebKit::RemoteImageDecoderAVF::clearFrameBufferCache):
+Implement the same behavior as 

[webkit-changes] [275225] trunk/Source/WebCore

2021-03-30 Thread peng . liu6
Title: [275225] trunk/Source/WebCore








Revision 275225
Author peng.l...@apple.com
Date 2021-03-30 12:14:56 -0700 (Tue, 30 Mar 2021)


Log Message
Rename MediaElementSession::playbackPermitted() to MediaElementSession::playbackStateChangePermitted()
https://bugs.webkit.org/show_bug.cgi?id=220939

Reviewed by Youenn Fablet.

A follow-up patch of r271870 to rename function `playbackPermitted()` and
the enum class `MediaPlaybackOperation`.

No new tests as there is no change in functionality.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::userGestureRequired const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::pause):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackStateChangePermitted const):
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
(WebCore::MediaElementSession::playbackPermitted const): Deleted.
* html/MediaElementSession.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/html/MediaElementSession.cpp
trunk/Source/WebCore/html/MediaElementSession.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (275224 => 275225)

--- trunk/Source/WebCore/ChangeLog	2021-03-30 19:06:46 UTC (rev 275224)
+++ trunk/Source/WebCore/ChangeLog	2021-03-30 19:14:56 UTC (rev 275225)
@@ -1,3 +1,35 @@
+2021-03-30  Peng Liu  
+
+Rename MediaElementSession::playbackPermitted() to MediaElementSession::playbackStateChangePermitted()
+https://bugs.webkit.org/show_bug.cgi?id=220939
+
+Reviewed by Youenn Fablet.
+
+A follow-up patch of r271870 to rename function `playbackPermitted()` and
+the enum class `MediaPlaybackOperation`.
+
+No new tests as there is no change in functionality.
+
+* Modules/mediacontrols/MediaControlsHost.cpp:
+(WebCore::MediaControlsHost::userGestureRequired const):
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
+(WebCore::HTMLMediaElement::setReadyState):
+(WebCore::HTMLMediaElement::play):
+(WebCore::HTMLMediaElement::pause):
+(WebCore::HTMLMediaElement::pauseInternal):
+(WebCore::HTMLMediaElement::setVolume):
+(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
+(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
+(WebCore::HTMLMediaElement::updateShouldPlay):
+
+* html/MediaElementSession.cpp:
+(WebCore::MediaElementSession::playbackStateChangePermitted const):
+(WebCore::MediaElementSession::canShowControlsManager const):
+(WebCore::MediaElementSession::updateMediaUsageIfChanged):
+(WebCore::MediaElementSession::playbackPermitted const): Deleted.
+* html/MediaElementSession.h:
+
 2021-03-30  Antoine Quint  
 
 Account for "hanging" and "each-line" when blending text-interpolation


Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (275224 => 275225)

--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2021-03-30 19:06:46 UTC (rev 275224)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2021-03-30 19:14:56 UTC (rev 275225)
@@ -265,7 +265,7 @@
 
 bool MediaControlsHost::userGestureRequired() const
 {
-return m_mediaElement && !m_mediaElement->mediaSession().playbackPermitted();
+return m_mediaElement && !m_mediaElement->mediaSession().playbackStateChangePermitted(MediaPlaybackState::Playing);
 }
 
 bool MediaControlsHost::shouldForceControlsDisplay() const


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (275224 => 275225)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-03-30 19:06:46 UTC (rev 275224)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-03-30 19:14:56 UTC (rev 275225)
@@ -2300,7 +2300,7 @@
 return MediaPlaybackDenialReason::PageConsentRequired;
 }
 
-auto permitted = mediaSession().playbackPermitted();
+auto permitted = mediaSession().playbackStateChangePermitted(MediaPlaybackState::Playing);
 #if !RELEASE_LOG_DISABLED
 if (!permitted)
 ALWAYS_LOG(LOGIDENTIFIER, permitted.value());
@@ -2434,7 +2434,7 @@
 
 // If we transition to the Future Data state and we're about to begin playing, ensure playback is actually permitted first,
 // honoring any playback denial reasons such as the requirement of a user gesture.
-if (m_readyState 

[webkit-changes] [275207] trunk/Source/WebKit

2021-03-30 Thread peng . liu6
Title: [275207] trunk/Source/WebKit








Revision 275207
Author peng.l...@apple.com
Date 2021-03-30 09:32:01 -0700 (Tue, 30 Mar 2021)


Log Message
[GPUP] Add "CodeComplete" attribute to some feature flags
https://bugs.webkit.org/show_bug.cgi?id=223907

Reviewed by Daniel Bates.

Add "CodeComplete" attribute for three feature flags:
- gpu_process_canvas_rendering
- gpu_process_media
- gpu_process_webrtc

Also replace tabs in the plist files with spaces.

* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-macos.plist:
* FeatureFlags/WebKit-watchos.plist:
* Scripts/combine-feature-flags-plist.py:
(main): Fix an issue to merge "attributes".

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist
trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist
trunk/Source/WebKit/FeatureFlags/WebKit-macos.plist
trunk/Source/WebKit/FeatureFlags/WebKit-watchos.plist
trunk/Source/WebKit/Scripts/combine-feature-flags-plist.py




Diff

Modified: trunk/Source/WebKit/ChangeLog (275206 => 275207)

--- trunk/Source/WebKit/ChangeLog	2021-03-30 16:31:21 UTC (rev 275206)
+++ trunk/Source/WebKit/ChangeLog	2021-03-30 16:32:01 UTC (rev 275207)
@@ -1,3 +1,24 @@
+2021-03-30  Peng Liu  
+
+[GPUP] Add "CodeComplete" attribute to some feature flags
+https://bugs.webkit.org/show_bug.cgi?id=223907
+
+Reviewed by Daniel Bates.
+
+Add "CodeComplete" attribute for three feature flags:
+- gpu_process_canvas_rendering
+- gpu_process_media
+- gpu_process_webrtc
+
+Also replace tabs in the plist files with spaces.
+
+* FeatureFlags/WebKit-appletvos.plist:
+* FeatureFlags/WebKit-ios.plist:
+* FeatureFlags/WebKit-macos.plist:
+* FeatureFlags/WebKit-watchos.plist:
+* Scripts/combine-feature-flags-plist.py:
+(main): Fix an issue to merge "attributes".
+
 2021-03-30  Jean-Yves Avenard  
 
 Now Playing content isn't updated when media session's Metadata is modified


Modified: trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist (275206 => 275207)

--- trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist	2021-03-30 16:31:21 UTC (rev 275206)
+++ trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist	2021-03-30 16:32:01 UTC (rev 275207)
@@ -2,85 +2,100 @@
 
 
 
-	async_frame_and_overflow_scrolling
-	
-		Enabled
-		
-	
-	gpu_process_canvas_rendering
-	
-		Enabled
-		
-	
-	gpu_process_dom_rendering
-	
-		Enabled
-		
-	
-	gpu_process_media
-	
-		Enabled
-		
-	
-	gpu_process_webgl
-	
-		Enabled
-		
-	
-	gpu_process_webrtc
-	
-		Enabled
-		
-	
-	InAppBrowserPrivacy
-	
-		Enabled
-		
-	
-	incremental_pdf
-	
-		Enabled
-		
-	
-	sw_vp9_decoder_on_battery
-	
-		Enabled
-		
-	
-	vp9_decoder
-	
-		Enabled
-		
-	
-	WebGL2
-	
-		Enabled
-		
-	
-	WebGPU
-	
-		Enabled
-		
-	
-	WebXR
-	
-		Enabled
-		
-	
-	webm_format_reader
-	
-		Enabled
-		
-	
-	webm_parser
-	
-		Enabled
-		
-	
-	RB_full_manage_WK_jetsam
-	
-		Enabled
-		
-	
+async_frame_and_overflow_scrolling
+
+Enabled
+
+
+gpu_process_canvas_rendering
+
+Enabled
+
+Attributes
+
+CodeComplete
+
+
+
+gpu_process_dom_rendering
+
+Enabled
+
+
+gpu_process_media
+
+Enabled
+
+Attributes
+
+CodeComplete
+
+
+
+gpu_process_webgl
+
+Enabled
+
+
+gpu_process_webrtc
+
+Enabled
+
+Attributes
+
+CodeComplete
+
+
+
+InAppBrowserPrivacy
+
+Enabled
+
+
+incremental_pdf
+
+Enabled
+
+
+sw_vp9_decoder_on_battery
+
+Enabled
+
+
+vp9_decoder
+
+Enabled
+
+
+WebGL2
+
+Enabled
+
+
+WebGPU
+
+Enabled
+
+
+WebXR
+
+Enabled
+
+
+webm_format_reader
+
+Enabled
+
+
+webm_parser
+
+Enabled
+
+
+RB_full_manage_WK_jetsam
+
+Enabled
+
+
 
 


Modified: trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist (275206 => 275207)

--- trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist	2021-03-30 16:31:21 UTC (rev 275206)
+++ trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist	2021-03-30 16:32:01 UTC (rev 275207)
@@ -2,85 +2,100 @@
 
 
 
-	async_frame_and_overflow_scrolling
-	
-		Enabled
-		
-	
-	gpu_process_canvas_rendering
-	
-		Enabled
-		
-	
-	gpu_process_dom_rendering
-	
-		Enabled
-		
-	
-	gpu_process_media
-	
-		Enabled
-		
-	
-	gpu_process_webgl
-	
-		Enabled
-		
-	
-	gpu_process_webrtc
-	
-		Enabled
-		
-	
-	InAppBrowserPrivacy
-	
-		Enabled
-		
-	
-	incremental_pdf
-	
-		Enabled
-		
-	
-	sw_vp9_decoder_on_battery
-	
-		Enabled
-		
-	
-	vp9_decoder
-	
-		

[webkit-changes] [274877] trunk/Source/WebCore

2021-03-23 Thread peng . liu6
Title: [274877] trunk/Source/WebCore








Revision 274877
Author peng.l...@apple.com
Date 2021-03-23 09:52:32 -0700 (Tue, 23 Mar 2021)


Log Message
Enable the quirk to disable firing "webkitendfullscreen" event when a video enters picture-in-picture from fullscreen on espn.com
https://bugs.webkit.org/show_bug.cgi?id=223610

Reviewed by Jer Noble.

A video element entering picture-in-picture from fullscreen will fire a "webkitendfullscreen"
event since r266728, but some sites (e.g., espn.com) do not handle the event properly.
Because they assume the video will resume to inline after exiting fullscreen.

This patch enables the quirk for espn.com to disable firing "webkitendfullscreen" event
in that scenario before they fix the issue in the event handler.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Quirks.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (274876 => 274877)

--- trunk/Source/WebCore/ChangeLog	2021-03-23 16:46:14 UTC (rev 274876)
+++ trunk/Source/WebCore/ChangeLog	2021-03-23 16:52:32 UTC (rev 274877)
@@ -1,3 +1,20 @@
+2021-03-23  Peng Liu  
+
+Enable the quirk to disable firing "webkitendfullscreen" event when a video enters picture-in-picture from fullscreen on espn.com
+https://bugs.webkit.org/show_bug.cgi?id=223610
+
+Reviewed by Jer Noble.
+
+A video element entering picture-in-picture from fullscreen will fire a "webkitendfullscreen"
+event since r266728, but some sites (e.g., espn.com) do not handle the event properly.
+Because they assume the video will resume to inline after exiting fullscreen.
+
+This patch enables the quirk for espn.com to disable firing "webkitendfullscreen" event
+in that scenario before they fix the issue in the event handler.
+
+* page/Quirks.cpp:
+(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):
+
 2021-03-23  Chris Dumez  
 
 dom/WheelEvent.cpp:47:58: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself


Modified: trunk/Source/WebCore/page/Quirks.cpp (274876 => 274877)

--- trunk/Source/WebCore/page/Quirks.cpp	2021-03-23 16:46:14 UTC (rev 274876)
+++ trunk/Source/WebCore/page/Quirks.cpp	2021-03-23 16:52:32 UTC (rev 274877)
@@ -1388,6 +1388,9 @@
 if (!m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk) {
 auto host = m_document->topDocument().url().host();
 m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk = equalLettersIgnoringASCIICase(host, "trailers.apple.com");
+
+auto domain = RegistrableDomain(m_document->topDocument().url());
+m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk = m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk || domain == "espn.com"_s;
 }
 
 return *m_shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274840] trunk/LayoutTests

2021-03-22 Thread peng . liu6
Title: [274840] trunk/LayoutTests








Revision 274840
Author peng.l...@apple.com
Date 2021-03-22 21:15:32 -0700 (Mon, 22 Mar 2021)


Log Message
REGRESSION (r272842): security/contentSecurityPolicy/video-with-data-url-allowed-by-media-src-star.html is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=222840

Unreviewed test gardening.

* platform/ios-device/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios-device/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (274839 => 274840)

--- trunk/LayoutTests/ChangeLog	2021-03-23 03:23:44 UTC (rev 274839)
+++ trunk/LayoutTests/ChangeLog	2021-03-23 04:15:32 UTC (rev 274840)
@@ -1,3 +1,12 @@
+2021-03-22  Peng Liu  
+
+REGRESSION (r272842): security/contentSecurityPolicy/video-with-data-url-allowed-by-media-src-star.html is consistently failing
+https://bugs.webkit.org/show_bug.cgi?id=222840
+
+Unreviewed test gardening.
+
+* platform/ios-device/TestExpectations:
+
 2021-03-22  Chris Fleizach  
 
 AX: textRectsFromMarkers always fails


Modified: trunk/LayoutTests/platform/ios-device/TestExpectations (274839 => 274840)

--- trunk/LayoutTests/platform/ios-device/TestExpectations	2021-03-23 03:23:44 UTC (rev 274839)
+++ trunk/LayoutTests/platform/ios-device/TestExpectations	2021-03-23 04:15:32 UTC (rev 274840)
@@ -119,10 +119,6 @@
 
 scrollbars/overflow-scrollbar-combinations.html [ Timeout ]
 
-security/contentSecurityPolicy/video-with-data-url-allowed-by-media-src-star.html [ ImageOnlyFailure ]
-
-security/contentSecurityPolicy/video-with-data-url-allowed-by-media-src-star.html [ ImageOnlyFailure ]
-
 # , need to handle media sandbox correctly
 webrtc
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274820] trunk/LayoutTests

2021-03-22 Thread peng . liu6
Title: [274820] trunk/LayoutTests








Revision 274820
Author peng.l...@apple.com
Date 2021-03-22 17:02:52 -0700 (Mon, 22 Mar 2021)


Log Message
[ macOS wk2 ] media/media-source/media-source-canplaythrough-event.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=223012

Unreviewed test gardening.

This flaky test failure has been fixed by r274591 and r274731.

* platform/mac-wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac-wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (274819 => 274820)

--- trunk/LayoutTests/ChangeLog	2021-03-22 23:57:35 UTC (rev 274819)
+++ trunk/LayoutTests/ChangeLog	2021-03-23 00:02:52 UTC (rev 274820)
@@ -1,5 +1,16 @@
 2021-03-22  Peng Liu  
 
+[ macOS wk2 ] media/media-source/media-source-canplaythrough-event.html is a flakey text failure
+https://bugs.webkit.org/show_bug.cgi?id=223012
+
+Unreviewed test gardening.
+
+This flaky test failure has been fixed by r274591 and r274731.
+
+* platform/mac-wk2/TestExpectations:
+
+2021-03-22  Peng Liu  
+
 [GPUP] Add a "wallTime" field to struct RemoteMediaPlayerState
 https://bugs.webkit.org/show_bug.cgi?id=223523
 


Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (274819 => 274820)

--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-03-22 23:57:35 UTC (rev 274819)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-03-23 00:02:52 UTC (rev 274820)
@@ -1330,8 +1330,6 @@
 
 webkit.org/b/221011 fast/selectors/selection-window-inactive-text-shadow.html [ Pass ImageOnlyFailure ]
 
-webkit.org/b/223012 media/media-source/media-source-canplaythrough-event.html [ Pass Failure ]
-
 webkit.org/b/223014 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/media_fragment_seek.html [ Pass Failure ]
 
 webkit.org/b/10 imported/w3c/web-platform-tests/media-source/SourceBuffer-abort-updating.html [ Pass Failure ]
@@ -1369,4 +1367,4 @@
 # webkit.org/b/223488 The following three tests are flakey failing only on Apple Silicon.
 [ arm64 ] http/wpt/beacon/cors/cors-preflight-blob-failure.html [ Pass Failure ]
 [ arm64 ] http/wpt/beacon/cors/cors-preflight-blob-success.html [ Pass Failure ]
-[ arm64 ] http/wpt/beacon/cors/cors-preflight-redirect-success.html [ Pass Failure ]
\ No newline at end of file
+[ arm64 ] http/wpt/beacon/cors/cors-preflight-redirect-success.html [ Pass Failure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274816] trunk

2021-03-22 Thread peng . liu6
Title: [274816] trunk








Revision 274816
Author peng.l...@apple.com
Date 2021-03-22 16:26:23 -0700 (Mon, 22 Mar 2021)


Log Message
[GPUP] Add a "wallTime" field to struct RemoteMediaPlayerState
https://bugs.webkit.org/show_bug.cgi?id=223523

Reviewed by Eric Carlson.

Source/WebCore:

No new tests. Fix test failures:
- media/video-controller-child-rate.html
- media/media-controller-unpause.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::currentMediaTime const): A minor fix for the comment.

Source/WebKit:

Function `MediaPlayerPrivateRemote::currentMediaTime()` returns the
current media time in the cached state, which is not the "current"
media time of the media player. This patch adds a "wallTime" field
to struct `RemoteMediaPlayerState`, so that `MediaPlayerPrivateRemote`
can adjust the `currentTime` in the cached state based on `m_rate`
and `WallTime::now()` and returns a more accurate value.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged):
(WebKit::RemoteMediaPlayerProxy::updateCachedState):
(WebKit::RemoteMediaPlayerProxy::performTaskAtMediaTime):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::pause):
(WebKit::MediaPlayerPrivateRemote::currentMediaTime const):
(WebKit::MediaPlayerPrivateRemote::playbackStateChanged):
(WebKit::MediaPlayerPrivateRemote::updateCachedState):
(WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:

* WebProcess/GPU/media/RemoteMediaPlayerState.h:
(WebKit::RemoteMediaPlayerState::encode const):
(WebKit::RemoteMediaPlayerState::decode):

LayoutTests:

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerState.h




Diff

Modified: trunk/LayoutTests/ChangeLog (274815 => 274816)

--- trunk/LayoutTests/ChangeLog	2021-03-22 23:26:01 UTC (rev 274815)
+++ trunk/LayoutTests/ChangeLog	2021-03-22 23:26:23 UTC (rev 274816)
@@ -1,3 +1,12 @@
+2021-03-22  Peng Liu  
+
+[GPUP] Add a "wallTime" field to struct RemoteMediaPlayerState
+https://bugs.webkit.org/show_bug.cgi?id=223523
+
+Reviewed by Eric Carlson.
+
+* platform/wk2/TestExpectations:
+
 2021-03-22  Amir Mark Jr  
 
 [MacOS Wk1] imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html is a flakey failure


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274815 => 274816)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-22 23:26:01 UTC (rev 274815)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-22 23:26:23 UTC (rev 274816)
@@ -225,8 +225,6 @@
 
 # webkit.org/b/221693
 media/encrypted-media/clearKey/clearKey-session-life-cycle.html [ Failure Crash ]
-media/media-controller-unpause.html [ Timeout ]
-media/video-controller-child-rate.html [ Failure Pass ]
 
 # webkit.org/b/220805
 webaudio/Panner/hrtf-database.html [ Timeout ]


Modified: trunk/Source/WebCore/ChangeLog (274815 => 274816)

--- trunk/Source/WebCore/ChangeLog	2021-03-22 23:26:01 UTC (rev 274815)
+++ trunk/Source/WebCore/ChangeLog	2021-03-22 23:26:23 UTC (rev 274816)
@@ -1,3 +1,17 @@
+2021-03-22  Peng Liu  
+
+[GPUP] Add a "wallTime" field to struct RemoteMediaPlayerState
+https://bugs.webkit.org/show_bug.cgi?id=223523
+
+Reviewed by Eric Carlson.
+
+No new tests. Fix test failures:
+- media/video-controller-child-rate.html
+- media/media-controller-unpause.html
+
+* html/HTMLMediaElement.cpp:
+(WebCore::HTMLMediaElement::currentMediaTime const): A minor fix for the comment.
+
 2021-03-22  Rob Buis  
 
 Enable ability to prevent scrolling in Element.focus()


Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (274815 => 274816)

--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-03-22 23:26:01 UTC (rev 274815)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-03-22 23:26:23 UTC (rev 274816)
@@ -3170,7 +3170,7 @@
 return m_cachedTime;
 }
 
-// Is it too soon use a cached time?
+// Is it too soon to use a cached 

[webkit-changes] [274731] trunk

2021-03-19 Thread peng . liu6
Title: [274731] trunk








Revision 274731
Author peng.l...@apple.com
Date 2021-03-19 12:21:17 -0700 (Fri, 19 Mar 2021)


Log Message
[GPUP] Test imported/w3c/web-platform-tests/fetch/range/general.window.html fails when media in GPU process is enabled.
https://bugs.webkit.org/show_bug.cgi?id=221817

Reviewed by Jer Noble.

Source/WebKit:

The `didLoadingProgress()` function of `MediaPlayerPrivateAVFoundation`
and `MediaPlayerPrivateMediaSourceAVFObjC` changes their mutable member
variables, so a caller (e.g., RemoteMediaPlayerProxy::didLoadingProgress())
will get false eventually if it calls the function repeatedly. As a result,
`MediaPlayerPrivateRemote::didLoadingProgress()` will always return false.
This patch fixes this issue with a new synchronous message in `RemoteMediaPlayerProxy`.

No new tests. Fix a test failure.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::didLoadingProgress):
(WebKit::RemoteMediaPlayerProxy::updateCachedState):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::didLoadingProgress const):
(WebKit::MediaPlayerPrivateRemote::updateCachedState):
* WebProcess/GPU/media/RemoteMediaPlayerState.h:
(WebKit::RemoteMediaPlayerState::encode const):
(WebKit::RemoteMediaPlayerState::decode):

LayoutTests:

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerState.h




Diff

Modified: trunk/LayoutTests/ChangeLog (274730 => 274731)

--- trunk/LayoutTests/ChangeLog	2021-03-19 19:00:45 UTC (rev 274730)
+++ trunk/LayoutTests/ChangeLog	2021-03-19 19:21:17 UTC (rev 274731)
@@ -1,3 +1,12 @@
+2021-03-19  Peng Liu  
+
+[GPUP] Test imported/w3c/web-platform-tests/fetch/range/general.window.html fails when media in GPU process is enabled.
+https://bugs.webkit.org/show_bug.cgi?id=221817
+
+Reviewed by Jer Noble.
+
+* platform/wk2/TestExpectations:
+
 2021-03-19  ChangSeok Oh  
 
 Animated AVIF support


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274730 => 274731)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-19 19:00:45 UTC (rev 274730)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-19 19:21:17 UTC (rev 274731)
@@ -239,8 +239,6 @@
 
 webkit.org/b/221816 http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html [ Failure ]
 
-webkit.org/b/221817 imported/w3c/web-platform-tests/fetch/range/general.window.html [ Failure ]
-
 webkit.org/b/221819 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html [ Failure ]
 
 webkit.org/b/222569 fast/mediastream/media-stream-track-interrupted.html [ Crash Pass ]


Modified: trunk/Source/WebKit/ChangeLog (274730 => 274731)

--- trunk/Source/WebKit/ChangeLog	2021-03-19 19:00:45 UTC (rev 274730)
+++ trunk/Source/WebKit/ChangeLog	2021-03-19 19:21:17 UTC (rev 274731)
@@ -1,3 +1,31 @@
+2021-03-19  Peng Liu  
+
+[GPUP] Test imported/w3c/web-platform-tests/fetch/range/general.window.html fails when media in GPU process is enabled.
+https://bugs.webkit.org/show_bug.cgi?id=221817
+
+Reviewed by Jer Noble.
+
+The `didLoadingProgress()` function of `MediaPlayerPrivateAVFoundation`
+and `MediaPlayerPrivateMediaSourceAVFObjC` changes their mutable member
+variables, so a caller (e.g., RemoteMediaPlayerProxy::didLoadingProgress())
+will get false eventually if it calls the function repeatedly. As a result,
+`MediaPlayerPrivateRemote::didLoadingProgress()` will always return false.
+This patch fixes this issue with a new synchronous message in `RemoteMediaPlayerProxy`.
+
+No new tests. Fix a test failure.
+
+* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+(WebKit::RemoteMediaPlayerProxy::didLoadingProgress):
+(WebKit::RemoteMediaPlayerProxy::updateCachedState):
+* GPUProcess/media/RemoteMediaPlayerProxy.h:
+* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+(WebKit::MediaPlayerPrivateRemote::didLoadingProgress const):
+(WebKit::MediaPlayerPrivateRemote::updateCachedState):
+* WebProcess/GPU/media/RemoteMediaPlayerState.h:
+(WebKit::RemoteMediaPlayerState::encode const):
+(WebKit::RemoteMediaPlayerState::decode):
+
 2021-03-19  Antti Koivisto  
 
 Reduce the number of 

[webkit-changes] [274614] trunk

2021-03-17 Thread peng . liu6
Title: [274614] trunk








Revision 274614
Author peng.l...@apple.com
Date 2021-03-17 22:20:19 -0700 (Wed, 17 Mar 2021)


Log Message
[GPUP] WebGL2RenderingContext::texImage2D() does not work with a video as the image source
https://bugs.webkit.org/show_bug.cgi?id=223294

Reviewed by Eric Carlson.

Source/WebKit:

No new tests. Fix a test failure.

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::updateCachedState):
Add a missing piece to implement `MediaPlayerPrivateRemote::videoPlaybackQualityMetrics()`.

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt:
* platform/mac/media/media-source/videoplaybackquality-decompressionsession.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt
trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession.html
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (274613 => 274614)

--- trunk/LayoutTests/ChangeLog	2021-03-18 04:38:37 UTC (rev 274613)
+++ trunk/LayoutTests/ChangeLog	2021-03-18 05:20:19 UTC (rev 274614)
@@ -1,3 +1,14 @@
+2021-03-17  Peng Liu  
+
+[GPUP] WebGL2RenderingContext::texImage2D() does not work with a video as the image source
+https://bugs.webkit.org/show_bug.cgi?id=223294
+
+Reviewed by Eric Carlson.
+
+* platform/mac/TestExpectations:
+* platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt:
+* platform/mac/media/media-source/videoplaybackquality-decompressionsession.html:
+
 2021-03-17  Lauro Moura  
 
 [GLIB] Gardening more consistent failures


Modified: trunk/LayoutTests/platform/mac/TestExpectations (274613 => 274614)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-03-18 04:38:37 UTC (rev 274613)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-03-18 05:20:19 UTC (rev 274614)
@@ -865,8 +865,6 @@
 webkit.org/b/161725 imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html [ Skip ]
 webkit.org/b/214166 imported/w3c/web-platform-tests/media-source/idlharness.window.html [ Skip ]
 
-webkit.org/b/223294 platform/mac/media/media-source/videoplaybackquality-decompressionsession.html [ Failure ]
-
 # Requires WebM
 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html [ Skip ]
 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-av-audio-bitrate.html [ Skip ]


Modified: trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt (274613 => 274614)

--- trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt	2021-03-18 04:38:37 UTC (rev 274613)
+++ trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession-expected.txt	2021-03-18 05:20:19 UTC (rev 274614)
@@ -6,6 +6,7 @@
 EVENT(update)
 RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0)))
 EVENT(update)
+EVENT(resize)
 RUN(canvas = document.createElement("canvas"))
 RUN(gl = canvas.getContext("webgl"))
 RUN(texture = gl.createTexture())


Modified: trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession.html (274613 => 274614)

--- trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession.html	2021-03-18 04:38:37 UTC (rev 274613)
+++ trunk/LayoutTests/platform/mac/media/media-source/videoplaybackquality-decompressionsession.html	2021-03-18 05:20:19 UTC (rev 274614)
@@ -32,6 +32,10 @@
 }
 
 function mediaSegmentAppended() {
+waitForEventOn(video, 'resize', videoFrameAvailable, false, true);
+}
+
+function videoFrameAvailable() {
 run('canvas = document.createElement("canvas")');
 run('gl = canvas.getContext("webgl")');
 run('texture = gl.createTexture()');
@@ -46,12 +50,14 @@
 video.addEventListener('timeupdate', timeupdate);
 }
 
-function timeupdate() {
+async function timeupdate() {
 if (video.currentTime == 0)
 return;
 
+// There could be a delay that a video element gets the VideoPlaybackQualityMetrics
+// from its media player (refer to RemoteMediaPlayerProxy::startUpdateCachedStateMessageTimer()).
 consoleWrite('EVENT(timeupdate)');
-testExpected('video.getVideoPlaybackQuality().totalVideoFrames', '0', '>');
+await testExpectedEventually('video.getVideoPlaybackQuality().totalVideoFrames', '0', '>');
 endTest();
 }
 


Modified: trunk/Source/WebKit/ChangeLog (274613 => 274614)

--- trunk/Source/WebKit/ChangeLog	2021-03-18 04:38:37 UTC (rev 274613)
+++ 

[webkit-changes] [274591] trunk

2021-03-17 Thread peng . liu6
Title: [274591] trunk








Revision 274591
Author peng.l...@apple.com
Date 2021-03-17 14:25:42 -0700 (Wed, 17 Mar 2021)


Log Message
[GPUP] Some media-source tests fail/timeout when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221686

Reviewed by Jer Noble.

Source/WebKit:

For a `MediaPlayerPrivateRemote`, if it is owned by a video element with a reference
to a `MediaSource`, it needs to use the duration information from the `MediaSource`.

Covered by existing tests.

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::durationMediaTime const):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/MediaSourcePrivateRemote.h:

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
trunk/Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h




Diff

Modified: trunk/LayoutTests/ChangeLog (274590 => 274591)

--- trunk/LayoutTests/ChangeLog	2021-03-17 21:24:30 UTC (rev 274590)
+++ trunk/LayoutTests/ChangeLog	2021-03-17 21:25:42 UTC (rev 274591)
@@ -1,3 +1,12 @@
+2021-03-17  Peng Liu  
+
+[GPUP] Some media-source tests fail/timeout when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221686
+
+Reviewed by Jer Noble.
+
+* platform/mac/TestExpectations:
+
 2021-03-17  Eric Carlson  
 
 [GPUP] media/video-set-rate-from-pause.html fails


Modified: trunk/LayoutTests/platform/mac/TestExpectations (274590 => 274591)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-03-17 21:24:30 UTC (rev 274590)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-03-17 21:25:42 UTC (rev 274591)
@@ -865,10 +865,7 @@
 webkit.org/b/161725 imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html [ Skip ]
 webkit.org/b/214166 imported/w3c/web-platform-tests/media-source/idlharness.window.html [ Skip ]
 
-# webkit.org/b/221686
-imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions.html [ Failure ]
-imported/w3c/web-platform-tests/media-source/mediasource-remove.html [ Failure ]
-platform/mac/media/media-source/videoplaybackquality-decompressionsession.html [ Failure ]
+webkit.org/b/223294 platform/mac/media/media-source/videoplaybackquality-decompressionsession.html [ Failure ]
 
 # Requires WebM
 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html [ Skip ]


Modified: trunk/Source/WebKit/ChangeLog (274590 => 274591)

--- trunk/Source/WebKit/ChangeLog	2021-03-17 21:24:30 UTC (rev 274590)
+++ trunk/Source/WebKit/ChangeLog	2021-03-17 21:25:42 UTC (rev 274591)
@@ -1,3 +1,20 @@
+2021-03-17  Peng Liu  
+
+[GPUP] Some media-source tests fail/timeout when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221686
+
+Reviewed by Jer Noble.
+
+For a `MediaPlayerPrivateRemote`, if it is owned by a video element with a reference
+to a `MediaSource`, it needs to use the duration information from the `MediaSource`.
+
+Covered by existing tests.
+
+* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+(WebKit::MediaPlayerPrivateRemote::durationMediaTime const):
+* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
+* WebProcess/GPU/media/MediaSourcePrivateRemote.h:
+
 2021-03-17  Aditya Keerthi  
 
 [iOS] Refactor WKFileUploadPanel to use UniformTypeIdentifiers


Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp (274590 => 274591)

--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp	2021-03-17 21:24:30 UTC (rev 274590)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp	2021-03-17 21:25:42 UTC (rev 274591)
@@ -236,6 +236,16 @@
 connection().send(Messages::RemoteMediaPlayerProxy::SetPrivateBrowsingMode(privateMode), m_id);
 }
 
+MediaTime MediaPlayerPrivateRemote::durationMediaTime() const
+{
+#if ENABLE(MEDIA_SOURCE)
+if (m_mediaSourcePrivate)
+return m_mediaSourcePrivate->duration();
+#endif
+
+return m_cachedState.duration;
+}
+
 MediaTime MediaPlayerPrivateRemote::currentMediaTime() const
 {
 return m_cachedState.currentTime;


Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h (274590 => 274591)

--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h	2021-03-17 21:24:30 UTC (rev 274590)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h	2021-03-17 21:25:42 UTC (rev 274591)
@@ -239,7 +239,7 @@
 
 void setVisible(bool) final;
 
-MediaTime durationMediaTime() const final { return m_cachedState.duration; }
+MediaTime durationMediaTime() const final;
 MediaTime 

[webkit-changes] [274563] trunk

2021-03-17 Thread peng . liu6
Title: [274563] trunk








Revision 274563
Author peng.l...@apple.com
Date 2021-03-17 10:06:08 -0700 (Wed, 17 Mar 2021)


Log Message
[GPUP] Some media-source tests fail/timeout when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221686

Reviewed by Eric Carlson.

Source/WebKit:

With "GPU Process: Media" enabled, a video element with a reference to a `MediaSource`
object will schedule a "resize" event after the source buffer scheduling an "update" event.
The root cause is that the `MediaPlayerPrivateRemote` does not notify its `HTMLMediaElement`
to change its ready state to HAVE_METADATA after the source buffer receives the initialization
segment (in `SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment()`).
The requirement is defined in section 3.5.7.6.2 of the specification:
[Initialization Segment Received](https://www.w3.org/TR/media-source/#sourcebuffer-init-segment-received).

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::setReadyState):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:

* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::setReadyState):

LayoutTests:

Fix the wrong description of a test.

* media/media-source/media-source-resize-expected.txt:
* media/media-source/media-source-resize.html:
* platform/gtk/media/media-source/media-source-resize-expected.txt:
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/media-source/media-source-resize-expected.txt
trunk/LayoutTests/media/media-source/media-source-resize.html
trunk/LayoutTests/platform/gtk/media/media-source/media-source-resize-expected.txt
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (274562 => 274563)

--- trunk/LayoutTests/ChangeLog	2021-03-17 16:53:47 UTC (rev 274562)
+++ trunk/LayoutTests/ChangeLog	2021-03-17 17:06:08 UTC (rev 274563)
@@ -1,3 +1,17 @@
+2021-03-17  Peng Liu  
+
+[GPUP] Some media-source tests fail/timeout when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221686
+
+Reviewed by Eric Carlson.
+
+Fix the wrong description of a test.
+
+* media/media-source/media-source-resize-expected.txt:
+* media/media-source/media-source-resize.html:
+* platform/gtk/media/media-source/media-source-resize-expected.txt:
+* platform/mac/TestExpectations:
+
 2021-03-17  Alexey Shvayka  
 
 [WebIDL] Fix convertRecord() to throw on enumerable symbol |key|


Modified: trunk/LayoutTests/media/media-source/media-source-resize-expected.txt (274562 => 274563)

--- trunk/LayoutTests/media/media-source/media-source-resize-expected.txt	2021-03-17 16:53:47 UTC (rev 274562)
+++ trunk/LayoutTests/media/media-source/media-source-resize-expected.txt	2021-03-17 17:06:08 UTC (rev 274563)
@@ -1,4 +1,4 @@
-This tests the ability of the SourceBuffer to reset the parser after an abort(). A SourceBuffer in this state should be able to accept a new initialization segment or a new media segment.
+This tests that a video element receives "resize" event correctly when we append initialization and media segment to its source buffer.
 
 RUN(video.src = ""
 EVENT(sourceopen)


Modified: trunk/LayoutTests/media/media-source/media-source-resize.html (274562 => 274563)

--- trunk/LayoutTests/media/media-source/media-source-resize.html	2021-03-17 16:53:47 UTC (rev 274562)
+++ trunk/LayoutTests/media/media-source/media-source-resize.html	2021-03-17 17:06:08 UTC (rev 274563)
@@ -1,7 +1,7 @@
 
 
 
-media-source-abort-resets-parser
+media-source-resize
 

[webkit-changes] [274551] trunk/Source/WebCore

2021-03-16 Thread peng . liu6
Title: [274551] trunk/Source/WebCore








Revision 274551
Author peng.l...@apple.com
Date 2021-03-16 21:22:06 -0700 (Tue, 16 Mar 2021)


Log Message
document pictureInPictureElement is null if you Enter Picture in Picture from contextual menu
https://bugs.webkit.org/show_bug.cgi?id=223125

Reviewed by Darin Adler.

Use HTMLVideoElement's functions to change video presentation mode to ensure that
document.pictureInPictureElement is updated properly and correct events are fired.

Covered by manual tests.

* html/HTMLVideoElement.cpp:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::enterFullscreenForVideo const):
(WebCore::HitTestResult::toggleEnhancedFullscreenForVideo const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLVideoElement.cpp
trunk/Source/WebCore/rendering/HitTestResult.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (274550 => 274551)

--- trunk/Source/WebCore/ChangeLog	2021-03-17 04:15:52 UTC (rev 274550)
+++ trunk/Source/WebCore/ChangeLog	2021-03-17 04:22:06 UTC (rev 274551)
@@ -1,3 +1,20 @@
+2021-03-16  Peng Liu  
+
+document pictureInPictureElement is null if you Enter Picture in Picture from contextual menu
+https://bugs.webkit.org/show_bug.cgi?id=223125
+
+Reviewed by Darin Adler.
+
+Use HTMLVideoElement's functions to change video presentation mode to ensure that
+document.pictureInPictureElement is updated properly and correct events are fired.
+
+Covered by manual tests.
+
+* html/HTMLVideoElement.cpp:
+* rendering/HitTestResult.cpp:
+(WebCore::HitTestResult::enterFullscreenForVideo const):
+(WebCore::HitTestResult::toggleEnhancedFullscreenForVideo const):
+
 2021-03-16  Tyler Wilcock  
 
 Add CSSValuePair.h in preparation for Pair.h refactor


Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (274550 => 274551)

--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2021-03-17 04:15:52 UTC (rev 274550)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2021-03-17 04:22:06 UTC (rev 274551)
@@ -203,7 +203,6 @@
 #endif // PLATFORM(IOS_FAMILY)
 }
 
-
 #if ENABLE(FULLSCREEN_API) && PLATFORM(IOS_FAMILY)
 void HTMLVideoElement::webkitRequestFullscreen()
 {


Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (274550 => 274551)

--- trunk/Source/WebCore/rendering/HitTestResult.cpp	2021-03-17 04:15:52 UTC (rev 274550)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp	2021-03-17 04:22:06 UTC (rev 274551)
@@ -473,7 +473,7 @@
 HTMLVideoElement& videoElement = downcast(*mediaElement);
 if (!videoElement.isFullscreen() && mediaElement->supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModeStandard)) {
 UserGestureIndicator indicator(ProcessingUserGesture, >document());
-videoElement.enterFullscreen();
+videoElement.webkitEnterFullscreen();
 }
 }
 #endif
@@ -783,10 +783,10 @@
 
 HTMLVideoElement& videoElement = downcast(*mediaElement);
 UserGestureIndicator indicator(ProcessingUserGesture, >document());
-if (videoElement.fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
-videoElement.exitFullscreen();
+if (videoElement.webkitPresentationMode() == HTMLVideoElement::VideoPresentationMode::PictureInPicture)
+videoElement.webkitSetPresentationMode(HTMLVideoElement::VideoPresentationMode::Inline);
 else
-videoElement.enterFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
+videoElement.webkitSetPresentationMode(HTMLVideoElement::VideoPresentationMode::PictureInPicture);
 #endif
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274493] trunk/LayoutTests

2021-03-16 Thread peng . liu6
Title: [274493] trunk/LayoutTests








Revision 274493
Author peng.l...@apple.com
Date 2021-03-16 10:55:37 -0700 (Tue, 16 Mar 2021)


Log Message
[GPUP] Some web audio WPT tests fail when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221696

Unreviewed test gardening.

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (274492 => 274493)

--- trunk/LayoutTests/ChangeLog	2021-03-16 17:43:28 UTC (rev 274492)
+++ trunk/LayoutTests/ChangeLog	2021-03-16 17:55:37 UTC (rev 274493)
@@ -1,5 +1,14 @@
 2021-03-16  Peng Liu  
 
+[GPUP] Some web audio WPT tests fail when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221696
+
+Unreviewed test gardening.
+
+* platform/wk2/TestExpectations:
+
+2021-03-16  Peng Liu  
+
 [GPUP] Some modern-media-controls tests are flaky when media in GPU Process is enabled
 https://bugs.webkit.org/show_bug.cgi?id=221685
 


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274492 => 274493)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 17:43:28 UTC (rev 274492)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 17:55:37 UTC (rev 274493)
@@ -237,7 +237,6 @@
 # webkit.org/b/221696
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/active-processing.https.html [ Failure ]
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html [ Failure ]
-imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html [ Failure ]
 
 webkit.org/b/221816 http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html [ Failure ]
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274492] trunk/LayoutTests

2021-03-16 Thread peng . liu6
Title: [274492] trunk/LayoutTests








Revision 274492
Author peng.l...@apple.com
Date 2021-03-16 10:43:28 -0700 (Tue, 16 Mar 2021)


Log Message
[GPUP] Some modern-media-controls tests are flaky when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221685

	Unreviewed test gardening.

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (274491 => 274492)

--- trunk/LayoutTests/ChangeLog	2021-03-16 17:41:40 UTC (rev 274491)
+++ trunk/LayoutTests/ChangeLog	2021-03-16 17:43:28 UTC (rev 274492)
@@ -1,3 +1,12 @@
+2021-03-16  Peng Liu  
+
+[GPUP] Some modern-media-controls tests are flaky when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221685
+
+	Unreviewed test gardening.
+
+* platform/wk2/TestExpectations:
+
 2021-03-16  Chris Gambrell  
 
 [LayoutTests] Convert http/tests/quicklook convert PHP to Python


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274491 => 274492)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 17:41:40 UTC (rev 274491)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 17:43:28 UTC (rev 274492)
@@ -215,7 +215,6 @@
 http/tests/media/hls/hls-progress.html [ Failure ]
 
 # webkit.org/b/221685
-media/modern-media-controls/media-controller/media-controller-auto-hide.html [ Crash Pass ]
 media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html [ Timeout Pass ]
 media/modern-media-controls/media-controller/media-controller-fullscreen-change.html [ Failure Pass ]
 media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html [ Timeout Pass ]
@@ -223,7 +222,6 @@
 media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html [ Failure Pass ]
 media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html [ Timeout Pass ]
 media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Timeout Pass ]
-media/modern-media-controls/seek-backward-support/seek-backward-support.html [ Timeout Pass ]
 
 # webkit.org/b/221693
 media/encrypted-media/clearKey/clearKey-session-life-cycle.html [ Failure Crash ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274487] trunk/Source/WebKit

2021-03-16 Thread peng . liu6
Title: [274487] trunk/Source/WebKit








Revision 274487
Author peng.l...@apple.com
Date 2021-03-16 10:08:33 -0700 (Tue, 16 Mar 2021)


Log Message
[iOS] Scroll event is fired before webkitfullscreenchange event when an element enters fullscreen
https://bugs.webkit.org/show_bug.cgi?id=223221

Reviewed by Eric Carlson.

Defer the "scroll" event until the "webkitfullscreenchange" event is fired
when an element enters fullscreen. We have to do that because some sites use
"scroll" event handler to remove elements out of visible area, which may
conflict with the entering fullscreen process.

No new tests. We cannot test this patch with a layout test because
`InjectedBundlePageFullScreenClient` in WKTR does not support testing the
fullscreen implementation in the UI process, which is related to the "scroll"
event. We cannot add an API test on iOS for it either because the test binary
is not a real "app" (webkit.org/b/212654).

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (274486 => 274487)

--- trunk/Source/WebKit/ChangeLog	2021-03-16 16:57:35 UTC (rev 274486)
+++ trunk/Source/WebKit/ChangeLog	2021-03-16 17:08:33 UTC (rev 274487)
@@ -1,3 +1,25 @@
+2021-03-16  Peng Liu  
+
+[iOS] Scroll event is fired before webkitfullscreenchange event when an element enters fullscreen
+https://bugs.webkit.org/show_bug.cgi?id=223221
+
+Reviewed by Eric Carlson.
+
+Defer the "scroll" event until the "webkitfullscreenchange" event is fired
+when an element enters fullscreen. We have to do that because some sites use
+"scroll" event handler to remove elements out of visible area, which may
+conflict with the entering fullscreen process.
+
+No new tests. We cannot test this patch with a layout test because
+`InjectedBundlePageFullScreenClient` in WKTR does not support testing the
+fullscreen implementation in the UI process, which is related to the "scroll"
+event. We cannot add an API test on iOS for it either because the test binary
+is not a real "app" (webkit.org/b/212654).
+
+* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+(-[WKFullScreenWindowController enterFullScreen]):
+(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+
 2021-03-16  Per Arne  
 
 Add signpost for injected bundle creation


Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm (274486 => 274487)

--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2021-03-16 16:57:35 UTC (rev 274486)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2021-03-16 17:08:33 UTC (rev 274487)
@@ -605,8 +605,6 @@
 
 [[_webViewPlaceholder layer] setContents:(id)[snapshotImage CGImage]];
 WebKit::replaceViewWithView(webView.get(), _webViewPlaceholder.get());
-
-WebKit::WKWebViewState().applyTo(webView.get());
 
 [webView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
 [webView setFrame:[_window bounds]];
@@ -680,6 +678,7 @@
 return;
 }
 
+WebKit::WKWebViewState().applyTo(webView.get());
 auto page = [self._webView _page];
 auto* manager = self._manager;
 if (page && manager) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [274422] trunk

2021-03-15 Thread peng . liu6
Title: [274422] trunk








Revision 274422
Author peng.l...@apple.com
Date 2021-03-15 09:08:10 -0700 (Mon, 15 Mar 2021)


Log Message
[GPUP][MSE] Add an IPC message to implement SourceBufferPrivateRemote::canSwitchToType()
https://bugs.webkit.org/show_bug.cgi?id=223152

Reviewed by Eric Carlson.

Source/WebKit:

Add a synchronous message to implement `SourceBufferPrivateRemote::canSwitchToType()`.

No new tests. This patch fixes a test failure.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::canSwitchToType):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::canSwitchToType):

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (274421 => 274422)

--- trunk/LayoutTests/ChangeLog	2021-03-15 15:20:36 UTC (rev 274421)
+++ trunk/LayoutTests/ChangeLog	2021-03-15 16:08:10 UTC (rev 274422)
@@ -1,3 +1,12 @@
+2021-03-15  Peng Liu  
+
+[GPUP][MSE] Add an IPC message to implement SourceBufferPrivateRemote::canSwitchToType()
+https://bugs.webkit.org/show_bug.cgi?id=223152
+
+Reviewed by Eric Carlson.
+
+* platform/mac/TestExpectations:
+
 2021-03-15  Zalan Bujtas  
 
 Fit-border-to-line may change the layout constraints between 2 paginated line layouts


Modified: trunk/LayoutTests/platform/mac/TestExpectations (274421 => 274422)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-03-15 15:20:36 UTC (rev 274421)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-03-15 16:08:10 UTC (rev 274422)
@@ -865,7 +865,6 @@
 webkit.org/b/214166 imported/w3c/web-platform-tests/media-source/idlharness.window.html [ Skip ]
 
 # webkit.org/b/221686
-imported/w3c/web-platform-tests/media-source/mediasource-changetype.html [ Failure ]
 imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions.html [ Failure ]
 imported/w3c/web-platform-tests/media-source/mediasource-remove.html [ Failure ]
 media/media-source/media-source-resize.html [ Timeout ]


Modified: trunk/Source/WebKit/ChangeLog (274421 => 274422)

--- trunk/Source/WebKit/ChangeLog	2021-03-15 15:20:36 UTC (rev 274421)
+++ trunk/Source/WebKit/ChangeLog	2021-03-15 16:08:10 UTC (rev 274422)
@@ -1,3 +1,21 @@
+2021-03-15  Peng Liu  
+
+[GPUP][MSE] Add an IPC message to implement SourceBufferPrivateRemote::canSwitchToType()
+https://bugs.webkit.org/show_bug.cgi?id=223152
+
+Reviewed by Eric Carlson.
+
+Add a synchronous message to implement `SourceBufferPrivateRemote::canSwitchToType()`.
+
+No new tests. This patch fixes a test failure.
+
+* GPUProcess/media/RemoteSourceBufferProxy.cpp:
+(WebKit::RemoteSourceBufferProxy::canSwitchToType):
+* GPUProcess/media/RemoteSourceBufferProxy.h:
+* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
+* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
+(WebKit::SourceBufferPrivateRemote::canSwitchToType):
+
 2021-03-15  Daniel Kolesa  
 
 [GLIB] Be more selective about bublewrapping libdirs


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp (274421 => 274422)

--- trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp	2021-03-15 15:20:36 UTC (rev 274421)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp	2021-03-15 16:08:10 UTC (rev 274422)
@@ -33,6 +33,7 @@
 #include "RemoteMediaPlayerProxy.h"
 #include "RemoteSourceBufferProxyMessages.h"
 #include "SourceBufferPrivateRemoteMessages.h"
+#include 
 #include 
 #include 
 
@@ -221,6 +222,11 @@
 m_sourceBufferPrivate->setActive(active);
 }
 
+void RemoteSourceBufferProxy::canSwitchToType(const ContentType& contentType, CompletionHandler&& completionHandler)
+{
+completionHandler(m_sourceBufferPrivate->canSwitchToType(contentType));
+}
+
 void RemoteSourceBufferProxy::setMode(WebCore::SourceBufferAppendMode appendMode)
 {
 m_sourceBufferPrivate->setMode(appendMode);


Modified: trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h (274421 => 274422)

--- trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h	2021-03-15 15:20:36 UTC (rev 274421)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h	2021-03-15 16:08:10 UTC (rev 274422)
@@ -44,6 +44,7 @@
 }
 
 namespace WebCore {
+class ContentType;
 class MediaSample;
 class PlatformTimeRanges;
 }
@@ -83,6 +84,7 @@
 bool didReceiveSyncMessage(IPC::Connection&, 

[webkit-changes] [274390] trunk

2021-03-13 Thread peng . liu6
Title: [274390] trunk








Revision 274390
Author peng.l...@apple.com
Date 2021-03-13 11:08:22 -0800 (Sat, 13 Mar 2021)


Log Message
[GPUP][MSE] MediaSource::buffered and MediaSource::activeSourceBuffers do not update in the same run loop as MediaSource::endOfStream()
https://bugs.webkit.org/show_bug.cgi?id=221293

Reviewed by Jer Noble.

Source/WebCore:

Currently, both `SourceBuffer` and `SourceBufferPrivate` own an `m_buffered`
and we need to synchronize them with a callback. When we run `SourceBufferPrivate`
in the GPU process, the synchronization might be delayed, e.g., function
`SourceBuffer::readyStateChanged()` will trigger an update to `m_buffered`
but its new value won't be available for the Web process in the same
run loop.

To fix this issue, this patch removes `SourceBuffer::m_buffered` as well
the callback to synchronize it. When we run `SourceBufferPrivate` in the GPU
process, `SourceBufferPrivateRemote` synchronizes its `m_buffered` with
`SourceBufferPrivate` through a synchronous IPC message.

No new tests. Fix a test failure:
- imported/w3c/web-platform-tests/media-source/mediasource-buffered.html

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::buffered const):
(WebCore::SourceBuffer::sourceBufferPrivateBufferedRangesChanged): Deleted.
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::setBufferedRanges):
(WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::buffered const):
* platform/graphics/SourceBufferPrivateClient.h:

Source/WebKit:

When a Web process needs to "pull" the latest value of `m_buffered` from the
GPU process (`updateBufferedFromTrackBuffers`), we need to use a synchronous
IPC message.

When the GPU process needs to "push" the latest value of `m_buffered` to
a Web process, we can use an asynchronous message, e.g, `RemoveCodedFrames`
and `SourceBufferPrivateAppendComplete`.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendComplete):
(WebKit::RemoteSourceBufferProxy::updateBufferedFromTrackBuffers):
(WebKit::RemoteSourceBufferProxy::removeCodedFrames):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedRangesChanged): Deleted.
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:

* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::updateBufferedFromTrackBuffers):
(WebKit::SourceBufferPrivateRemote::removeCodedFrames):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateAppendComplete):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateBufferedRangesChanged): Deleted.
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:
* WebProcess/GPU/media/SourceBufferPrivateRemote.messages.in:

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h
trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.messages.in




Diff

Modified: trunk/LayoutTests/ChangeLog (274389 => 274390)

--- trunk/LayoutTests/ChangeLog	2021-03-13 16:26:21 UTC (rev 274389)
+++ trunk/LayoutTests/ChangeLog	2021-03-13 19:08:22 UTC (rev 274390)
@@ -1,3 +1,12 @@
+2021-03-13  Peng Liu  
+
+[GPUP][MSE] MediaSource::buffered and MediaSource::activeSourceBuffers do not update in the same run loop as MediaSource::endOfStream()
+https://bugs.webkit.org/show_bug.cgi?id=221293
+
+Reviewed by Jer Noble.
+
+* platform/mac/TestExpectations:
+
 2021-03-13  Rob Buis  
 
 [css-flexbox] Fix incorrect relative path


Modified: trunk/LayoutTests/platform/mac/TestExpectations (274389 => 274390)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-03-13 16:26:21 UTC (rev 274389)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-03-13 19:08:22 UTC (rev 274390)
@@ -865,7 +865,6 @@
 webkit.org/b/214166 imported/w3c/web-platform-tests/media-source/idlharness.window.html [ Skip ]
 
 # webkit.org/b/221686
-imported/w3c/web-platform-tests/media-source/mediasource-buffered.html [ Failure ]
 

[webkit-changes] [274281] trunk/LayoutTests

2021-03-11 Thread peng . liu6
Title: [274281] trunk/LayoutTests








Revision 274281
Author peng.l...@apple.com
Date 2021-03-11 09:12:14 -0800 (Thu, 11 Mar 2021)


Log Message
[GPUP] Some modern-media-controls tests are flaky when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221685

Reviewed by Eric Carlson.

Fix two flaky tests related to video fullscreen by:
1) Enable "MockVideoPresentationMode".
2) Wait for a video presentation mode change to complete before moving to the next step in the test.
3) Request the video to exit fullscreen before finish the test (to avoid interference with other tests).

* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html:
* media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen-expected.txt:
* media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html:
* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt
trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html
trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen-expected.txt
trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (274280 => 274281)

--- trunk/LayoutTests/ChangeLog	2021-03-11 17:03:41 UTC (rev 274280)
+++ trunk/LayoutTests/ChangeLog	2021-03-11 17:12:14 UTC (rev 274281)
@@ -1,3 +1,22 @@
+2021-03-11  Peng Liu  
+
+[GPUP] Some modern-media-controls tests are flaky when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221685
+
+Reviewed by Eric Carlson.
+
+Fix two flaky tests related to video fullscreen by:
+1) Enable "MockVideoPresentationMode".
+2) Wait for a video presentation mode change to complete before moving to the next step in the test.
+3) Request the video to exit fullscreen before finish the test (to avoid interference with other tests).
+
+* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt:
+* media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html:
+* media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen-expected.txt:
+* media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html:
+* platform/mac/TestExpectations:
+* platform/wk2/TestExpectations:
+
 2021-03-11  Zalan Bujtas  
 
 Cleanup references to float and out-of-flow renderers before destroying them.


Modified: trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt (274280 => 274281)

--- trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt	2021-03-11 17:03:41 UTC (rev 274280)
+++ trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video-expected.txt	2021-03-11 17:12:14 UTC (rev 274281)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS media.webkitDisplayingFullscreen is true
+PASS internals.isChangingPresentationMode(media) became false
 PASS mediaController.controls.visible is true
 PASS successfullyParsed is true
 


Modified: trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html (274280 => 274281)

--- trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html	2021-03-11 17:03:41 UTC (rev 274280)
+++ trunk/LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html	2021-03-11 17:12:14 UTC (rev 274281)
@@ -10,6 +10,13 @@
 
 description("Testing that control are shown in fullscreen when the controls attribute is not present.");
 
+if (!window.internals) {
+debug("window.internals is not defined");
+finishJSTest();
+}
+
+internals.setMockVideoPresentationModeEnabled(true);
+
 const container = document.querySelector("div#host");
 const media = document.querySelector("video");
 const mediaController = 

[webkit-changes] [274264] trunk

2021-03-10 Thread peng . liu6
Title: [274264] trunk








Revision 274264
Author peng.l...@apple.com
Date 2021-03-10 18:40:35 -0800 (Wed, 10 Mar 2021)


Log Message
[GPU Process] Assertion under RenderLayerCompositor::computeCompositingRequirements()
https://bugs.webkit.org/show_bug.cgi?id=220375

Reviewed by Eric Carlson.

Source/WebCore:

`MediaPlayer` calls `HTMLMediaElement::mediaEngineWasUpdated()` when a media element
loads a new URL and `MediaPlayer::supportsAcceleratedRendering()` may change from
false to true at the same time. However, `HTMLMediaElement::mediaEngineWasUpdated()`
does not notify the renderer about the change in the same run loop. Instead, it
schedules a task to do that. This leads to a race condition that
`RenderLayerBacking::contentChanged(VideoChanged)` gets called after the compositing
update where `RenderLayerCompositor::canAccelerateVideoRendering()` returns true.
This happens because renderer checks `MediaPlayer::supportsAcceleratedRendering()`
in `RenderLayerCompositor::canAccelerateVideoRendering()`, which changes its value
when `MediaPlayer` calls `HTMLMediaElement::mediaEngineWasUpdated()`.

To fix this race condition, `HTMLMediaElement` needs to notify `RenderVideo` and
changes the `supportsAcceleratedRendering` property seen from renderer's perspective
in the same run loop. With this patch, `HTMLMediaElement` keeps a cached value of
`MediaPlayer::supportsAcceleratedRendering()`, and only updates its value when
`HTMLMediaElement` notifies the renderer. In addition, `RenderVideo` checks
`HTMLMediaElement::supportsAcceleratedRendering()` instead of
`MediaPlayer::supportsAcceleratedRendering()`, so that the renderer will
see the new value of `supportsAcceleratedRendering` and receive the content
change notification in the same run loop.

No new tests. Fix assertion failures in tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::supportsAcceleratedRendering const):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
(WebCore::RenderVideo::supportsAcceleratedRendering const):

Source/WebKit:

When "GPU Process: Media" is enabled, `MediaPlayer` will call `mediaPlayerEngineUpdated()`
three times when a media element tries to load a URL. The three calls happen at the
following time points:
1) `MediaPlayer` creates a `MediaPlayerPrivateRemote`.
2) `MediaPlayerPrivateRemote` receives the response of a "createMediaPlayer" message
from the GPU process and gets the initial configurations of the "remote" media player.
3) The `RemoteMediaPlayerProxy` creates a `MediaPlayerPrivate` in the GPU process and
notify the `MediaPlayerPrivateRemote` in the WebContent process.

The second call of `mediaPlayerEngineUpdated()` is unnecessary because the player's
configuration at that time is similar to `NullMediaPlayerPrivate`. This patch removes it.

For the third call of `mediaPlayerEngineUpdated()`, we have to make sure that
the `MediaPlayerPrivateRemote` has received the configuration update from the GPU
process before the call. Therefore, this patch removes the message
`MediaPlayerPrivateRemote::EngineUpdated`, and let `MediaPlayerPrivateRemote`
decide when to call `mediaPlayerEngineUpdated()`.

* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
The `playerConfiguration` is meaningless in this step so we can remove it.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated): Deleted.
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::prepareForPlayback):

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
(WebKit::MediaPlayerPrivateRemote::load):
(WebKit::MediaPlayerPrivateRemote::setConfiguration): Deleted.
(WebKit::MediaPlayerPrivateRemote::engineUpdated): Deleted.
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:

* WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

LayoutTests:

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/html/HTMLMediaElement.h
trunk/Source/WebCore/rendering/RenderVideo.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in

[webkit-changes] [274156] trunk

2021-03-09 Thread peng . liu6
Title: [274156] trunk








Revision 274156
Author peng.l...@apple.com
Date 2021-03-09 10:15:14 -0800 (Tue, 09 Mar 2021)


Log Message
[GPUP] Test fast/images/animated-image-mp4.html times out when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221795

Reviewed by Eric Carlson.

Source/WebCore:

No new tests. Fix test failures.

* platform/graphics/cocoa/IOSurface.h:
Add an empty line to make the comment clear.

* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
Fix an error in the attributes of a `VTDecompressionSession`.

Source/WebKit:

Pass the color space along with a `MachSendRight` created from an `IOSurface` to ensure
that we can recreate the image from the `MachSendRight`/`IOSurface` properly.

* GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
(WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex):
* GPUProcess/media/RemoteImageDecoderAVFProxy.h:
* GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:

* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
(WebKit::RemoteImageDecoderAVF::createFrameImageAtIndex):
This functions needs to return a valid image when it is called in the main thread,
otherwise, the animation will pause.

LayoutTests:

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h
trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h
trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in
trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (274155 => 274156)

--- trunk/LayoutTests/ChangeLog	2021-03-09 18:01:59 UTC (rev 274155)
+++ trunk/LayoutTests/ChangeLog	2021-03-09 18:15:14 UTC (rev 274156)
@@ -1,3 +1,12 @@
+2021-03-09  Peng Liu  
+
+[GPUP] Test fast/images/animated-image-mp4.html times out when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221795
+
+Reviewed by Eric Carlson.
+
+* platform/wk2/TestExpectations:
+
 2021-03-09  Youenn Fablet  
 
 MediaRecorder.requestData() not returning all captured media after a pause


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274155 => 274156)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-09 18:01:59 UTC (rev 274155)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-09 18:15:14 UTC (rev 274156)
@@ -247,10 +247,6 @@
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html [ Failure ]
 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html [ Failure ]
 
-# webkit.org/b/221795
-fast/images/animated-image-mp4.html [ Timeout ]
-fast/images/animated-image-mp4-crash.html [ Timeout ]
-
 webkit.org/b/221816 http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html [ Failure ]
 
 webkit.org/b/221817 imported/w3c/web-platform-tests/fetch/range/general.window.html [ Failure ]


Modified: trunk/Source/WebCore/ChangeLog (274155 => 274156)

--- trunk/Source/WebCore/ChangeLog	2021-03-09 18:01:59 UTC (rev 274155)
+++ trunk/Source/WebCore/ChangeLog	2021-03-09 18:15:14 UTC (rev 274156)
@@ -1,3 +1,19 @@
+2021-03-09  Peng Liu  
+
+[GPUP] Test fast/images/animated-image-mp4.html times out when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221795
+
+Reviewed by Eric Carlson.
+
+No new tests. Fix test failures.
+
+* platform/graphics/cocoa/IOSurface.h:
+Add an empty line to make the comment clear.
+
+* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
+(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
+Fix an error in the attributes of a `VTDecompressionSession`.
+
 2021-03-09  Megan Gardner  
 
 Hold onto AppHighlights and restore them once the page is loaded.


Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (274155 => 274156)

--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2021-03-09 18:01:59 UTC (rev 274155)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2021-03-09 18:15:14 UTC (rev 274156)
@@ -125,6 +125,7 @@
 // the surface, or an expensive GPU readback can result.
 WEBCORE_EXPORT RetainPtr createImage();
 WEBCORE_EXPORT static RetainPtr sinkIntoImage(std::unique_ptr);
+
 WEBCORE_EXPORT RetainPtr createPixelBuffer();
 
 #ifdef __OBJC__


Modified: trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm (274155 => 274156)

--- 

[webkit-changes] [274076] trunk

2021-03-08 Thread peng . liu6
Title: [274076] trunk








Revision 274076
Author peng.l...@apple.com
Date 2021-03-08 09:51:32 -0800 (Mon, 08 Mar 2021)


Log Message
[GPUP] Some media tests related to canvas fail when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221820

Reviewed by Jer Noble.

Source/WebCore:

When "GPU Process: Media" is enabled and "GPU Process: Canvas Rendering" is disabled,
`MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime()` will be called
to get native images (video frames) from a video player. This function will copy
pixel buffers from CoreVideo, and we may need to rotate the pixel buffers before
converting them to native images. The process to copy pixel buffers from CoreVideo
and rotate them is implemented in `MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer()`.
It rotates pixel buffers with an `ImageRotationSessionVT` object (`m_imageRotationSession`).

With the current implementation of `ImageRotationSessionVT`, we can rotate pixel buffers
with following two approaches:
- Construct an uninitialized instance, and call `ImageRotationSessionVT::rotate(
MediaSample&, const RotationProperties&, IsCGImageCompatible)`. The `rotate` function
will initialize the object if needed.
- Construct an instance with given rotation properties, size, pixel buffer format,
and CGImage compatibility, then call `ImageRotationSessionVT::rotate(CVPixelBufferRef)`.
When we call the `rotate` function, we need to make sure the pixel buffer's format
is consistent with the `ImageRotationSessionVT` instance. Otherwise, the rotation will
fail and the caller will get an empty pixel buffer (this bug).

In order to use the second approach in `MediaPlayerPrivateAVFoundationObjC`, we need to
figure out the pixel buffer format to construct an ImageRotationSessionVT instance.
But that can only be done after we get a pixel buffer from CoreVideo.

This patch refactors `ImageRotationSessionVT` to better support the aforementioned
second approach. `MediaPlayerPrivateAVFoundationObjC` constructs an `ImageRotationSessionVT`
instance without pixel buffer format, and the `ImageRotationSessionVT` instance
will figure out the pixel buffer format by itself and configures its `CVPixelBufferPool`
properly when we call `rotate` function.

No new tests. Fix a test failure:
- media/video-orientation-canvas.html

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::readTrackMetadata):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateRotationSession):
(WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
We have to update the image synchronously to ensure that the caller gets the correct image.

* platform/graphics/cv/ImageRotationSessionVT.h:
Remove isMatching() because it is not defined/used.
* platform/graphics/cv/ImageRotationSessionVT.mm:
(WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
(WebCore::ImageRotationSessionVT::initialize):
(WebCore::ImageRotationSessionVT::rotate):

* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):

LayoutTests:

* media/video-orientation-canvas.html:
* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/video-orientation-canvas.html
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h
trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm
trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm




Diff

Modified: trunk/LayoutTests/ChangeLog (274075 => 274076)

--- trunk/LayoutTests/ChangeLog	2021-03-08 17:27:13 UTC (rev 274075)
+++ trunk/LayoutTests/ChangeLog	2021-03-08 17:51:32 UTC (rev 274076)
@@ -1,3 +1,13 @@
+2021-03-08  Peng Liu  
+
+[GPUP] Some media tests related to canvas fail when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221820
+
+Reviewed by Jer Noble.
+
+* media/video-orientation-canvas.html:
+* platform/wk2/TestExpectations:
+
 2021-03-08  Chris Gambrell  
 
 REGRESSION: [iOS] http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html is failing


Modified: trunk/LayoutTests/media/video-orientation-canvas.html (274075 => 274076)

--- trunk/LayoutTests/media/video-orientation-canvas.html	2021-03-08 17:27:13 UTC (rev 274075)
+++ trunk/LayoutTests/media/video-orientation-canvas.html	2021-03-08 17:51:32 UTC (rev 274076)
@@ -65,7 +65,6 @@
 context.drawImage(video3, 0, 0);
 arraysAreApproximatelyEqual('context.getImageData(200, 237, 1, 1).data', redColor, 5);
 
-
   

[webkit-changes] [273933] trunk/LayoutTests

2021-03-04 Thread peng . liu6
Title: [273933] trunk/LayoutTests








Revision 273933
Author peng.l...@apple.com
Date 2021-03-04 16:45:13 -0800 (Thu, 04 Mar 2021)


Log Message
[GPUP] Some tests in imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements fail when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221697

Unreviewed test gardening.

Remove the tests which are consistently passing on bots from the test expectations.


* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (273932 => 273933)

--- trunk/LayoutTests/ChangeLog	2021-03-05 00:43:41 UTC (rev 273932)
+++ trunk/LayoutTests/ChangeLog	2021-03-05 00:45:13 UTC (rev 273933)
@@ -1,3 +1,14 @@
+2021-03-04  Peng Liu  
+
+[GPUP] Some tests in imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements fail when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221697
+
+Unreviewed test gardening.
+
+Remove the tests which are consistently passing on bots from the test expectations.
+
+* platform/wk2/TestExpectations:
+
 2021-03-04  Ryan Haddad  
 
 Unreivewed test gardening, remove failure expectation for some tests that are consistently passing.


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (273932 => 273933)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-05 00:43:41 UTC (rev 273932)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-05 00:45:13 UTC (rev 273933)
@@ -216,9 +216,6 @@
 http/tests/media/hls/hls-progress.html [ Failure ]
 http/tests/media/video-play-stall.html [ Failure ]
 
-# webkit.org/b/221697
-imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_progress_noautoplay.html [ Failure ]
-
 # webkit.org/b/221685
 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html [ Timeout Failure Pass ]
 media/modern-media-controls/fullscreen-support/fullscreen-support-press.html [ Timeout Pass ]
@@ -234,9 +231,6 @@
 media/modern-media-controls/seek-backward-support/seek-backward-support.html [ Timeout Pass ]
 http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html [ Timeout ]
 
-# webkit.org/b/221689
-media/picture-in-picture/picture-in-picture-api-pip-window.html [ Timeout Pass ]
-
 # webkit.org/b/221693
 media/encrypted-media/clearKey/clearKey-session-life-cycle.html [ Failure Crash ]
 media/media-controller-unpause.html [ Timeout ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [273914] trunk/LayoutTests

2021-03-04 Thread peng . liu6
Title: [273914] trunk/LayoutTests








Revision 273914
Author peng.l...@apple.com
Date 2021-03-04 13:00:51 -0800 (Thu, 04 Mar 2021)


Log Message
[GPUP] Some media tests are flaky when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221693

Unreviewed test gardening.

Remove the tests which are consistently passing on bots from the test expectations.


* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (273913 => 273914)

--- trunk/LayoutTests/ChangeLog	2021-03-04 20:42:52 UTC (rev 273913)
+++ trunk/LayoutTests/ChangeLog	2021-03-04 21:00:51 UTC (rev 273914)
@@ -1,3 +1,14 @@
+2021-03-04  Peng Liu  
+
+[GPUP] Some media tests are flaky when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221693
+
+Unreviewed test gardening.
+
+Remove the tests which are consistently passing on bots from the test expectations.
+
+* platform/wk2/TestExpectations:
+
 2021-03-04  Youenn Fablet  
 
 In case of POST navigation redirected by a 302, the 'Origin' header is kept in the redirected request


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (273913 => 273914)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-04 20:42:52 UTC (rev 273913)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-04 21:00:51 UTC (rev 273914)
@@ -238,13 +238,8 @@
 media/picture-in-picture/picture-in-picture-api-pip-window.html [ Timeout Pass ]
 
 # webkit.org/b/221693
-media/audio-playback-restriction-removed-track-enabled.html [ Timeout Pass ]
-media/controls/inline-elements-dropoff-order.html [ Failure Pass ]
 media/encrypted-media/clearKey/clearKey-session-life-cycle.html [ Failure Crash ]
-media/media-can-play-webm.html [ Failure ]
 media/media-controller-unpause.html [ Timeout ]
-media/track/track-cues-pause-on-exit.html [ Timeout Pass ]
-media/video-as-img-output-pts.html [ Timeout Pass ]
 media/video-controller-child-rate.html [ Failure Pass ]
 media/video-set-rate-from-pause.html [ Timeout Pass ]
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [273895] trunk

2021-03-04 Thread peng . liu6
Title: [273895] trunk








Revision 273895
Author peng.l...@apple.com
Date 2021-03-04 09:55:21 -0800 (Thu, 04 Mar 2021)


Log Message
[GPUProcess] MediaController is using a ClockCM
https://bugs.webkit.org/show_bug.cgi?id=222094

Reviewed by Eric Carlson.

Source/WebCore:

No new tests. Fix test failures.

* html/MediaController.cpp: Some minor clean-up.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
A minor clean-up.

Source/WebCore/PAL:

Remove `ClockCM` and use `ClockGeneric` instead because `ClockCM::currentTime()`
always returns NaN when "Media in GPU Process" is enabled.

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/system/mac/ClockCM.h: Removed.
* pal/system/mac/ClockCM.mm: Removed.

LayoutTests:

* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
trunk/Source/WebCore/PAL/pal/PlatformMac.cmake
trunk/Source/WebCore/html/MediaController.cpp
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h


Removed Paths

trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.h
trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.mm




Diff

Modified: trunk/LayoutTests/ChangeLog (273894 => 273895)

--- trunk/LayoutTests/ChangeLog	2021-03-04 17:49:24 UTC (rev 273894)
+++ trunk/LayoutTests/ChangeLog	2021-03-04 17:55:21 UTC (rev 273895)
@@ -1,3 +1,12 @@
+2021-03-04  Peng Liu  
+
+[GPUProcess] MediaController is using a ClockCM
+https://bugs.webkit.org/show_bug.cgi?id=222094
+
+Reviewed by Eric Carlson.
+
+* platform/wk2/TestExpectations:
+
 2021-03-04  Youenn Fablet  
 
 Handle the case of synchronous failure in loading blob.


Modified: trunk/LayoutTests/platform/wk2/TestExpectations (273894 => 273895)

--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-04 17:49:24 UTC (rev 273894)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-04 17:55:21 UTC (rev 273895)
@@ -242,13 +242,10 @@
 media/controls/inline-elements-dropoff-order.html [ Failure Pass ]
 media/encrypted-media/clearKey/clearKey-session-life-cycle.html [ Failure Crash ]
 media/media-can-play-webm.html [ Failure ]
-media/media-controller-time-constant.html [ Timeout ]
-media/media-controller-time.html [ Timeout ]
 media/media-controller-unpause.html [ Timeout ]
 media/track/track-cues-pause-on-exit.html [ Timeout Pass ]
 media/video-as-img-output-pts.html [ Timeout Pass ]
-media/video-controller-child-rate.html [ Timeout ]
-media/video-controller-currentTime-rate.html [ Failure ]
+media/video-controller-child-rate.html [ Failure Pass ]
 media/video-set-rate-from-pause.html [ Timeout Pass ]
 
 # webkit.org/b/220805


Modified: trunk/Source/WebCore/ChangeLog (273894 => 273895)

--- trunk/Source/WebCore/ChangeLog	2021-03-04 17:49:24 UTC (rev 273894)
+++ trunk/Source/WebCore/ChangeLog	2021-03-04 17:55:21 UTC (rev 273895)
@@ -1,3 +1,16 @@
+2021-03-04  Peng Liu  
+
+[GPUProcess] MediaController is using a ClockCM
+https://bugs.webkit.org/show_bug.cgi?id=222094
+
+Reviewed by Eric Carlson.
+
+No new tests. Fix test failures.
+
+* html/MediaController.cpp: Some minor clean-up.
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+A minor clean-up.
+
 2021-03-04  Youenn Fablet  
 
 AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices is unnecessarily creating a NSArray twice


Modified: trunk/Source/WebCore/PAL/ChangeLog (273894 => 273895)

--- trunk/Source/WebCore/PAL/ChangeLog	2021-03-04 17:49:24 UTC (rev 273894)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-03-04 17:55:21 UTC (rev 273895)
@@ -1,3 +1,18 @@
+2021-03-04  Peng Liu  
+
+[GPUProcess] MediaController is using a ClockCM
+https://bugs.webkit.org/show_bug.cgi?id=222094
+
+Reviewed by Eric Carlson.
+
+Remove `ClockCM` and use `ClockGeneric` instead because `ClockCM::currentTime()`
+always returns NaN when "Media in GPU Process" is enabled.
+
+* PAL.xcodeproj/project.pbxproj:
+* pal/PlatformMac.cmake:
+* pal/system/mac/ClockCM.h: Removed.
+* pal/system/mac/ClockCM.mm: Removed.
+
 2021-03-02  Youenn Fablet  
 
 Enable MEDIA_SOURCE in IOS Simulator


Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (273894 => 273895)

--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2021-03-04 17:49:24 UTC (rev 273894)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2021-03-04 17:55:21 UTC (rev 273895)
@@ -73,8 +73,6 @@
 		0C5AF9211F43A4C7002EAC02 /* SQLite3SPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF9171F43A4C7002EAC02 /* SQLite3SPI.h */; };
 		0C5AF9221F43A4C7002EAC02 /* UIKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF9181F43A4C7002EAC02 /* 

[webkit-changes] [273853] trunk/LayoutTests

2021-03-03 Thread peng . liu6
Title: [273853] trunk/LayoutTests








Revision 273853
Author peng.l...@apple.com
Date 2021-03-03 15:54:50 -0800 (Wed, 03 Mar 2021)


Log Message
[GPUP] Two tests related to media element state are flaky when media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=221688

Reviewed by Jer Noble.

This patch fixes two flaky tests by updating the expected value of a media element's "networkState"
in a "loadstart" event handler.

A video/audio element's network state may have changed from LOADING to IDLE before the "loadstart"
event handler executes. That will happen when the media player notifies the element with a network
state change (by calling HTMLMediaElement::setNetworkState()) from LOADING to LOADED quickly.
The code snippet is below:

```
void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
{
...
if (state == MediaPlayer::NetworkState::Loaded) {
if (m_networkState != NETWORK_IDLE)
changeNetworkStateFromLoadingToIdle();
m_completelyLoaded = true;
}
}
```

* media/W3C/audio/networkState/networkState_during_loadstart-expected.txt:
* media/W3C/audio/networkState/networkState_during_loadstart.html:
* media/W3C/video/networkState/networkState_during_loadstart-expected.txt:
* media/W3C/video/networkState/networkState_during_loadstart.html:
* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart-expected.txt
trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart.html
trunk/LayoutTests/media/W3C/video/networkState/networkState_during_loadstart-expected.txt
trunk/LayoutTests/media/W3C/video/networkState/networkState_during_loadstart.html
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (273852 => 273853)

--- trunk/LayoutTests/ChangeLog	2021-03-03 23:46:37 UTC (rev 273852)
+++ trunk/LayoutTests/ChangeLog	2021-03-03 23:54:50 UTC (rev 273853)
@@ -1,3 +1,37 @@
+2021-03-03  Peng Liu  
+
+[GPUP] Two tests related to media element state are flaky when media in GPU Process is enabled
+https://bugs.webkit.org/show_bug.cgi?id=221688
+
+Reviewed by Jer Noble.
+
+This patch fixes two flaky tests by updating the expected value of a media element's "networkState"
+in a "loadstart" event handler.
+
+A video/audio element's network state may have changed from LOADING to IDLE before the "loadstart"
+event handler executes. That will happen when the media player notifies the element with a network
+state change (by calling HTMLMediaElement::setNetworkState()) from LOADING to LOADED quickly.
+The code snippet is below:
+
+```
+void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
+{
+...
+if (state == MediaPlayer::NetworkState::Loaded) {
+if (m_networkState != NETWORK_IDLE)
+changeNetworkStateFromLoadingToIdle();
+m_completelyLoaded = true;
+}
+}
+```
+
+* media/W3C/audio/networkState/networkState_during_loadstart-expected.txt:
+* media/W3C/audio/networkState/networkState_during_loadstart.html:
+* media/W3C/video/networkState/networkState_during_loadstart-expected.txt:
+* media/W3C/video/networkState/networkState_during_loadstart.html:
+* platform/mac/TestExpectations:
+* platform/wk2/TestExpectations:
+
 2021-03-03  Amir Mark Jr  
 
 [BigSur WK1 Release] media/video-aspect-ratio.html is a flakey timeout


Modified: trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart-expected.txt (273852 => 273853)

--- trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart-expected.txt	2021-03-03 23:46:37 UTC (rev 273852)
+++ trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart-expected.txt	2021-03-03 23:54:50 UTC (rev 273853)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS "2" is "2"
+PASS true is true
 
 TEST COMPLETE
 spec reference


Modified: trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart.html (273852 => 273853)

--- trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart.html	2021-03-03 23:46:37 UTC (rev 273852)
+++ trunk/LayoutTests/media/W3C/audio/networkState/networkState_during_loadstart.html	2021-03-03 23:54:50 UTC (rev 273853)
@@ -15,8 +15,7 @@
 var a = document.getElementById("a");
 a.addEventListener("loadstart", function() {
   t.step(function() {
-   assert_equals(a.networkState,
-   a.NETWORK_LOADING);
+   assert_true(a.networkState == a.NETWORK_LOADING || a.networkState == a.NETWORK_IDLE);
   });
   t.done();
   a.pause();


Modified: 

[webkit-changes] [273775] trunk/Source/WebKit

2021-03-02 Thread peng . liu6
Title: [273775] trunk/Source/WebKit








Revision 273775
Author peng.l...@apple.com
Date 2021-03-02 17:12:53 -0800 (Tue, 02 Mar 2021)


Log Message
[ BigSur Debug Wk 2 ] ASSERT NOT REACHED in WebCore::DisplayList::PaintFrameForMedia::apply
https://bugs.webkit.org/show_bug.cgi?id=221989


Reviewed by Jer Noble.

No new tests, this will fix a crash on debug bots.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::applyMediaItem): When we cannot get the player, the player
with the given identifier must have been destroyed. This function can return true to indicate
that the item has been applied.

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (273774 => 273775)

--- trunk/Source/WebKit/ChangeLog	2021-03-03 00:56:40 UTC (rev 273774)
+++ trunk/Source/WebKit/ChangeLog	2021-03-03 01:12:53 UTC (rev 273775)
@@ -1,3 +1,18 @@
+2021-03-02  Peng Liu  
+
+[ BigSur Debug Wk 2 ] ASSERT NOT REACHED in WebCore::DisplayList::PaintFrameForMedia::apply
+https://bugs.webkit.org/show_bug.cgi?id=221989
+
+
+Reviewed by Jer Noble.
+
+No new tests, this will fix a crash on debug bots.
+
+* GPUProcess/graphics/RemoteRenderingBackend.cpp:
+(WebKit::RemoteRenderingBackend::applyMediaItem): When we cannot get the player, the player
+with the given identifier must have been destroyed. This function can return true to indicate
+that the item has been applied.
+
 2021-03-02  Ricky Mondello  
 
 Unconditionally return information in _autofillContext SPI when a field is focused


Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (273774 => 273775)

--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-03-03 00:56:40 UTC (rev 273774)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-03-03 01:12:53 UTC (rev 273775)
@@ -124,7 +124,7 @@
 auto& mediaItem = item.get();
 auto player = m_gpuConnectionToWebProcess->remoteMediaPlayerManagerProxy().mediaPlayer(mediaItem.identifier());
 if (!player)
-return false;
+return true;
 
 context.paintFrameForMedia(*player, mediaItem.destination());
 return true;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


  1   2   3   4   >