Title: [293063] trunk/Source
Revision
293063
Author
grao...@webkit.org
Date
2022-04-19 22:31:36 -0700 (Tue, 19 Apr 2022)

Log Message

[model] set canonicalWebPageURL and urlFragment on ASVInlinePreview on iOS
https://bugs.webkit.org/show_bug.cgi?id=239502
rdar://87352281

Reviewed by Dean Jackson.

Source/WebCore/PAL:

Add the `canonicalWebPageURL` and `urlFragment` properties to the SPI declarations.

* pal/spi/ios/SystemPreviewSPI.h:

Source/WebKit:

Set the `canonicalWebPageURL` and `urlFragment` properties on the ASVInlinePreview prior to
entering fullscreen.

* UIProcess/Cocoa/ModelElementControllerCocoa.mm:
(WebKit::ModelElementController::takeModelElementFullscreen):
* UIProcess/ModelElementController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::takeModelElementFullscreen):

Canonical link: https://commits.webkit.org/249793@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (293062 => 293063)


--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 05:31:36 UTC (rev 293063)
@@ -1,3 +1,15 @@
+2022-04-19  Antoine Quint  <grao...@apple.com>
+
+        [model] set canonicalWebPageURL and urlFragment on ASVInlinePreview on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=239502
+        rdar://87352281
+
+        Reviewed by Dean Jackson.
+
+        Add the `canonicalWebPageURL` and `urlFragment` properties to the SPI declarations.
+
+        * pal/spi/ios/SystemPreviewSPI.h:
+
 2022-04-15  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WebGPU] Implement hardware limits

Modified: trunk/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h (293062 => 293063)


--- trunk/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h	2022-04-20 05:31:36 UTC (rev 293063)
@@ -119,6 +119,9 @@
 @property (nonatomic, readonly) BOOL hasAudio;
 @property (nonatomic, readwrite) BOOL isMuted;
 
+@property (nonatomic, retain, nullable) NSURL *canonicalWebPageURL;
+@property (nonatomic, retain, nullable) NSString *urlFragment;
+
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/Source/WebKit/ChangeLog (293062 => 293063)


--- trunk/Source/WebKit/ChangeLog	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebKit/ChangeLog	2022-04-20 05:31:36 UTC (rev 293063)
@@ -278,6 +278,23 @@
         (WebKit::WebProcessProxy::gpuProcessExited):
         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
 
+2022-04-19  Antoine Quint  <grao...@apple.com>
+
+        [model] set canonicalWebPageURL and urlFragment on ASVInlinePreview on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=239502
+        rdar://87352281
+
+        Reviewed by Dean Jackson.
+
+        Set the `canonicalWebPageURL` and `urlFragment` properties on the ASVInlinePreview prior to
+        entering fullscreen.
+
+        * UIProcess/Cocoa/ModelElementControllerCocoa.mm:
+        (WebKit::ModelElementController::takeModelElementFullscreen):
+        * UIProcess/ModelElementController.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::takeModelElementFullscreen):
+
 2022-04-19  Zan Dobersek  <zdober...@igalia.com>
 
         [GTK][WPE][GPUProcess] Add RemoteGraphicsContextGLGBM, RemoteGraphicsContextGLProxyGBM

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (293062 => 293063)


--- trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm	2022-04-20 05:31:36 UTC (rev 293063)
@@ -81,7 +81,7 @@
     return [modelViewForModelIdentifier(modelIdentifier) preview];
 }
 
-void ModelElementController::takeModelElementFullscreen(ModelIdentifier modelIdentifier)
+void ModelElementController::takeModelElementFullscreen(ModelIdentifier modelIdentifier, const URL& originatingPageURL)
 {
     auto *presentingViewController = m_webPageProxy.uiClient().presentingViewController();
     if (!presentingViewController)
@@ -94,6 +94,8 @@
     CGRect initialFrame = [modelView convertRect:modelView.frame toView:nil];
 
     ASVInlinePreview *preview = [modelView preview];
+    [preview setCanonicalWebPageURL:originatingPageURL];
+    [preview setUrlFragment:originatingPageURL.fragmentIdentifier().createNSString().get()];
     NSDictionary *previewOptions = @{@"WebKit": @"Model element fullscreen"};
     [preview createFullscreenInstanceWithInitialFrame:initialFrame previewOptions:previewOptions completionHandler:^(UIViewController *remoteViewController, CAFenceHandle *fenceHandle, NSError *creationError) {
         if (creationError) {

Modified: trunk/Source/WebKit/UIProcess/ModelElementController.h (293062 => 293063)


--- trunk/Source/WebKit/UIProcess/ModelElementController.h	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebKit/UIProcess/ModelElementController.h	2022-04-20 05:31:36 UTC (rev 293063)
@@ -69,7 +69,7 @@
     void setIsMutedForModelElement(ModelIdentifier, bool, CompletionHandler<void(bool)>&&);
 #endif
 #if ENABLE(ARKIT_INLINE_PREVIEW_IOS)
-    void takeModelElementFullscreen(ModelIdentifier);
+    void takeModelElementFullscreen(ModelIdentifier, const URL&);
     void setInteractionEnabledForModelElement(ModelIdentifier, bool);
 #endif
 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (293062 => 293063)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-04-20 05:31:33 UTC (rev 293062)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-04-20 05:31:36 UTC (rev 293063)
@@ -11177,7 +11177,7 @@
 #if ENABLE(ARKIT_INLINE_PREVIEW_IOS)
 void WebPageProxy::takeModelElementFullscreen(ModelIdentifier modelIdentifier)
 {
-    modelElementController()->takeModelElementFullscreen(modelIdentifier);
+    modelElementController()->takeModelElementFullscreen(modelIdentifier, URL { currentURL() });
 }
 
 void WebPageProxy::modelElementSetInteractionEnabled(ModelIdentifier modelIdentifier, bool isInteractionEnabled)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to