Title: [231943] branches/safari-606.1.17-branch
Revision
231943
Author
bshaf...@apple.com
Date
2018-05-17 22:39:01 -0700 (Thu, 17 May 2018)

Log Message

Cherry-pick r231937. rdar://problem/40265269

    AX: [macOS] Expose the primary screen height through AX API
    https://bugs.webkit.org/show_bug.cgi?id=185742

    Reviewed by Chris Fleizach.

    Source/WebCore:

    Added a new attribute to expose the primary screen size on both
    WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.

    Test: accessibility/mac/primary-screen-height.html

    * WebCore.xcodeproj/project.pbxproj:
    * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
    (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
    (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
    * platform/PlatformScreen.h:
    * platform/mac/PlatformScreenMac.mm:
    (WebCore::screenRectForPrimaryScreen):

    Source/WebKit:

    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
    (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
    (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):

    Tools:

    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
    (attributesOfElement):
    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
    (WTR::attributesOfElement):

    LayoutTests:

    * accessibility/mac/primary-screen-height-expected.txt: Added.
    * accessibility/mac/primary-screen-height.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231937 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-606.1.17-branch/LayoutTests/ChangeLog (231942 => 231943)


--- branches/safari-606.1.17-branch/LayoutTests/ChangeLog	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/LayoutTests/ChangeLog	2018-05-18 05:39:01 UTC (rev 231943)
@@ -1,3 +1,60 @@
+2018-05-17  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r231937. rdar://problem/40265269
+
+    AX: [macOS] Expose the primary screen height through AX API
+    https://bugs.webkit.org/show_bug.cgi?id=185742
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Added a new attribute to expose the primary screen size on both
+    WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
+    
+    Test: accessibility/mac/primary-screen-height.html
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+    (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+    * platform/PlatformScreen.h:
+    * platform/mac/PlatformScreenMac.mm:
+    (WebCore::screenRectForPrimaryScreen):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+    (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
+    (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+    
+    Tools:
+    
+    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+    (attributesOfElement):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::attributesOfElement):
+    
+    LayoutTests:
+    
+    * accessibility/mac/primary-screen-height-expected.txt: Added.
+    * accessibility/mac/primary-screen-height.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-17  Nan Wang  <n_w...@apple.com>
+
+            AX: [macOS] Expose the primary screen height through AX API
+            https://bugs.webkit.org/show_bug.cgi?id=185742
+
+            Reviewed by Chris Fleizach.
+
+            * accessibility/mac/primary-screen-height-expected.txt: Added.
+            * accessibility/mac/primary-screen-height.html: Added.
+
 2018-05-16  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r231779. rdar://problem/39999778

Added: branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height-expected.txt (0 => 231943)


--- branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height-expected.txt	                        (rev 0)
+++ branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height-expected.txt	2018-05-18 05:39:01 UTC (rev 231943)
@@ -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
+

Added: branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height.html (0 => 231943)


--- branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height.html	                        (rev 0)
+++ branches/safari-606.1.17-branch/LayoutTests/accessibility/mac/primary-screen-height.html	2018-05-18 05:39:01 UTC (rev 231943)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src=""
+</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=""
+</body>
+</html>

Modified: branches/safari-606.1.17-branch/LayoutTests/platform/mac-wk1/TestExpectations (231942 => 231943)


--- branches/safari-606.1.17-branch/LayoutTests/platform/mac-wk1/TestExpectations	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/LayoutTests/platform/mac-wk1/TestExpectations	2018-05-18 05:39:01 UTC (rev 231943)
@@ -512,6 +512,9 @@
 
 webkit.org/b/182752 accessibility/mac/accessibility-make-first-responder.html [ Skip ]
 
+# This test tests the rootElement on WK2.
+webkit.org/b/185742 accessibility/mac/primary-screen-height.html [ Skip ]
+
 # User-installed fonts test infrastructure is not present in WK1
 webkit.org/b/180062 fast/text/user-installed-fonts [ ImageOnlyFailure ]
 

Modified: branches/safari-606.1.17-branch/Source/WebCore/ChangeLog (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/ChangeLog	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/ChangeLog	2018-05-18 05:39:01 UTC (rev 231943)
@@ -1,3 +1,72 @@
+2018-05-17  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r231937. rdar://problem/40265269
+
+    AX: [macOS] Expose the primary screen height through AX API
+    https://bugs.webkit.org/show_bug.cgi?id=185742
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Added a new attribute to expose the primary screen size on both
+    WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
+    
+    Test: accessibility/mac/primary-screen-height.html
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+    (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+    * platform/PlatformScreen.h:
+    * platform/mac/PlatformScreenMac.mm:
+    (WebCore::screenRectForPrimaryScreen):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+    (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
+    (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+    
+    Tools:
+    
+    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+    (attributesOfElement):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::attributesOfElement):
+    
+    LayoutTests:
+    
+    * accessibility/mac/primary-screen-height-expected.txt: Added.
+    * accessibility/mac/primary-screen-height.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-17  Nan Wang  <n_w...@apple.com>
+
+            AX: [macOS] Expose the primary screen height through AX API
+            https://bugs.webkit.org/show_bug.cgi?id=185742
+
+            Reviewed by Chris Fleizach.
+
+            Added a new attribute to expose the primary screen size on both
+            WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
+
+            Test: accessibility/mac/primary-screen-height.html
+
+            * WebCore.xcodeproj/project.pbxproj:
+            * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+            * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+            (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+            (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
+            (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+            * platform/PlatformScreen.h:
+            * platform/mac/PlatformScreenMac.mm:
+            (WebCore::screenRectForPrimaryScreen):
+
 2018-05-16  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r231784. rdar://problem/39999778

Modified: branches/safari-606.1.17-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-18 05:39:01 UTC (rev 231943)
@@ -710,7 +710,7 @@
 		29A812410FBB9C1D00510293 /* AccessibilityTableColumn.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812230FBB9C1D00510293 /* AccessibilityTableColumn.h */; };
 		29A812420FBB9C1D00510293 /* AccessibilityListBoxOption.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812240FBB9C1D00510293 /* AccessibilityListBoxOption.h */; };
 		29A812430FBB9C1D00510293 /* AccessibilityListBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812250FBB9C1D00510293 /* AccessibilityListBox.h */; };
-		29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812450FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h */; };
+		29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 29A812450FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29ACB211143E7128006BCA5F /* AccessibilityMockObject.h */; };
 		29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */; };
 		29FAF4B6195AB08900A522DC /* TextUndoInsertionMarkupMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 29FAF4B5195AB08900A522DC /* TextUndoInsertionMarkupMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3273,7 +3273,7 @@
 		AA2A5AD216A4860A00976A25 /* JSSpeechSynthesisEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2A5AC116A485D500976A25 /* JSSpeechSynthesisEvent.h */; };
 		AA2A5AD416A4861100975A25 /* SpeechSynthesis.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2A5ABE16A485D500975A25 /* SpeechSynthesis.h */; };
 		AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2A5AB916A485D500975A25 /* DOMWindowSpeechSynthesis.h */; };
-		AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */ = {isa = PBXBuildFile; fileRef = AA478A7D16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h */; };
+		AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */ = {isa = PBXBuildFile; fileRef = AA478A7D16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		AA4C3A770B2B1679002334A2 /* InlineStyleSheetOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = AA4C3A750B2B1679002334A2 /* InlineStyleSheetOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		AA5F3B8D16CC33D100455EB0 /* PlatformSpeechSynthesizerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */; };
 		AA5F3B8F16CC4B3900455EB0 /* PlatformSpeechSynthesizerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */; };
@@ -26897,6 +26897,8 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */,
+				AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */,
 				7CD0E2B81F80A4820016A4CE /* AbortController.h in Headers */,
 				7CD0E2BF1F80A56E0016A4CE /* AbortSignal.h in Headers */,
 				46B95195207D633400A7D2DD /* AbstractDOMWindow.h in Headers */,
@@ -30687,9 +30689,7 @@
 				FD7F299213D4C0CB00AD9535 /* WaveShaperDSPKernel.h in Headers */,
 				FD7F299413D4C0CB00AD9535 /* WaveShaperNode.h in Headers */,
 				FD7F299713D4C0CB00AD9535 /* WaveShaperProcessor.h in Headers */,
-				29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */,
 				AAA728F716D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h in Headers */,
-				AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */,
 				2D3EF4481917915C00034184 /* WebActionDisablingCALayerDelegate.h in Headers */,
 				71025ED31F99F0CE004A250C /* WebAnimation.h in Headers */,
 				7132445120109DA500AE7FB2 /* WebAnimationUtilities.h in Headers */,

Modified: branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h	2018-05-18 05:39:01 UTC (rev 231943)
@@ -32,6 +32,10 @@
 
 #if PLATFORM(MAC)
 
+#ifndef NSAccessibilityPrimaryScreenHeightAttribute
+#define NSAccessibilityPrimaryScreenHeightAttribute @"_AXPrimaryScreenHeight"
+#endif
+
 @interface WebAccessibilityObjectWrapper : WebAccessibilityObjectWrapperBase
 
 - (id)textMarkerRangeFromVisiblePositions:(const WebCore::VisiblePosition&)startPosition endPosition:(const WebCore::VisiblePosition&)endPosition;

Modified: branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2018-05-18 05:39:01 UTC (rev 231943)
@@ -1656,6 +1656,9 @@
     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 +1822,12 @@
     return [self bezierPathFromPath:transformedPath];
 }
 
