<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - No reliable way to get a snapshot of WKWebView (macOS)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161450#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - No reliable way to get a snapshot of WKWebView (macOS)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161450">bug 161450</a>
              from <span class="vcard"><a class="email" href="mailto:thorton&#64;apple.com" title="Tim Horton &lt;thorton&#64;apple.com&gt;"> <span class="fn">Tim Horton</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=161450#c8">comment #8</a>)
<span class="quote">&gt; I have a few questions while I was coding this patch. I see that
&gt; -[_snapshotRect:intoImageOfWidth:completionHandler:] passes in
&gt; WebKit::SnapshotOptionsExcludeDeviceScaleFactor when taking the software
&gt; snapshot. -[_WKThumbnailView requestSnapshot] is another caller of this
&gt; method that does not pass this parameter. While testing on OSX with Retina
&gt; display I did not notice a difference in the output image. In what scenarios
&gt; will this affect the snapshot?</span >

You should get a 1x image if you pass that option, and I'm not sure why _snapshotRect would do that. But it definitely looks like WebPage::snapshotAtSize/scaledSnapshotWithOptions respect that option and don't apply the device scale.

<span class="quote">&gt; I am now calling -[_snapshotRect:intoImageOfWidth:completionHandler:] for
&gt; iOS. When I tried calling this private API on my iOS 10 iPhone device, a
&gt; WebGL sample page and HTML5 video were not being captured. The HTML overlays
&gt; and surrounding DOM elements were all that was included in the snapshot.
&gt; Does iOS 10 webkit.framework include the change to take a hardware snapshot?
&gt; I see this method was modified a few times in the past year.</span >

It does. Is the view in-window at the time? That really should work.

<span class="quote">&gt; I believe the check-webkit-style script is outputting incorrect results for
&gt; the anonymous callbacks. I see this style being used other locations in the
&gt; project.</span >

Yep, this is a known problem.

<span class="quote">&gt; ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewSnapshot.mm:46: 
&gt; Place brace on its own line for function definitions.  [whitespace/braces]
&gt; [4]
&gt; 
&gt; Thanks,
&gt; Dan</span ></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>