Changeset 274377 in webkit


Ignore:
Timestamp:
Mar 12, 2021 6:26:50 PM (16 months ago)
Author:
Chris Fleizach
Message:

AX: PDF frame conversion routines need to be updated
https://bugs.webkit.org/show_bug.cgi?id=223138

Reviewed by Darin Adler.

PDF bounding boxes are wrong in WebKit because.

1) There's no way for PDF objects to get the primary screen height. So we need to be able to return the primary

screen height from an object in the PDF hierarchy.

2) The WKPDFPluginAccessibilityObject's position was not being converted correctly.

  • WebProcess/Plugins/PDF/PDFPlugin.mm:

(-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
(-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(WebKit::PDFPlugin::boundsOnScreen const):

  • WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:

(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r274375 r274377  
     12021-03-12  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: PDF frame conversion routines need to be updated
     4        https://bugs.webkit.org/show_bug.cgi?id=223138
     5
     6        Reviewed by Darin Adler.
     7
     8        PDF bounding boxes are wrong in WebKit because.
     9          1) There's no way for PDF objects to get the primary screen height. So we need to be able to return the primary
     10             screen height from an object in the PDF hierarchy.
     11          2) The WKPDFPluginAccessibilityObject's position was not being converted correctly.
     12
     13        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     14        (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
     15        (-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
     16        (WebKit::PDFPlugin::boundsOnScreen const):
     17        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
     18        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
     19
    1202021-03-12  Michael Catanzaro  <mcatanzaro@gnome.org>
    221
  • trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

    r274310 r274377  
    227227    if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
    228228        return NSAccessibilityGroupRole;
     229    if ([attribute isEqualToString:NSAccessibilityPrimaryScreenHeightAttribute])
     230        return [_parent accessibilityAttributeValue:NSAccessibilityPrimaryScreenHeightAttribute];
    229231
    230232    return 0;
     
    270272        NSAccessibilityFocusedAttribute,
    271273        // PDFLayerController has its own accessibilityChildren.
    272         NSAccessibilityChildrenAttribute
     274        NSAccessibilityChildrenAttribute,
     275        NSAccessibilityPrimaryScreenHeightAttribute
    273276    ];
    274277
     
    20502053    FloatRect bounds = FloatRect(FloatPoint(), size());
    20512054    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapRect(bounds);
    2052     return frameView->contentsToScreen(enclosingIntRect(rectInRootViewCoordinates));
     2055    auto* page = m_frame->coreFrame()->page();
     2056    if (!page)
     2057        return { };
     2058    return page->chrome().rootViewToScreen(enclosingIntRect(rectInRootViewCoordinates));
    20532059}
    20542060
  • trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm

    r273194 r274377  
    4343#import <WebCore/Page.h>
    4444#import <WebCore/PageOverlayController.h>
     45#import <WebCore/PlatformScreen.h>
    4546#import <WebCore/ScrollView.h>
    4647#import <WebCore/Scrollbar.h>
     
    185186   
    186187    if ([attribute isEqualToString:NSAccessibilityPrimaryScreenHeightAttribute])
    187         return [[self accessibilityRootObjectWrapper] accessibilityAttributeValue:attribute];
     188        return @(WebCore::screenRectForPrimaryScreen().size().height());
    188189   
    189190    if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
Note: See TracChangeset for help on using the changeset viewer.