WebKit Bugzilla
Attachment 371994 Details for
Bug 198812
: Show the web page URL when sharing an AR model
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198812-20190613005219.patch (text/plain), 8.85 KB, created by
Antoine Quint
on 2019-06-12 15:52:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-06-12 15:52:21 PDT
Size:
8.85 KB
patch
obsolete
>Subversion Revision: 246348 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f37f7eb1ff7f58535403aedb4a219b517e224704..3fe397d69194827f6760babf45f7239e7237b2c2 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,13 @@ >+2019-06-12 Antoine Quint <graouts@apple.com> >+ >+ Show the web page URL when sharing an AR model >+ https://bugs.webkit.org/show_bug.cgi?id=198812 >+ <rdar://problem/48689498> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Platform.h: >+ > 2019-06-10 Simon Fraser <simon.fraser@apple.com> > > Add logging for UI-side compositing hit-testing >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 96691b28fca4c228d042055b67f94a51148bfa24..f611fd6ad464186f3a7f4a8ac930e3f3c8ef0bb5 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2019-06-12 Antoine Quint <graouts@apple.com> >+ >+ Show the web page URL when sharing an AR model >+ https://bugs.webkit.org/show_bug.cgi?id=198812 >+ <rdar://problem/48689498> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/ios/SystemPreviewSPI.h: >+ > 2019-06-10 Sam Weinig <weinig@apple.com> > > Remove Dashboard support >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 898da324a131510884bc00b5abc847d17e4d7838..2369ab4d5073eccc639e75d0d1efd1ef2beedb39 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2019-06-12 Antoine Quint <graouts@apple.com> >+ >+ Show the web page URL when sharing an AR model >+ https://bugs.webkit.org/show_bug.cgi?id=198812 >+ <rdar://problem/48689498> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/DownloadClient.mm: >+ (WebKit::DownloadClient::didStart): >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDataSource initWithMIMEType:originatingPageURL:]): >+ (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): >+ (WebKit::SystemPreviewController::start): >+ (-[_WKPreviewControllerDataSource initWithMIMEType:]): Deleted. >+ * UIProcess/SystemPreviewController.h: >+ > 2019-06-11 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Idempotent text autosizing needs to react properly to viewport changes >diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h >index 83d36730df89392ed47bbee1ed2f4ef675f67091..40667d94782f2382fbfacba9820fd076ed199589 100644 >--- a/Source/WTF/wtf/Platform.h >+++ b/Source/WTF/wtf/Platform.h >@@ -1525,6 +1525,10 @@ > #define HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID 1 > #endif > >+#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 >+#define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1 >+#endif >+ > #if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 > #define HAVE_UI_WK_DOCUMENT_CONTEXT 1 > #endif >diff --git a/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h b/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h >index 39e7518cc810b4c590ef9738b139420619d1dd79..bec7f90c298c5623c1fc1fe2a35285a564e3d0ba 100644 >--- a/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h >+++ b/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h >@@ -25,6 +25,10 @@ > > #if USE(APPLE_INTERNAL_SDK) > >+#if HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) >+#import <AssetViewer/ARQuickLookWebKitItem.h> >+#endif >+ > #import <AssetViewer/ASVThumbnailView.h> > > #else >@@ -45,5 +49,15 @@ > @property (nonatomic) CGSize maxThumbnailSize; > @end > >+#if HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) >+#import <ARKit/ARKit.h> >+ >+@class ARQuickLookWebKitItem; >+ >+@interface ARQuickLookWebKitItem : QLItem >+- (instancetype)initWithPreviewItemProvider:(NSItemProvider *_Nonnull)itemProvider contentType:(NSString *_Nonnull)contentType previewTitle:(NSString *_Nonnull)previewTitle fileSize:(NSNumber *_Nonnull)fileSize previewItem:(ARQuickLookPreviewItem *)previewItem; >+@end >+#endif >+ > #endif > >diff --git a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >index a640f985b9075903cf9dca438acda8ccf1c4da50..36ede7275af379c7e7dee0162bd30a616f0e4665 100644 >--- a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >+++ b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >@@ -71,7 +71,7 @@ void DownloadClient::didStart(WebProcessPool&, DownloadProxy& downloadProxy) > if (downloadProxy.isSystemPreviewDownload()) { > if (auto* webPage = downloadProxy.originatingPage()) { > // FIXME: Update the MIME-type once it is known in the ResourceResponse. >- webPage->systemPreviewController()->start("application/octet-stream"_s, downloadProxy.systemPreviewDownloadRect()); >+ webPage->systemPreviewController()->start(URL(URL(), webPage->currentURL()), "application/octet-stream"_s, downloadProxy.systemPreviewDownloadRect()); > } > takeActivityToken(downloadProxy); > return; >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index 58834e9068854baec9497edf17aac18b3bb2d997..8e01cc5fc3483090d74cf32d5401c4a9b62f1e37 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -39,9 +39,22 @@ > #import <pal/spi/ios/QuickLookSPI.h> > #import <wtf/WeakObjCPtr.h> > >+#if HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) >+#import <pal/spi/ios/SystemPreviewSPI.h> >+SOFT_LINK_PRIVATE_FRAMEWORK(ARKit); >+SOFT_LINK_CLASS(ARKit, ARQuickLookPreviewItem); >+SOFT_LINK_PRIVATE_FRAMEWORK(AssetViewer); >+SOFT_LINK_CLASS(AssetViewer, ARQuickLookWebKitItem); >+#endif >+ > @interface _WKPreviewControllerDataSource : NSObject <QLPreviewControllerDataSource> { > RetainPtr<NSItemProvider> _itemProvider; >+#if HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) >+ RetainPtr<ARQuickLookWebKitItem> _item; >+#else > RetainPtr<QLItem> _item; >+#endif >+ URL _originatingPageURL; > URL _downloadedURL; > }; > >@@ -52,11 +65,12 @@ @end > > @implementation _WKPreviewControllerDataSource > >-- (instancetype)initWithMIMEType:(NSString*)mimeType >+- (instancetype)initWithMIMEType:(NSString*)mimeType originatingPageURL:(URL)url > { > if (!(self = [super init])) > return nil; > >+ _originatingPageURL = url; > _mimeType = [mimeType copy]; > > return self; >@@ -84,7 +98,14 @@ - (id<QLPreviewItem>)previewController:(QLPreviewController *)controller preview > // means we don't actually know the real MIME type yet. > NSString *contentType = WebCore::UTIFromMIMEType("model/vnd.usdz+zip"_s); > >+#if HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) >+ ARQuickLookPreviewItem *previewItem = [allocARQuickLookPreviewItemInstance() initWithFileAtURL:_downloadedURL]; >+ previewItem.canonicalWebPageURL = _originatingPageURL; >+ >+ _item = [allocARQuickLookWebKitItemInstance() initWithPreviewItemProvider:_itemProvider.get() contentType:contentType previewTitle:@"Preview" fileSize:@(0) previewItem:previewItem]; >+#else > _item = adoptNS([PAL::allocQLItemInstance() initWithPreviewItemProvider:_itemProvider.get() contentType:contentType previewTitle:@"Preview" fileSize:@(0)]); >+#endif > [_item setUseLoadingTimeout:NO]; > > WeakObjCPtr<_WKPreviewControllerDataSource> weakSelf { self }; >@@ -197,7 +218,7 @@ @end > > namespace WebKit { > >-void SystemPreviewController::start(const String& mimeType, const WebCore::IntRect& fromRect) >+void SystemPreviewController::start(URL originatingPageURL, const String& mimeType, const WebCore::IntRect& fromRect) > { > ASSERT(!m_qlPreviewController); > if (m_qlPreviewController) >@@ -213,7 +234,7 @@ void SystemPreviewController::start(const String& mimeType, const WebCore::IntRe > m_qlPreviewControllerDelegate = adoptNS([[_WKPreviewControllerDelegate alloc] initWithSystemPreviewController:this fromRect:fromRect]); > [m_qlPreviewController setDelegate:m_qlPreviewControllerDelegate.get()]; > >- m_qlPreviewControllerDataSource = adoptNS([[_WKPreviewControllerDataSource alloc] initWithMIMEType:mimeType]); >+ m_qlPreviewControllerDataSource = adoptNS([[_WKPreviewControllerDataSource alloc] initWithMIMEType:mimeType originatingPageURL:originatingPageURL]); > [m_qlPreviewController setDataSource:m_qlPreviewControllerDataSource.get()]; > > [presentingViewController presentViewController:m_qlPreviewController.get() animated:YES completion:nullptr]; >diff --git a/Source/WebKit/UIProcess/SystemPreviewController.h b/Source/WebKit/UIProcess/SystemPreviewController.h >index 269d0c32fb32084b57e7d16b0ccf25cef74f9c26..f261f5268152d0fddb68551a860152e4167d0aec 100644 >--- a/Source/WebKit/UIProcess/SystemPreviewController.h >+++ b/Source/WebKit/UIProcess/SystemPreviewController.h >@@ -48,7 +48,7 @@ public: > > bool canPreview(const String& mimeType) const; > >- void start(const String& mimeType, const WebCore::IntRect&); >+ void start(URL originatingPageURL, const String& mimeType, const WebCore::IntRect&); > void updateProgress(float); > void finish(URL); > void cancel();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dino
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198812
: 371994