⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249146 in webkit


Ignore:
Timestamp:
Aug 27, 2019, 9:19:37 AM (7 years ago)
Author:
Alan Coon
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

Location:
branches/safari-608-branch/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608-branch/Source/WebCore/ChangeLog

    r249145 r249146  
     12019-08-27  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r249140. rdar://problem/54749102
     4
     5    Image pasted from screenshot into Mail compose window via share sheet has the wrong aspect ratio
     6    https://bugs.webkit.org/show_bug.cgi?id=201171
     7    <rdar://problem/54671275>
     8   
     9    Reviewed by Tim Horton.
     10   
     11    Augments an existing app-specific hack to include the Mail composition service, in addition to Mail.
     12   
     13    * platform/RuntimeApplicationChecks.h:
     14    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
     15    (WebCore::IOSApplication::isMailCompositionService):
     16   
     17    Add a new bundle checking method for the Mail composition service (com.apple.MailCompositionService).
     18   
     19    * platform/ios/PlatformPasteboardIOS.mm:
     20    (WebCore::PlatformPasteboard::informationForItemAtIndex):
     21   
     22    Only plumb the preferred presentation height through to the web process if the application is neither Mail nor
     23    the Mail composition service. In the future, we should consider putting this hack behind SPI, or maybe only
     24    expose the preferred presentation width in all apps (it isn't difficult to imagine a use case where a "Mail-
     25    compose-like" web app has `img { max-width: 100%; }` in their stylesheet).
     26   
     27   
     28    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     29
     30    2019-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     31
     32            Image pasted from screenshot into Mail compose window via share sheet has the wrong aspect ratio
     33            https://bugs.webkit.org/show_bug.cgi?id=201171
     34            <rdar://problem/54671275>
     35
     36            Reviewed by Tim Horton.
     37
     38            Augments an existing app-specific hack to include the Mail composition service, in addition to Mail.
     39
     40            * platform/RuntimeApplicationChecks.h:
     41            * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
     42            (WebCore::IOSApplication::isMailCompositionService):
     43
     44            Add a new bundle checking method for the Mail composition service (com.apple.MailCompositionService).
     45
     46            * platform/ios/PlatformPasteboardIOS.mm:
     47            (WebCore::PlatformPasteboard::informationForItemAtIndex):
     48
     49            Only plumb the preferred presentation height through to the web process if the application is neither Mail nor
     50            the Mail composition service. In the future, we should consider putting this hack behind SPI, or maybe only
     51            expose the preferred presentation width in all apps (it isn't difficult to imagine a use case where a "Mail-
     52            compose-like" web app has `img { max-width: 100%; }` in their stylesheet).
     53
    1542019-08-27  Alan Coon  <alancoon@apple.com>
    255
  • branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h

    r248574 r249146  
    7878
    7979WEBCORE_EXPORT bool isMobileMail();
     80WEBCORE_EXPORT bool isMailCompositionService();
    8081WEBCORE_EXPORT bool isMobileSafari();
    8182WEBCORE_EXPORT bool isIMDb();
  • branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

    r248574 r249146  
    203203}
    204204
     205bool IOSApplication::isMailCompositionService()
     206{
     207    static bool isMailCompositionService = applicationBundleIsEqualTo("com.apple.MailCompositionService"_s);
     208    return isMailCompositionService;
     209}
     210
    205211bool IOSApplication::isMobileSafari()
    206212{
  • branches/safari-608-branch/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r246892 r249146  
    159159    if (!CGSizeEqualToSize(itemProvider.preferredPresentationSize, CGSizeZero)) {
    160160        auto adjustedPreferredPresentationHeight = [](auto height) -> Optional<double> {
    161             if (!IOSApplication::isMobileMail())
     161            if (!IOSApplication::isMobileMail() && !IOSApplication::isMailCompositionService())
    162162                return { height };
    163163            // 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.
Note: See TracChangeset for help on using the changeset viewer.