+- (NSNumber *)primaryScreenHeight
+{
+    FloatRect screenRect = screenRectForPrimaryScreen();
+    return [NSNumber numberWithFloat:screenRect.height()];
+}
+
 - (NSValue *)position
 {
     IntRect rect = snappedIntRect(m_object->elementRect());
@@ -2700,6 +2709,8 @@
         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])

Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/PlatformScreen.h (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/platform/PlatformScreen.h	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/PlatformScreen.h	2018-05-18 05:39:01 UTC (rev 231943)
@@ -85,6 +85,7 @@
 NSScreen *screen(PlatformDisplayID);
 
 FloatRect screenRectForDisplay(PlatformDisplayID);
+WEBCORE_EXPORT FloatRect screenRectForPrimaryScreen();
 
 WEBCORE_EXPORT FloatRect toUserSpace(const NSRect&, NSWindow *destination);
 FloatRect toUserSpaceForPrimaryScreen(const NSRect&);

Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-05-18 05:39:01 UTC (rev 231943)
@@ -221,6 +221,11 @@
     return screen(displayID).frame;
 }
 
+FloatRect screenRectForPrimaryScreen()
+{
+    return screenRectForDisplay(primaryScreenDisplayID());
+}
+
 FloatRect screenRect(Widget* widget)
 {
     if (!screenProperties().isEmpty())

Modified: branches/safari-606.1.17-branch/Source/WebKit/ChangeLog (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-18 05:39:01 UTC (rev 231943)
@@ -1,5 +1,63 @@
 2018-05-17  Babak Shafiei  <bshaf...@apple.com>
 
+        Cherry-pick r231937. rdar://problem/40265269
+
+    AX: [macOS] Expose the primary screen height through AX API
+    https://bugs.webkit.org/show_bug.cgi?id=185742
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Added a new attribute to expose the primary screen size on both
+    WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
+    
+    Test: accessibility/mac/primary-screen-height.html
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+    (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+    * platform/PlatformScreen.h:
+    * platform/mac/PlatformScreenMac.mm:
+    (WebCore::screenRectForPrimaryScreen):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+    (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
+    (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+    
+    Tools:
+    
+    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+    (attributesOfElement):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::attributesOfElement):
+    
+    LayoutTests:
+    
+    * accessibility/mac/primary-screen-height-expected.txt: Added.
+    * accessibility/mac/primary-screen-height.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-17  Nan Wang  <n_w...@apple.com>
+
+            AX: [macOS] Expose the primary screen height through AX API
+            https://bugs.webkit.org/show_bug.cgi?id=185742
+
+            Reviewed by Chris Fleizach.
+
+            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+            (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
+            (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+
+2018-05-17  Babak Shafiei  <bshaf...@apple.com>
+
         Cherry-pick r231863. rdar://problem/40136681
 
     [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions

Modified: branches/safari-606.1.17-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (231942 => 231943)


--- branches/safari-606.1.17-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2018-05-18 05:39:01 UTC (rev 231943)
@@ -44,6 +44,7 @@
 #import <WebCore/PageOverlayController.h>
 #import <WebCore/ScrollView.h>
 #import <WebCore/Scrollbar.h>
+#import <WebCore/WebAccessibilityObjectWrapperMac.h>
 #import <pal/spi/mac/NSAccessibilitySPI.h>
 #import <wtf/ObjcRuntimeExtras.h>
 
@@ -70,7 +71,7 @@
         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 +148,9 @@
         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())];

Modified: branches/safari-606.1.17-branch/Tools/ChangeLog (231942 => 231943)


--- branches/safari-606.1.17-branch/Tools/ChangeLog	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Tools/ChangeLog	2018-05-18 05:39:01 UTC (rev 231943)
@@ -1,3 +1,62 @@
+2018-05-17  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r231937. rdar://problem/40265269
+
+    AX: [macOS] Expose the primary screen height through AX API
+    https://bugs.webkit.org/show_bug.cgi?id=185742
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Added a new attribute to expose the primary screen size on both
+    WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
+    
+    Test: accessibility/mac/primary-screen-height.html
+    
+    * WebCore.xcodeproj/project.pbxproj:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+    (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
+    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+    * platform/PlatformScreen.h:
+    * platform/mac/PlatformScreenMac.mm:
+    (WebCore::screenRectForPrimaryScreen):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+    (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
+    (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+    
+    Tools:
+    
+    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+    (attributesOfElement):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::attributesOfElement):
+    
+    LayoutTests:
+    
+    * accessibility/mac/primary-screen-height-expected.txt: Added.
+    * accessibility/mac/primary-screen-height.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-17  Nan Wang  <n_w...@apple.com>
+
+            AX: [macOS] Expose the primary screen height through AX API
+            https://bugs.webkit.org/show_bug.cgi?id=185742
+
+            Reviewed by Chris Fleizach.
+
+            * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+            (attributesOfElement):
+            * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+            (WTR::attributesOfElement):
+
 2018-05-10  Jason Marcell  <jmarc...@apple.com>
 
         Cherry-pick r231625. rdar://problem/39664620

Modified: branches/safari-606.1.17-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (231942 => 231943)


--- branches/safari-606.1.17-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2018-05-18 05:39:01 UTC (rev 231943)
@@ -158,6 +158,10 @@
         if ([attribute isEqualToString:@"AXPosition"])
             continue;
         
+        // Skip screen-specific information.
+        if ([attribute isEqualToString:@"_AXPrimaryScreenHeight"])
+            continue;
+        
         // accessibilityAttributeValue: can throw an if an attribute is not returned.
         // For DumpRenderTree's purpose, we should ignore those exceptions
         BEGIN_AX_OBJC_EXCEPTIONS

Modified: branches/safari-606.1.17-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (231942 => 231943)


--- branches/safari-606.1.17-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2018-05-18 05:38:54 UTC (rev 231942)
+++ branches/safari-606.1.17-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2018-05-18 05:39:01 UTC (rev 231943)
@@ -172,6 +172,10 @@
         if ([attribute isEqualToString:@"AXPosition"])
             continue;
         
+        // Skip screen-specific information.
+        if ([attribute isEqualToString:@"_AXPrimaryScreenHeight"])
+            continue;
+        
         // accessibilityAttributeValue: can throw an if an attribute is not returned.
         // For DumpRenderTree's purpose, we should ignore those exceptions
         BEGIN_AX_OBJC_EXCEPTIONS
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to