WebKit Bugzilla
Attachment 340632 Details for
Bug 185742
: AX: [macOS] Expose the primary screen height through AX API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch.txt (text/plain), 9.47 KB, created by
Nan Wang
on 2018-05-17 13:45:43 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-05-17 13:45:43 PDT
Size:
9.47 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 231816) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2018-05-17 Nan Wang <n_wang@apple.com> >+ >+ AX: [macOS] Expose the primary screen height through AX API >+ https://bugs.webkit.org/show_bug.cgi?id=185742 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a new attribute to expose the primary screen size on both >+ WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject. >+ >+ Test: accessibility/mac/primary-screen-height.html >+ >+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: >+ (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]): >+ (-[WebAccessibilityObjectWrapper primaryScreenHeight]): >+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): >+ * platform/PlatformScreen.h: >+ * platform/mac/PlatformScreenMac.mm: >+ (WebCore::screenRectForPrimaryScreen): >+ > 2018-05-15 Charles Vazac <cvazac@gmail.com> > > Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser. >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (revision 231816) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (working copy) >@@ -368,6 +368,10 @@ using namespace HTMLNames; > #define NSAccessibilitySelectTextWithCriteriaParameterizedAttribute @"AXSelectTextWithCriteria" > #endif > >+#ifndef NSAccessibilityPrimaryScreenHeightAttribute >+#define NSAccessibilityPrimaryScreenHeightAttribute @"_AXPrimaryScreenHeight" >+#endif >+ > // Math attributes > #define NSAccessibilityMathRootRadicandAttribute @"AXMathRootRadicand" > #define NSAccessibilityMathRootIndexAttribute @"AXMathRootIndex" >@@ -1656,6 +1660,9 @@ - (NSArray*)accessibilityAttributeNames > if (m_object->currentState() != AccessibilityCurrentState::False) > objectAttributes = [objectAttributes arrayByAddingObjectsFromArray:@[ NSAccessibilityARIACurrentAttribute ]]; > >+ // AppKit needs to know the screen height in order to do the coordinate conversion. >+ objectAttributes = [objectAttributes arrayByAddingObjectsFromArray:@[ NSAccessibilityPrimaryScreenHeightAttribute ]]; >+ > return objectAttributes; > } > >@@ -1819,6 +1826,12 @@ - (NSBezierPath *)path > return [self bezierPathFromPath:transformedPath]; > } > >+- (NSNumber *)primaryScreenHeight >+{ >+ FloatRect screenRect = screenRectForPrimaryScreen(); >+ return [NSNumber numberWithFloat:screenRect.height()]; >+} >+ > - (NSValue *)position > { > IntRect rect = snappedIntRect(m_object->elementRect()); >@@ -2700,6 +2713,8 @@ - (id)accessibilityAttributeValue:(NSStr > return [NSValue valueWithSize: NSMakeSize(s.width(), s.height())]; > } > >+ if ([attributeName isEqualToString: NSAccessibilityPrimaryScreenHeightAttribute]) >+ return [self primaryScreenHeight]; > if ([attributeName isEqualToString: NSAccessibilityPositionAttribute]) > return [self position]; > if ([attributeName isEqualToString:NSAccessibilityPathAttribute]) >Index: Source/WebCore/platform/PlatformScreen.h >=================================================================== >--- Source/WebCore/platform/PlatformScreen.h (revision 231816) >+++ Source/WebCore/platform/PlatformScreen.h (working copy) >@@ -85,6 +85,7 @@ NSScreen *screen(NSWindow *); > NSScreen *screen(PlatformDisplayID); > > FloatRect screenRectForDisplay(PlatformDisplayID); >+WEBCORE_EXPORT FloatRect screenRectForPrimaryScreen(); > > WEBCORE_EXPORT FloatRect toUserSpace(const NSRect&, NSWindow *destination); > FloatRect toUserSpaceForPrimaryScreen(const NSRect&); >Index: Source/WebCore/platform/mac/PlatformScreenMac.mm >=================================================================== >--- Source/WebCore/platform/mac/PlatformScreenMac.mm (revision 231816) >+++ Source/WebCore/platform/mac/PlatformScreenMac.mm (working copy) >@@ -221,6 +221,11 @@ FloatRect screenRectForDisplay(PlatformD > return screen(displayID).frame; > } > >+FloatRect screenRectForPrimaryScreen() >+{ >+ return screenRectForDisplay(primaryScreenDisplayID()); >+} >+ > FloatRect screenRect(Widget* widget) > { > if (!screenProperties().isEmpty()) >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 231918) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-05-17 Nan Wang <n_wang@apple.com> >+ >+ AX: [macOS] Expose the primary screen height through AX API >+ https://bugs.webkit.org/show_bug.cgi?id=185742 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: >+ (-[WKAccessibilityWebPageObject accessibilityAttributeNames]): >+ (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): >+ > 2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [WPE] Implement and enable FULLSCREEN_API >Index: Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (revision 231816) >+++ Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (working copy) >@@ -47,6 +47,10 @@ > #import <pal/spi/mac/NSAccessibilitySPI.h> > #import <wtf/ObjcRuntimeExtras.h> > >+#ifndef NSAccessibilityPrimaryScreenHeightAttribute >+#define NSAccessibilityPrimaryScreenHeightAttribute @"_AXPrimaryScreenHeight" >+#endif >+ > using namespace WebCore; > using namespace WebKit; > >@@ -70,7 +74,7 @@ - (NSArray *)accessibilityAttributeNames > m_attributeNames = adoptNS([[NSArray alloc] initWithObjects: > NSAccessibilityRoleAttribute, NSAccessibilityRoleDescriptionAttribute, NSAccessibilityFocusedAttribute, > NSAccessibilityParentAttribute, NSAccessibilityWindowAttribute, NSAccessibilityTopLevelUIElementAttribute, >- NSAccessibilityPositionAttribute, NSAccessibilitySizeAttribute, NSAccessibilityChildrenAttribute, nil]); >+ NSAccessibilityPositionAttribute, NSAccessibilitySizeAttribute, NSAccessibilityChildrenAttribute, NSAccessibilityPrimaryScreenHeightAttribute, nil]); > > return m_attributeNames.get(); > } >@@ -147,6 +151,9 @@ - (id)accessibilityAttributeValue:(NSStr > return [NSValue valueWithPoint:NSMakePoint(point.x(), point.y())]; > } > >+ if ([attribute isEqualToString:NSAccessibilityPrimaryScreenHeightAttribute]) >+ return [[self accessibilityRootObjectWrapper] accessibilityAttributeValue:attribute]; >+ > if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) { > const IntSize& s = m_page->size(); > return [NSValue valueWithSize:NSMakeSize(s.width(), s.height())]; >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 231816) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2018-05-17 Nan Wang <n_wang@apple.com> >+ >+ AX: [macOS] Expose the primary screen height through AX API >+ https://bugs.webkit.org/show_bug.cgi?id=185742 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/mac/primary-screen-height-expected.txt: Added. >+ * accessibility/mac/primary-screen-height.html: Added. >+ > 2018-05-15 Charles Vazac <cvazac@gmail.com> > > Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser. >Index: LayoutTests/accessibility/mac/primary-screen-height-expected.txt >=================================================================== >--- LayoutTests/accessibility/mac/primary-screen-height-expected.txt (nonexistent) >+++ LayoutTests/accessibility/mac/primary-screen-height-expected.txt (working copy) >@@ -0,0 +1,12 @@ >+Click >+This tests the primary screen height is exposed to AX API from web process. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS screenHeightFromRootElement > 0 is true >+PASS screenHeightFromWebArea > 0 is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/accessibility/mac/primary-screen-height.html >=================================================================== >--- LayoutTests/accessibility/mac/primary-screen-height.html (nonexistent) >+++ LayoutTests/accessibility/mac/primary-screen-height.html (working copy) >@@ -0,0 +1,29 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body> >+ >+<button id="button1">Click</button> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ description("This tests the primary screen height is exposed to AX API from web process."); >+ if (window.accessibilityController) { >+ var rootElement = accessibilityController.rootElement; >+ var webArea = accessibilityController.rootElement.childAtIndex(0); >+ >+ var screenHeightFromRootElement = rootElement.numberAttributeValue("_AXPrimaryScreenHeight"); >+ shouldBeTrue("screenHeightFromRootElement > 0"); >+ >+ var screenHeightFromWebArea = webArea.numberAttributeValue("_AXPrimaryScreenHeight"); >+ shouldBeTrue("screenHeightFromWebArea > 0"); >+ } >+ >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185742
:
340632
|
340652
|
340662
|
340667