Bug 232759 - AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
Summary: AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidge...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
Keywords: InRadar
Depends on:
Reported: 2021-11-05 10:13 PDT by Tyler Wilcock
Modified: 2021-11-06 21:07 PDT (History)
10 users (show)

See Also:

Patch (3.94 KB, patch)
2021-11-05 11:34 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (6.45 KB, patch)
2021-11-05 15:27 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2021-11-05 10:13:07 PDT
This is a regression from https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs loaded via <embed> accessible).
Comment 1 Radar WebKit Bug Importer 2021-11-05 10:13:34 PDT
Comment 2 Tyler Wilcock 2021-11-05 11:34:39 PDT
Created attachment 443420 [details]
Comment 3 chris fleizach 2021-11-05 11:55:46 PDT
Comment on attachment 443420 [details]

Is it possible to have a test for this
Comment 4 Andres Gonzalez 2021-11-05 13:42:47 PDT
(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()) {
Comment 5 Tyler Wilcock 2021-11-05 15:27:55 PDT
Created attachment 443443 [details]
Comment 6 Tyler Wilcock 2021-11-05 15:29:04 PDT
(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:


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.
Comment 7 EWS 2021-11-06 21:07:51 PDT
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].