WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
221662
WKWebView's -takeSnapshotWithConfiguration:completionHandler: can't capture GPU rendering features
https://bugs.webkit.org/show_bug.cgi?id=221662
Summary
WKWebView's -takeSnapshotWithConfiguration:completionHandler: can't capture G...
Jonathan Deutsch
Reported
2021-02-09 23:29:12 PST
Snapshots can't capture 3D perspective, filter effects, reflection, etc. Using the -[NSView cacheDisplayInRect:toBitmapImageRep:] doesn't get the view at all; the only workaround seems to be to make another WKWebView with a copy of the content/DOM in a mostly offscreen window (1px must show) and use CGWindowListCreateImage(). This isn't desirable for several reasons such as performance and issues in recreating the view accurately. Apps like Tumult Hype [
https://tumult.com/hype/
] need to take web view snapshots for many reasons like thumbnails, poster images, video export, etc. Being unable to capture the web view in use is a significant hurdle.
Attachments
Add attachment
proposed patch, testcase, etc.
Tim Horton
Comment 1
2021-02-13 16:19:25 PST
Unfortunately since CGWindowListCreateImage and friends are the primary way to do this on macOS, and WebKit doesn’t know the rest of the contents of the window, this is not easy to fix (at least, not without sometimes getting random non-WebKit content in the snapshot). WebKit gets around this on iOS by using CARenderServer mechanisms to snapshot a subtree of layers. For now you’re likely best off with your hand rolled snapshotting solution (since you can guarantee nothing overlaps the web view in the snapshot), but do know that we are aware of this limitation.
Radar WebKit Bug Importer
Comment 2
2021-02-16 23:30:14 PST
<
rdar://problem/74423427
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug