Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f23f581a778e2452d70d5eff545aeb2e5edcb4c8
      
https://github.com/WebKit/WebKit/commit/f23f581a778e2452d70d5eff545aeb2e5edcb4c8
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2025-11-05 (Wed, 05 Nov 2025)

  Changed paths:
    M LayoutTests/http/tests/pdf/linearized-pdf-in-iframe.html
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm

  Log Message:
  -----------
  UnifiedPDF: content is drawn over page boundaries with DCS
https://bugs.webkit.org/show_bug.cgi?id=301426
rdar://162536174

Reviewed by Abrar Rahman Protyasha and Tim Horton.

The composited layer for the PDF content overlaps the "PDF document
chrome", e.g. the depiction of pages with gray margin and black page
border. The idea is that the PDF content contains solid pixels and other
parts of the layer bitmap contains transparent pixels.

The actual "AsyncPDFRenderer" PDF content tiles are bitmaps the size of
the composited layer tiles, but they are distinct bitmaps, not related
to the layer backing store. The pdf tiles were filled with white and pdf
content was drawn on top of the white.

The DCS content is drawn with the same logic as AsyncPDFRenderer PDF
content tiles and used in full. Thus the full-tile white fill rect would
be present in the DCS display list and it would occlude the PDF document
chrome the below gray margin and black page border.

Fix by filling white to only where the page contents actually are.

The bug was not visible with normal layer drawing. When AsyncPDFRenderer
tiles were drawn to PDF content composited layer tiles, only the areas
inside page borders were sourced from and draw to, rest of the
composited layer tiles were left transparent. Thus the gray margin and
black page border were showing through.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::renderPDFTile):

Canonical link: https://commits.webkit.org/302635@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to