Bug 185742

Summary: AX: [macOS] Expose the primary screen height through AX API
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, ews-watchlist, jcraig, jdiggs, n_wang, rniwa, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
ews-watchlist: commit-queue-
Archive of layout-test-results from ews103 for mac-sierra
none
patch
none
patch none

Description Nan Wang 2018-05-17 13:41:15 PDT
Connecting to WindowServer to get the screen size is not allowed, so that we should expose the value through AXAPI.

<rdar://problem/40265269>
Comment 1 Nan Wang 2018-05-17 13:45:43 PDT
Created attachment 340632 [details]
patch
Comment 2 chris fleizach 2018-05-17 14:51:39 PDT
Comment on attachment 340632 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340632&action=review

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1831
> +    FloatRect screenRect = screenRectForPrimaryScreen();

will this still work if the window is on a 2nd monitor?

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:50
> +#ifndef NSAccessibilityPrimaryScreenHeightAttribute

there must be one place in WebCore that we can put this string.
Comment 3 EWS Watchlist 2018-05-17 14:53:17 PDT
Comment on attachment 340632 [details]
patch

Attachment 340632 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/7714803

New failing tests:
accessibility/plugin.html
accessibility/mac/bounds-for-range.html
accessibility/table-attributes.html
accessibility/mac/aria-columnrowheaders.html
accessibility/mac/primary-screen-height.html
accessibility/mac/document-links.html
accessibility/table-with-rules.html
accessibility/math-multiscript-attributes.html
accessibility/table-one-cell.html
accessibility/table-cells.html
accessibility/table-sections.html
accessibility/mac/internal-link-anchors.html
accessibility/table-cell-spans.html
accessibility/image-map2.html
accessibility/lists.html
accessibility/transformed-element.html
media/modern-media-controls/scrubber-support/scrubber-support-drag.html
accessibility/internal-link-anchors2.html
accessibility/image-link.html
Comment 4 EWS Watchlist 2018-05-17 14:53:18 PDT
Created attachment 340652 [details]
Archive of layout-test-results from ews103 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 5 Nan Wang 2018-05-17 14:54:36 PDT
Comment on attachment 340632 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340632&action=review

Will also looking at the test failures

>> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1831
>> +    FloatRect screenRect = screenRectForPrimaryScreen();
> 
> will this still work if the window is on a 2nd monitor?

Yes. It will always return the primary screen height

>> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:50
>> +#ifndef NSAccessibilityPrimaryScreenHeightAttribute
> 
> there must be one place in WebCore that we can put this string.

Ok looking
Comment 6 Nan Wang 2018-05-17 15:37:58 PDT
Created attachment 340662 [details]
patch

updated from review and fixed failing tests
Comment 7 chris fleizach 2018-05-17 16:15:54 PDT
Comment on attachment 340662 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340662&action=review

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:73
> +    static Class cls = objc_getClass("WebAccessibilityObjectWrapper");

I was thinking something in an exported header

like

#include <WebCore/AccessibilityObject.h>

or maybe we can export a Mac header for this one...
Comment 8 Nan Wang 2018-05-17 16:44:04 PDT
Created attachment 340667 [details]
patch

update
Comment 9 WebKit Commit Bot 2018-05-17 18:27:54 PDT
Comment on attachment 340667 [details]
patch

Clearing flags on attachment: 340667

Committed r231937: <https://trac.webkit.org/changeset/231937>
Comment 10 WebKit Commit Bot 2018-05-17 18:27:55 PDT
All reviewed patches have been landed.  Closing bug.