[webkit-changes] [WebKit/WebKit] a55bd5: [UnifiedPDF] Crash when scrolling after a swipe ba...

Simon Fraser noreply at github.com
Wed Feb 21 12:49:04 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a55bd5c3df1c8395a4ca3a81c88b176ec8b3b664
      https://github.com/WebKit/WebKit/commit/a55bd5c3df1c8395a4ca3a81c88b176ec8b3b664
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M Source/WebCore/plugins/PluginViewBase.h
    M Source/WebCore/rendering/RenderEmbeddedObject.cpp
    M Source/WebCore/rendering/RenderEmbeddedObject.h
    M Source/WebCore/rendering/RenderLayerCompositor.cpp
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/Plugins/PluginView.h

  Log Message:
  -----------
  [UnifiedPDF] Crash when scrolling after a swipe back from an external link follow
https://bugs.webkit.org/show_bug.cgi?id=269244
rdar://122835175

Reviewed by Tim Horton.

Having calls to `UnifiedPDFPlugin::scrollingNodeID()` lazily create the scrolling tree node is problematic,
since this can happen early (under `UnifiedPDFPlugin::updateOverflowControlsLayers()`), which causes
the ScrollingCoordinator to create an unparented node, which is later replaced by a different node
with the same ID, causing us to lose the layer registrations.

Fix by adding an explicit `willAttachScrollingNode()` which is called by `RenderLayerCompositor::attachWidgetContentLayers()`,
and have it create the node, and done the necessary layer and geometry updates on the node.

* Source/WebCore/plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willAttachScrollingNode):
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::willAttachScrollingNode):
* Source/WebCore/rendering/RenderEmbeddedObject.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachWidgetContentLayers):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::willAttachScrollingNode):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::willAttachScrollingNode):
(WebKit::UnifiedPDFPlugin::scrollingNodeID const):
(WebKit::UnifiedPDFPlugin::createScrollingNodeIfNecessary):
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::willAttachScrollingNode):
* Source/WebKit/WebProcess/Plugins/PluginView.h:

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



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


More information about the webkit-changes mailing list