[Webkit-unassigned] [Bug 161450] No reliable way to get a snapshot of WKWebView (macOS)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 14 15:32:54 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=161450

--- Comment #24 from Dan Saunders <dasau at microsoft.com> ---
Comment on attachment 288770
  --> https://bugs.webkit.org/attachment.cgi?id=288770
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288770&action=review

>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:886
>> +    // Software snapshot will not capture elements rendered with hardware acceleration (WebGL, video, etc).
> 
> If true, I am not sure it is acceptable to create API that will fail in this manner for so much content?

It is not ideal, but we haven't been able to find a better option to capture the remote layer contents reliably. If a new AppKit API becomes available that will allow us to capture this content, we can change this implementation to use it instead. Should I open a tracking bug and reference it here?

>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:895
>> +                    auto rawHandler = (void (^)(CGImageRef, NSError *))handler.get();
> 
> I believe there is a way to do this without all these typecast casts to the block type, perhaps by using the equivalence of blocks and lambdas.

All of the asynchronous callbacks in WebViewImpl.mm and WKWebView.mm are using typecasts, so I was following the convention. I run into compiler errors with adoptNS constructor if I try to give it the correct type, and it is important to use the RetainPtr to make sure the callback does not get released outside of the lambda. I could do a manual release and avoid the RetainPtr, but this approach does not seem to be used other places. I can remove 1 of the typecasts so I will go ahead and do that in the next iteration.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161014/91d36c41/attachment-0001.html>


More information about the webkit-unassigned mailing list