<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:bdakin&#64;apple.com" title="Beth Dakin &lt;bdakin&#64;apple.com&gt;"> <span class="fn">Beth Dakin</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Allow the UIDelegate to customize an image preview"
   href="https://bugs.webkit.org/show_bug.cgi?id=146557">bug 146557</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Allow the UIDelegate to customize an image preview"
   href="https://bugs.webkit.org/show_bug.cgi?id=146557#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Allow the UIDelegate to customize an image preview"
   href="https://bugs.webkit.org/show_bug.cgi?id=146557">bug 146557</a>
              from <span class="vcard"><a class="email" href="mailto:bdakin&#64;apple.com" title="Beth Dakin &lt;bdakin&#64;apple.com&gt;"> <span class="fn">Beth Dakin</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=146557#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=256030&amp;action=diff" name="attach_256030" title="Patch">attachment 256030</a> <a href="attachment.cgi?id=256030&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=256030&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=256030&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:60
&gt; &gt; +- (void)_webView:(WKWebView *)webView willPreviewImageWithURL:(NSURL *)imageURL;
&gt; &gt; +- (void)_webView:(WKWebView *)webView commitPreviewedImageWithURL:(NSURL *)imageURL;
&gt; 
&gt; Please add WK_AVAILABLE macros.
&gt; </span >

Added.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3216
&gt; &gt; +    id&lt;WKUIDelegatePrivate&gt; uiDelegate = static_cast&lt;id &lt;WKUIDelegatePrivate&gt;&gt;([_webView UIDelegate]);
&gt; 
&gt; space after id
&gt; </span >

Fixed.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3237
&gt; &gt; +        if (absoluteImageURL.isEmpty() || !WebCore::protocolIsInHTTPFamily(absoluteImageURL))
&gt; 
&gt; At some point we should consider data: URL images.
&gt; </span >

I added them! Still need to follow-up with Sam to make sure it's okay.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3241
&gt; &gt; +            NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL];
&gt; 
&gt; No real need for the temporary, just like below.
&gt; </span >

Fixed.

<span class="quote">&gt; &gt; Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3252
&gt; &gt; +    id&lt;WKUIDelegatePrivate&gt; uiDelegate = static_cast&lt;id &lt;WKUIDelegatePrivate&gt;&gt;([_webView UIDelegate]);
&gt; 
&gt; space after id
&gt; </span >

Fixed.

<span class="quote">&gt; &gt; Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2162
&gt; &gt; +                info.imageURL = [(NSURL *)element-&gt;document().completeURL(downcast&lt;HTMLImageElement&gt;(*element).src()) absoluteString];
&gt; 
&gt; What happens if it's a srcset image?</span >

Good eye! They were broken. I fixed them by getting the URL from the RenderImage's CachedImage instead. 

<a href="http://trac.webkit.org/changeset/186236">http://trac.webkit.org/changeset/186236</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>