WebKit Bugzilla
Attachment 340667 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), 16.96 KB, created by
Nan Wang
on 2018-05-17 16:44:04 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2018-05-17 16:44:04 PDT
Size:
16.96 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 231816) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,25 @@ >+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 >+ >+ * 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-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/WebCore.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebCore/WebCore.xcodeproj/project.pbxproj (revision 231816) >+++ Source/WebCore/WebCore.xcodeproj/project.pbxproj (working copy) >@@ -711,7 +711,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, ); }; }; >@@ -3275,7 +3275,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 */; }; >@@ -26927,6 +26927,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 */, >@@ -30719,9 +30721,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 */, >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h (revision 231816) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h (working copy) >@@ -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; >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (revision 231816) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (working copy) >@@ -1656,6 +1656,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 +1822,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 +2709,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) >@@ -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 @@ - (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 +148,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: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 231930) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+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!). >+ >+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm: >+ (attributesOfElement): >+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: >+ (WTR::attributesOfElement): >+ > 2018-05-17 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r231912. >Index: Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm >=================================================================== >--- Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (revision 231816) >+++ Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (working copy) >@@ -158,6 +158,10 @@ static NSString* attributesOfElement(id > 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 >Index: Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (revision 231816) >+++ Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (working copy) >@@ -172,6 +172,10 @@ static NSString* attributesOfElement(id > 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 >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> >Index: LayoutTests/platform/mac-wk1/TestExpectations >=================================================================== >--- LayoutTests/platform/mac-wk1/TestExpectations (revision 231816) >+++ LayoutTests/platform/mac-wk1/TestExpectations (working copy) >@@ -514,6 +514,9 @@ webkit.org/b/184742 accessibility/mac/as > > 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 ] >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185742
:
340632
|
340652
|
340662
| 340667