[webkit-changes] [WebKit/WebKit] e61686: [UnifiedPDF] scrolling is broken after navigating ...

Simon Fraser noreply at github.com
Mon Jan 29 21:50:02 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e6168698e8a3a0a3b2df3c26747b814b55f5174f
      https://github.com/WebKit/WebKit/commit/e6168698e8a3a0a3b2df3c26747b814b55f5174f
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    A LayoutTests/compositing/plugins/pdf/pdf-in-iframe-scrolling-tree-after-back-expected.txt
    A LayoutTests/compositing/plugins/pdf/pdf-in-iframe-scrolling-tree-after-back.html
    A LayoutTests/compositing/plugins/pdf/resources/go-back.html
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] scrolling is broken after navigating back to a PDF
https://bugs.webkit.org/show_bug.cgi?id=268228
rdar://120847163

Reviewed by Tim Horton.

When navigating back to a main frame PDF using the UnifiedPDF plugin, we'd fail to hook up
the scrolling tree, resulting in assertions in debug builds, and scrolling failures in release.

The bug happens because when navigating back, the ordering of creating the plugin's scrolling
node, and the main frame's scrolling node is different; the plugin node gets created first,
but with no parent, so it's thrown away, and the scrolling coordinator re-creates it later
with the same ID, but without the necessary layers.

Fix by creating the plugin's scrolling node on demand, when scrollingNodeID() is called.

The new test doesn't not actually replicate the bug (we can't yet test main frame PDFs),
but seems like a good test to have that exercises history.back() in an iframe with a PDF.

* LayoutTests/compositing/plugins/pdf/pdf-in-iframe-scrolling-tree-after-back-expected.txt: Added.
* LayoutTests/compositing/plugins/pdf/pdf-in-iframe-scrolling-tree-after-back.html: Added.
* LayoutTests/compositing/plugins/pdf/resources/go-back.html: Added.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::ensureLayers):
(WebKit::UnifiedPDFPlugin::scrollingNodeID const):
(WebKit::UnifiedPDFPlugin::createScrollingNodeIfNecessary):

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




More information about the webkit-changes mailing list