Title: [249146] branches/safari-608-branch/Source/WebCore
Revision
249146
Author
alanc...@apple.com
Date
2019-08-27 09:19:37 -0700 (Tue, 27 Aug 2019)

Log Message

Cherry-pick r249140. rdar://problem/54749102

    Image pasted from screenshot into Mail compose window via share sheet has the wrong aspect ratio
    https://bugs.webkit.org/show_bug.cgi?id=201171
    <rdar://problem/54671275>

    Reviewed by Tim Horton.

    Augments an existing app-specific hack to include the Mail composition service, in addition to Mail.

    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isMailCompositionService):

    Add a new bundle checking method for the Mail composition service (com.apple.MailCompositionService).

    * platform/ios/PlatformPasteboardIOS.mm:
    (WebCore::PlatformPasteboard::informationForItemAtIndex):

    Only plumb the preferred presentation height through to the web process if the application is neither Mail nor
    the Mail composition service. In the future, we should consider putting this hack behind SPI, or maybe only
    expose the preferred presentation width in all apps (it isn't difficult to imagine a use case where a "Mail-
    compose-like" web app has `img { max-width: 100%; }` in their stylesheet).

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (249145 => 249146)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-27 16:19:34 UTC (rev 249145)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-08-27 16:19:37 UTC (rev 249146)
@@ -1,5 +1,58 @@
 2019-08-27  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r249140. rdar://problem/54749102
+
+    Image pasted from screenshot into Mail compose window via share sheet has the wrong aspect ratio
+    https://bugs.webkit.org/show_bug.cgi?id=201171
+    <rdar://problem/54671275>
+    
+    Reviewed by Tim Horton.
+    
+    Augments an existing app-specific hack to include the Mail composition service, in addition to Mail.
+    
+    * platform/RuntimeApplicationChecks.h:
+    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+    (WebCore::IOSApplication::isMailCompositionService):
+    
+    Add a new bundle checking method for the Mail composition service (com.apple.MailCompositionService).
+    
+    * platform/ios/PlatformPasteboardIOS.mm:
+    (WebCore::PlatformPasteboard::informationForItemAtIndex):
+    
+    Only plumb the preferred presentation height through to the web process if the application is neither Mail nor
+    the Mail composition service. In the future, we should consider putting this hack behind SPI, or maybe only
+    expose the preferred presentation width in all apps (it isn't difficult to imagine a use case where a "Mail-
+    compose-like" web app has `img { max-width: 100%; }` in their stylesheet).
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-27  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            Image pasted from screenshot into Mail compose window via share sheet has the wrong aspect ratio
+            https://bugs.webkit.org/show_bug.cgi?id=201171
+            <rdar://problem/54671275>
+
+            Reviewed by Tim Horton.
+
+            Augments an existing app-specific hack to include the Mail composition service, in addition to Mail.
+
+            * platform/RuntimeApplicationChecks.h:
+            * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+            (WebCore::IOSApplication::isMailCompositionService):
+
+            Add a new bundle checking method for the Mail composition service (com.apple.MailCompositionService).
+
+            * platform/ios/PlatformPasteboardIOS.mm:
+            (WebCore::PlatformPasteboard::informationForItemAtIndex):
+
+            Only plumb the preferred presentation height through to the web process if the application is neither Mail nor
+            the Mail composition service. In the future, we should consider putting this hack behind SPI, or maybe only
+            expose the preferred presentation width in all apps (it isn't difficult to imagine a use case where a "Mail-
+            compose-like" web app has `img { max-width: 100%; }` in their stylesheet).
+
+2019-08-27  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r249074. rdar://problem/54735492
 
     [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing

Modified: branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h (249145 => 249146)


--- branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-08-27 16:19:34 UTC (rev 249145)
+++ branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-08-27 16:19:37 UTC (rev 249146)
@@ -77,6 +77,7 @@
 namespace IOSApplication {
 
 WEBCORE_EXPORT bool isMobileMail();
+WEBCORE_EXPORT bool isMailCompositionService();
 WEBCORE_EXPORT bool isMobileSafari();
 WEBCORE_EXPORT bool isIMDb();
 WEBCORE_EXPORT bool isWebBookmarksD();

Modified: branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (249145 => 249146)


--- branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-08-27 16:19:34 UTC (rev 249145)
+++ branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-08-27 16:19:37 UTC (rev 249146)
@@ -202,6 +202,12 @@
     return isMobileMail;
 }
 
+bool IOSApplication::isMailCompositionService()
+{
+    static bool isMailCompositionService = applicationBundleIsEqualTo("com.apple.MailCompositionService"_s);
+    return isMailCompositionService;
+}
+
 bool IOSApplication::isMobileSafari()
 {
     static bool isMobileSafari = applicationBundleIsEqualTo("com.apple.mobilesafari"_s);

Modified: branches/safari-608-branch/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (249145 => 249146)


--- branches/safari-608-branch/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2019-08-27 16:19:34 UTC (rev 249145)
+++ branches/safari-608-branch/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2019-08-27 16:19:37 UTC (rev 249146)
@@ -158,7 +158,7 @@
 #endif
     if (!CGSizeEqualToSize(itemProvider.preferredPresentationSize, CGSizeZero)) {
         auto adjustedPreferredPresentationHeight = [](auto height) -> Optional<double> {
-            if (!IOSApplication::isMobileMail())
+            if (!IOSApplication::isMobileMail() && !IOSApplication::isMailCompositionService())
                 return { height };
             // Mail's max-width: 100%; default style is in conflict with the preferred presentation size and can lead to unexpectedly stretched images. Not setting the height forces layout to preserve the aspect ratio.
             return { };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to