This is a regression from https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs loaded via <embed> accessible).
<rdar://problem/85075555>
Created attachment 443420 [details] Patch
Comment on attachment 443420 [details] Patch Is it possible to have a test for this
(In reply to Tyler Wilcock from comment #2) > Created attachment 443420 [details] > Patch --- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp +++ a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp + bool hasPlatformWidget = widget() && widget()->platformWidget(); + if (is<PluginViewBase>(widget()) && !hasPlatformWidget) { you can write this in just one line like: if (is<PluginViewBase>(widget()) && !widget()->platformWidget()) {
Created attachment 443443 [details] Patch
(In reply to chris fleizach from comment #3) > Comment on attachment 443420 [details] > Patch > > Is it possible to have a test for this I haven't found a way to create a WK1 platformWidget-based object in a layout test. Do you know of a way? I tried un-skipping the test added by the bug that caused the regression in WK1: https://github.com/WebKit/WebKit/blob/f1f395b977bd8befab5023c5eda2cbde26aa9741/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility.html#L14 But it still times out, so it wasn't this attachment bug causing the WK1 failure (which may mean <embed>s don’t use platformWidget’s in WK1). I manually tested the WK1 WebView linked against a build of WebKit with this patch and confirmed the issue is fixed. I also manually tested both WK2 <embed> and <object> PDFs and confirmed they are still accessible (and the layout test for the WK2 path still passes). I added a test for the renderWidgetChildren + AXEmptyGroup change.
Committed r285389 (243946@main): <https://commits.webkit.org/243946@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 443443 [details].