⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 291724 in webkit


Ignore:
Timestamp:
Mar 22, 2022, 4:37:42 PM (4 years ago)
Author:
Tyler Wilcock
Message:

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)

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r291723 r291724  
     12022-03-22  Tyler Wilcock  <tyler_w@apple.com>
     2
     3        Expose the AX tree of PDFs loaded via iframes on the Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=238168
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/mac/iframe-pdf-expected.txt: Added.
     9        * accessibility/mac/iframe-pdf.html: Added.
     10        * platform/mac-wk1/TestExpectations:
     11        Skip new test as it always times out in WK1 (similar to
     12        accessibility/mac/basic-embed-pdf-accessibility.html)
     13
    1142022-03-22  Robert Jenner  <Jenner@apple.com>
    215
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r291600 r291724  
    872872# Skip because the embedded plugin never resolves in WK1, resulting in a timeout.
    873873accessibility/mac/basic-embed-pdf-accessibility.html [ Skip ]
     874accessibility/mac/iframe-pdf.html [ Skip ]
    874875
    875876# rdar://problem/26478296
  • trunk/Source/WebKit/ChangeLog

    r291699 r291724  
     12022-03-22  Tyler Wilcock  <tyler_w@apple.com>
     2
     3        Expose the AX tree of PDFs loaded via iframes on the Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=238168
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Given this markup:
     9
     10        <iframe src="/path/to/paystub.pdf">
     11
     12        An accessibility tree is built for paystub.pdf, but we don't expose it
     13        to AX clients, making the PDF entirely inaccessible.
     14
     15        This happens because we were setting the AX parent to be the webpage
     16        for full-frame PDF plugins (which an iframe with this markup is).
     17        This behavior is correct only for main-frame (i.e. not iframe)
     18        full-frame plugins, so this patch adds an extra condition to that logic.
     19
     20        Test: accessibility/mac/iframe-pdf.html
     21
     22        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     23        (WebKit::PDFPlugin::PDFPlugin):
     24
    1252022-03-22  Fujii Hironori  <Hironori.Fujii@sony.com>
    226
  • trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

    r290794 r291724  
    674674    m_accessibilityObject = adoptNS([[WKPDFPluginAccessibilityObject alloc] initWithPDFPlugin:this andElement:pluginElement]);
    675675    [m_accessibilityObject setPdfLayerController:m_pdfLayerController.get()];
    676     if (isFullFrame)
     676    if (isFullFrame && frame.isMainFrame())
    677677        [m_accessibilityObject setParent:frame.page()->accessibilityRemoteObject()];
    678     // If the plugin is not full-frame, we'll need to set the parent later after the AXObjectCache for the document has been initialized.
     678    // If this is not a main-frame (e.g. it originated from an iframe) full-frame plugin, we'll need to set the parent later after the AXObjectCache has been initialized.
    679679
    680680    [m_containerLayer addSublayer:m_contentLayer.get()];
Note: See TracChangeset for help on using the changeset viewer.