Expose the AX tree of PDFs loaded via iframes on the Mac
commit8a19c6e3eecac310cce917fb7d27d12ffa5a0afc
authortyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2022 23:37:42 +0000 (22 23:37 +0000)
committertyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2022 23:37:42 +0000 (22 23:37 +0000)
tree87033cf1e4b17290ea82c56d868fd77e506c05ac
parentdf1865055ba8daddd471dcf7285b80680b86fcd2
Expose the AX tree of PDFs loaded via iframes on the Mac
https://bugs.webkit.org/show_bug.cgi?id=238168

Reviewed by Chris Fleizach.

Source/WebKit:

Given this markup:

<iframe src="/path/to/paystub.pdf">

An accessibility tree is built for paystub.pdf, but we don't expose it
to AX clients, making the PDF entirely inaccessible.

This happens because we were setting the AX parent to be the webpage
for full-frame PDF plugins (which an iframe with this markup is).
This behavior is correct only for main-frame (i.e. not iframe)
full-frame plugins, so this patch adds an extra condition to that logic.

Test: accessibility/mac/iframe-pdf.html

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):

LayoutTests:

* accessibility/mac/iframe-pdf-expected.txt: Added.
* accessibility/mac/iframe-pdf.html: Added.
* platform/mac-wk1/TestExpectations:
Skip new test as it always times out in WK1 (similar to
accessibility/mac/basic-embed-pdf-accessibility.html)

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@291724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/iframe-pdf-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/iframe-pdf.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm