[Webkit-unassigned] [Bug 220849] Full-page (PDF) screenshots in iOS 14 Safari aren't showing -webkit-mask correctly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 28 12:05:57 PST 2021


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

--- Comment #6 from Tim Horton <thorton at apple.com> ---
(In reply to Henric Trotzig from comment #5)
> If anyone has an idea for a workaround I could use, I'd be very happy! I'll
> walk you through my usecase and the issue I'm facing: 
> 
> I have a screenshot testing service where I use an iPhone simulator to take
> (automated) screenshots of web components and pages. In iOS 12, the
> screenshots you get back from calling `WKWebView.takeSnapshots` contain the
> entire document, including things rendered outside the viewport. In iOS 13,
> the behavior changed so that screenshots only included the content in the
> viewport, everything else came out as fully transparent pixels.
> 
> The change in behavior is similar to a change done to Chrome/Chromium, as
> reported in this issue:
> https://bugs.chromium.org/p/chromium/issues/detail?id=1003629 (also
> discussed in the puppeteer repo:
> https://github.com/puppeteer/puppeteer/issues/5080). That issue was resolved
> after a while by setting a blink flag (`mainFrameClipsContent=false`) which
> brought back the old behavior. 
> 
> Apart from using WKWebView.createPDF option, there are other workarounds for
> this issue, including scrolling the page and stitching together a single
> image (hard because of dynamic content that can shift the layout, plus
> slow), resizing the browser window (makes using `vh` units in css
> impossible). 
> 
> Let me know if you want me to file this as a separate issue, I realize I'm
> threadjacking here.

Aha, I know why this happened. It's specific to the simulator; on device we always only snapshotted the visible parts. It's possible (likely?) that if you remove the view from its window before snapshotting you'll get the old behavior. I don't know if that's acceptable for your use case, but if so, that is one potential workaround.

You could definitely file a separate bug about this, I feel like we maybe should fall back to software painting (include arbitrary content) if you specify a snapshotting rect outside the view... I thought we did, actually, but I don't see the code.

Anyway, try the workaround and file a bug either way.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210128/8661467b/attachment.htm>


More information about the webkit-unassigned mailing list