Fix WatchOS build
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2019 20:13:15 +0000 (20:13 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2019 20:13:15 +0000 (20:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194353

Rubber stamped by Tim Horton and Wenson Hsieh.

* rendering/RenderThemeIOS.mm:
(WebCore::iconForAttachment):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderThemeIOS.mm

index 626d4f4..5ea2750 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-06  Alex Christensen  <achristensen@webkit.org>
+
+        Fix WatchOS build
+        https://bugs.webkit.org/show_bug.cgi?id=194353
+
+        Rubber stamped by Tim Horton and Wenson Hsieh.
+
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::iconForAttachment):
+
 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
 
         [SVG] fix SVGURIReference build by including SVGElement
index 3215dce..1493496 100644 (file)
@@ -1640,7 +1640,9 @@ static BOOL getAttachmentProgress(const RenderAttachment& attachment, float& pro
 
 static RetainPtr<UIImage> iconForAttachment(const RenderAttachment& attachment, FloatSize& size)
 {
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     auto documentInteractionController = adoptNS([PAL::allocUIDocumentInteractionControllerInstance() init]);
+    ALLOW_DEPRECATED_DECLARATIONS_END
 
     String fileName;
     if (File* file = attachment.attachmentElement().file())
@@ -1658,14 +1660,18 @@ static RetainPtr<UIImage> iconForAttachment(const RenderAttachment& attachment,
         else
             UTI = UTIFromMIMEType(attachmentType);
 
+#if !PLATFORM(WATCHOS)
         [documentInteractionController setUTI:static_cast<NSString *>(UTI)];
+#endif
     }
 
+    RetainPtr<UIImage> result;
+#if !PLATFORM(WATCHOS)
     NSArray *icons = [documentInteractionController icons];
     if (!icons.count)
         return nil;
 
-    RetainPtr<UIImage> result = icons.lastObject;
+    result = icons.lastObject;
 
     BOOL useHeightForClosestMatch = [result size].height > [result size].width;
     CGFloat bestMatchRatio = -1;
@@ -1682,7 +1688,7 @@ static RetainPtr<UIImage> iconForAttachment(const RenderAttachment& attachment,
             }
         }
     }
-
+#endif
     CGFloat iconAspect = [result size].width / [result size].height;
     size = largestRectWithAspectRatioInsideRect(iconAspect, FloatRect(0, 0, attachmentIconSize, attachmentIconSize)).size();