Unreviewed, rolling out r240209.
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jan 2019 18:37:18 +0000 (18:37 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jan 2019 18:37:18 +0000 (18:37 +0000)
Broke GTK/WPE injected bundle

Reverted changeset:

"AX: Support returning relative frames for accessibility"
https://bugs.webkit.org/show_bug.cgi?id=193414
https://trac.webkit.org/changeset/240209

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

20 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/relative-frame-expected.txt [deleted file]
LayoutTests/accessibility/mac/relative-frame.html [deleted file]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/mac/WKView.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

index 51bc4c0..f014182 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r240209.
+
+        Broke GTK/WPE injected bundle
+
+        Reverted changeset:
+
+        "AX: Support returning relative frames for accessibility"
+        https://bugs.webkit.org/show_bug.cgi?id=193414
+        https://trac.webkit.org/changeset/240209
+
 2019-01-20  chris fleizach  <cfleizach@apple.com>
 
         AX: Support returning relative frames for accessibility
diff --git a/LayoutTests/accessibility/mac/relative-frame-expected.txt b/LayoutTests/accessibility/mac/relative-frame-expected.txt
deleted file mode 100644 (file)
index cfa2602..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-focusable link
-This tests the relative frame attribute returns accurate data.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-relative frame: NSRect: {{8, 8}, {90, 18}}
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/accessibility/mac/relative-frame.html b/LayoutTests/accessibility/mac/relative-frame.html
deleted file mode 100644 (file)
index 3e247a7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script>
-var successfullyParsed = false;
-</script>
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body id="body">
-
-<a id="link" href="#">focusable link</a>
-
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-
-    description("This tests the relative frame attribute returns accurate data.");
-
-    if (window.accessibilityController) {
-
-        var link = accessibilityController.accessibleElementById("link");
-        debug("relative frame: " + link.stringDescriptionOfAttributeValue("AXRelativeFrame"));
-    }
-
-    successfullyParsed = true;
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
index d0887d7..e3f2645 100644 (file)
@@ -537,7 +537,6 @@ webkit.org/b/183352 accessibility/ios-simulator/AOM-dismiss-event.html [ Skip ]
 webkit.org/b/184742 accessibility/mac/async-increment-decrement-action.html [ Skip ]
 webkit.org/b/185897 accessibility/mac/AOM-event-accessiblesetvalue.html [ Skip ]
 webkit.org/b/185897 accessibility/mac/set-value-editable-types.html [ Skip ]
-webkit.org/b/193414 accessibility/mac/relative-frame.html [ Skip ]
 
 webkit.org/b/182752 accessibility/mac/accessibility-make-first-responder.html [ Skip ]
 
@@ -666,4 +665,4 @@ webkit.org/b/190383 fast/images/animated-image-different-dest-size.html [ Pass I
 
 webkit.org/b/191639 imported/blink/compositing/squashing/squashing-into-ancestor-painted-layer.html [ Pass ImageOnlyFailure ]
 
-webkit.org/b/190627  [ Mojave+ ] compositing/masks/compositing-clip-path-change-no-repaint.html  [ Pass Failure ]
+webkit.org/b/190627  [ Mojave+ ] compositing/masks/compositing-clip-path-change-no-repaint.html  [ Pass Failure ]
\ No newline at end of file
index 5df2429..483f11f 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r240209.
+
+        Broke GTK/WPE injected bundle
+
+        Reverted changeset:
+
+        "AX: Support returning relative frames for accessibility"
+        https://bugs.webkit.org/show_bug.cgi?id=193414
+        https://trac.webkit.org/changeset/240209
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 25e8bc4..7fb62f8 100644 (file)
@@ -77,6 +77,7 @@ enum {
 @end
 
 @interface WebAccessibilityObjectWrapper (AccessibilityPrivate)
+- (id)_accessibilityWebDocumentView;
 - (id)accessibilityContainer;
 - (void)setAccessibilityLabel:(NSString *)label;
 - (void)setAccessibilityValue:(NSString *)value;
@@ -1497,9 +1498,8 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     if (![self _prepareAccessibilityCall])
         return point;
     
-    auto floatPoint = FloatPoint(point);
-    auto floatRect = FloatRect(floatPoint, FloatSize());
-    return [self convertRectToSpace:floatRect space:ScreenSpace].origin;
+    FloatPoint floatPoint = FloatPoint(point);
+    return [self convertPointToScreenSpace:floatPoint];
 }
 
 - (BOOL)accessibilityPerformEscape
@@ -1560,10 +1560,102 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     return result;
 }
 
-- (CGRect)_accessibilityRelativeFrame
+- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
 {
-    auto rect = FloatRect(snappedIntRect(m_object->elementRect()));
-    return [self convertRectToSpace:rect space:PageSpace];
+    if (!m_object)
+        return CGPointZero;
+    
+    CGPoint cgPoint = CGPointMake(point.x(), point.y());
+    
+    FrameView* frameView = m_object->documentFrameView();
+    WAKView* documentView = frameView ? frameView->documentView() : nullptr;
+    if (documentView) {
+        cgPoint = [documentView convertPoint:cgPoint toView:nil];
+
+        // we need the web document view to give us our final screen coordinates
+        // because that can take account of the scroller
+        id webDocument = [self _accessibilityWebDocumentView];
+        if (webDocument)
+            cgPoint = [webDocument convertPoint:cgPoint toView:nil];
+    }
+    else {
+        // Find the appropriate scroll view to use to convert the contents to the window.
+        ScrollView* scrollView = nullptr;
+        const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) {
+            return is<AccessibilityScrollView>(object);
+        });
+        if (parent)
+            scrollView = downcast<AccessibilityScrollView>(*parent).scrollView();
+        
+        IntPoint intPoint = flooredIntPoint(point);
+        if (scrollView)
+            intPoint = scrollView->contentsToRootView(intPoint);
+        
+        Page* page = m_object->page();
+        
+        // If we have an empty chrome client (like SVG) then we should use the page
+        // of the scroll view parent to help us get to the screen rect.
+        if (parent && page && page->chrome().client().isEmptyChromeClient())
+            page = parent->page();
+        
+        if (page) {
+            IntRect rect = IntRect(intPoint, IntSize(0, 0));
+            intPoint = page->chrome().rootViewToAccessibilityScreen(rect).location();
+        }
+        
+        cgPoint = (CGPoint)intPoint;
+    }
+    
+    return cgPoint;
+}
+
+- (CGRect)convertRectToScreenSpace:(IntRect &)rect
+{
+    if (!m_object)
+        return CGRectZero;
+    
+    CGSize size = CGSizeMake(rect.size().width(), rect.size().height());
+    CGPoint point = CGPointMake(rect.x(), rect.y());
+    
+    CGRect frame = CGRectMake(point.x, point.y, size.width, size.height);
+    
+    FrameView* frameView = m_object->documentFrameView();
+    WAKView* documentView = frameView ? frameView->documentView() : nil;
+    if (documentView) {
+        frame = [documentView convertRect:frame toView:nil];
+        
+        // we need the web document view to give us our final screen coordinates
+        // because that can take account of the scroller
+        id webDocument = [self _accessibilityWebDocumentView];
+        if (webDocument)
+            frame = [webDocument convertRect:frame toView:nil];
+        
+    } else {
+        // Find the appropriate scroll view to use to convert the contents to the window.
+        ScrollView* scrollView = nullptr;
+        const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) {
+            return is<AccessibilityScrollView>(object);
+        });
+        if (parent)
+            scrollView = downcast<AccessibilityScrollView>(*parent).scrollView();
+        
+        if (scrollView)
+            rect = scrollView->contentsToRootView(rect);
+        
+        Page* page = m_object->page();
+        
+        // If we have an empty chrome client (like SVG) then we should use the page
+        // of the scroll view parent to help us get to the screen rect.
+        if (parent && page && page->chrome().client().isEmptyChromeClient())
+            page = parent->page();
+        
+        if (page)
+            rect = page->chrome().rootViewToAccessibilityScreen(rect);
+        
+        frame = (CGRect)rect;
+    }
+    
+    return frame;
 }
 
 // Used by UIKit accessibility bundle to help determine distance during a hit-test.
@@ -1581,11 +1673,11 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     if (![self _prepareAccessibilityCall])
         return CGRectZero;
     
-    auto document = m_object->document();
+    Document* document = m_object->document();
     if (!document || !document->view())
         return CGRectZero;
-    auto rect = FloatRect(snappedIntRect(document->view()->unobscuredContentRect()));
-    return [self convertRectToSpace:rect space:ScreenSpace];
+    IntRect rect = snappedIntRect(document->view()->unobscuredContentRect());
+    return [self convertRectToScreenSpace:rect];
 }
 
 // The "center point" is where VoiceOver will "press" an object. This may not be the actual
@@ -1595,8 +1687,8 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     if (![self _prepareAccessibilityCall])
         return CGPointZero;
     
-    auto rect = FloatRect(snappedIntRect(m_object->boundingBoxRect()));
-    CGRect cgRect = [self convertRectToSpace:rect space:ScreenSpace];
+    IntRect rect = snappedIntRect(m_object->boundingBoxRect());
+    CGRect cgRect = [self convertRectToScreenSpace:rect];
     return CGPointMake(CGRectGetMidX(cgRect), CGRectGetMidY(cgRect));
 }
 
@@ -1605,8 +1697,8 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     if (![self _prepareAccessibilityCall])
         return CGRectZero;
     
-    auto rect = FloatRect(snappedIntRect(m_object->elementRect()));
-    return [self convertRectToSpace:rect space:ScreenSpace];
+    IntRect rect = snappedIntRect(m_object->elementRect());
+    return [self convertRectToScreenSpace:rect];
 }
 
 // Checks whether a link contains only static text and images (and has been divided unnaturally by <spans> and other nefarious mechanisms).
@@ -2650,8 +2742,8 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
     if (!range)
         return CGRectZero;
     
-    auto rect = FloatRect(m_object->boundsForRange(range));
-    return [self convertRectToSpace:rect space:ScreenSpace];
+    IntRect rect = m_object->boundsForRange(range);
+    return [self convertRectToScreenSpace:rect];
 }
 
 - (RefPtr<Range>)rangeFromMarkers:(NSArray *)markers withText:(NSString *)text
@@ -2696,8 +2788,8 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
     NSMutableArray *rects = [NSMutableArray arrayWithCapacity:size];
     for (unsigned i = 0; i < size; i++) {
         const WebCore::SelectionRect& coreRect = selectionRects[i];
-        auto selectionRect = FloatRect(coreRect.rect());
-        CGRect rect = [self convertRectToSpace:selectionRect space:ScreenSpace];
+        IntRect selectionRect = coreRect.rect();
+        CGRect rect = [self convertRectToScreenSpace:selectionRect];
         [rects addObject:[NSValue valueWithRect:rect]];
     }
     
index c31cab8..04749be 100644 (file)
@@ -65,9 +65,7 @@ class VisiblePosition;
 - (void)accessibilityPostedNotification:(NSString *)notificationName userInfo:(NSDictionary *)userInfo;
 
 - (CGPathRef)convertPathToScreenSpace:(WebCore::Path &)path;
-
-enum ConversionSpace { ScreenSpace, PageSpace };
-- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space;
+- (CGPoint)convertPointToScreenSpace:(WebCore::FloatPoint &)point;
 
 // Math related functions
 - (NSArray *)accessibilityMathPostscriptPairs;
@@ -76,10 +74,6 @@ enum ConversionSpace { ScreenSpace, PageSpace };
 extern WebCore::AccessibilitySearchCriteria accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(const NSDictionary *);
 extern NSArray *convertToNSArray(const WebCore::AccessibilityObject::AccessibilityChildrenVector&);
 
-#if PLATFORM(IOS_FAMILY)
-- (id)_accessibilityWebDocumentView;
-#endif
-
 @end
 
 #endif // WebAccessibilityObjectWrapperBase_h
index 7ad8510..ae66acd 100644 (file)
@@ -42,8 +42,6 @@
 #import "AccessibilityTableCell.h"
 #import "AccessibilityTableColumn.h"
 #import "AccessibilityTableRow.h"
-#import "Chrome.h"
-#import "ChromeClient.h"
 #import "ColorMac.h"
 #import "ContextMenuController.h"
 #import "Editing.h"
@@ -53,7 +51,6 @@
 #import "FrameLoaderClient.h"
 #import "FrameSelection.h"
 #import "HTMLNames.h"
-#import "LayoutRect.h"
 #import "LocalizedStrings.h"
 #import "Page.h"
 #import "RenderTextControl.h"
@@ -63,8 +60,6 @@
 #import "TextCheckerClient.h"
 #import "TextCheckingHelper.h"
 #import "VisibleUnits.h"
-#import "WAKView.h"
-#import "WAKWindow.h"
 #import "WebCoreFrameView.h"
 
 using namespace WebCore;
@@ -466,42 +461,31 @@ static void convertPathToScreenSpaceFunction(PathConversionInfo& conversion, con
 {
     WebAccessibilityObjectWrapperBase *wrapper = conversion.wrapper;
     CGMutablePathRef newPath = conversion.path;
-    FloatRect rect;
     switch (element.type) {
     case PathElementMoveToPoint:
     {
-        rect = FloatRect(element.points[0], FloatSize());
-        CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
+        CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]];
         CGPathMoveToPoint(newPath, nil, newPoint.x, newPoint.y);
         break;
     }
     case PathElementAddLineToPoint:
     {
-        rect = FloatRect(element.points[0], FloatSize());
-        CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
+        CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]];
         CGPathAddLineToPoint(newPath, nil, newPoint.x, newPoint.y);
         break;
     }
     case PathElementAddQuadCurveToPoint:
     {
-        rect = FloatRect(element.points[0], FloatSize());
-        CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
-
-        rect = FloatRect(element.points[1], FloatSize());
-        CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
+        CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]];
+        CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]];
         CGPathAddQuadCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y);
         break;
     }
     case PathElementAddCurveToPoint:
     {
-        rect = FloatRect(element.points[0], FloatSize());
-        CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
-
-        rect = FloatRect(element.points[1], FloatSize());
-        CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
-
-        rect = FloatRect(element.points[2], FloatSize());
-        CGPoint newPoint3 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin;
+        CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]];
+        CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]];
+        CGPoint newPoint3 = [wrapper convertPointToScreenSpace:element.points[2]];
         CGPathAddCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y, newPoint3.x, newPoint3.y);
         break;
     }
@@ -523,80 +507,11 @@ static void convertPathToScreenSpaceFunction(PathConversionInfo& conversion, con
     return conversion.path;
 }
 
-- (id)_accessibilityWebDocumentView
+- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
 {
+    UNUSED_PARAM(point);
     ASSERT_NOT_REACHED();
-    // Overridden by sub-classes
-    return nil;
-}
-
-- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space
-{
-    if (!m_object)
-        return CGRectZero;
-    
-    CGSize size = CGSizeMake(rect.size().width(), rect.size().height());
-    CGPoint point = CGPointMake(rect.x(), rect.y());
-    
-    CGRect cgRect = CGRectMake(point.x, point.y, size.width, size.height);
-
-    // WebKit1 code path... platformWidget() exists.
-    FrameView* frameView = m_object->documentFrameView();
-#if PLATFORM(IOS_FAMILY)
-    WAKView* documentView = frameView ? frameView->documentView() : nullptr;
-    if (documentView) {
-        cgRect = [documentView convertRect:cgRect toView:nil];
-        
-        // we need the web document view to give us our final screen coordinates
-        // because that can take account of the scroller
-        id webDocument = [self _accessibilityWebDocumentView];
-        if (webDocument)
-            cgRect = [webDocument convertRect:cgRect toView:nil];
-    }
-#else
-    if (frameView && frameView->platformWidget()) {
-        NSRect nsRect = NSRectFromCGRect(cgRect);
-        NSView* view = frameView->documentView();
-        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-        nsRect = [[view window] convertRectToScreen:[view convertRect:nsRect toView:nil]];
-        ALLOW_DEPRECATED_DECLARATIONS_END
-        cgRect = NSRectToCGRect(nsRect);
-    }
-#endif
-    else {
-        // Find the appropriate scroll view to use to convert the contents to the window.
-        ScrollView* scrollView = nullptr;
-        const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) {
-            return is<AccessibilityScrollView>(object);
-        });
-        if (parent)
-            scrollView = downcast<AccessibilityScrollView>(*parent).scrollView();
-        
-        auto intRect = snappedIntRect(IntRect(cgRect));
-        if (scrollView)
-            intRect = scrollView->contentsToRootView(intRect);
-        
-        if (space == ScreenSpace) {
-            auto page = m_object->page();
-            
-            // If we have an empty chrome client (like SVG) then we should use the page
-            // of the scroll view parent to help us get to the screen rect.
-            if (parent && page && page->chrome().client().isEmptyChromeClient())
-                page = parent->page();
-            
-            if (page) {
-#if PLATFORM(IOS_FAMILY)
-                intRect = page->chrome().rootViewToAccessibilityScreen(intRect);
-#else
-                intRect = page->chrome().rootViewToScreen(intRect);
-#endif
-            }
-        }
-        
-        cgRect = (CGRect)intRect;
-    }
-    
-    return cgRect;
+    return CGPointZero;
 }
 
 - (NSString *)ariaLandmarkRoleDescription
index 370597f..cafd2b6 100644 (file)
@@ -412,10 +412,6 @@ using namespace HTMLNames;
 #define NSAccessibilityLinkRelationshipTypeAttribute @"AXLinkRelationshipType"
 #endif
 
-#ifndef NSAccessibilityRelativeFrameAttribute
-#define NSAccessibilityRelativeFrameAttribute @"AXRelativeFrame"
-#endif
-
 extern "C" AXUIElementRef NSAccessibilityCreateAXUIElementRef(id element);
 
 @implementation WebAccessibilityObjectWrapper
@@ -1324,7 +1320,6 @@ IGNORE_WARNINGS_END
             NSAccessibilityFocusableAncestorAttribute,
             NSAccessibilityEditableAncestorAttribute,
             NSAccessibilityHighestEditableAncestorAttribute,
-            NSAccessibilityRelativeFrameAttribute,
             nil];
     }
     if (commonMenuAttrs == nil) {
@@ -1751,6 +1746,50 @@ static NSMutableArray *convertStringsToNSArray(const Vector<String>& vector)
     return static_cast<PluginViewBase*>(pluginWidget)->accessibilityAssociatedPluginParentForElement(m_object->element());
 }
 
+- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
+{
+    FrameView* frameView = m_object->documentFrameView();
+    
+    // WebKit1 code path... platformWidget() exists.
+    if (frameView && frameView->platformWidget()) {
+        NSPoint nsPoint = (NSPoint)point;
+        NSView* view = frameView->documentView();
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
+        nsPoint = [[view window] convertBaseToScreen:[view convertPoint:nsPoint toView:nil]];
+        ALLOW_DEPRECATED_DECLARATIONS_END
+        return CGPointMake(nsPoint.x, nsPoint.y);
+    } else {
+        
+        // Find the appropriate scroll view to use to convert the contents to the window.
+        ScrollView* scrollView = nullptr;
+        AccessibilityObject* parent = nullptr;
+        for (parent = m_object->parentObject(); parent; parent = parent->parentObject()) {
+            if (is<AccessibilityScrollView>(*parent)) {
+                scrollView = downcast<AccessibilityScrollView>(*parent).scrollView();
+                break;
+            }
+        }
+        
+        IntPoint intPoint = flooredIntPoint(point);
+        if (scrollView)
+            intPoint = scrollView->contentsToRootView(intPoint);
+        
+        Page* page = m_object->page();
+        
+        // If we have an empty chrome client (like SVG) then we should use the page
+        // of the scroll view parent to help us get to the screen rect.
+        if (parent && page && page->chrome().client().isEmptyChromeClient())
+            page = parent->page();
+        
+        if (page) {
+            IntRect rect = IntRect(intPoint, IntSize(0, 0));            
+            intPoint = page->chrome().rootViewToScreen(rect).location();
+        }
+        
+        return intPoint;
+    }
+}
+
 static void WebTransformCGPathToNSBezierPath(void* info, const CGPathElement *element)
 {
     NSBezierPath *bezierPath = (__bridge NSBezierPath *)info;
@@ -1797,14 +1836,14 @@ static void WebTransformCGPathToNSBezierPath(void* info, const CGPathElement *el
 
 - (NSValue *)position
 {
-    auto rect = snappedIntRect(m_object->elementRect());
+    IntRect rect = snappedIntRect(m_object->elementRect());
     
     // The Cocoa accessibility API wants the lower-left corner.
-    auto floatPoint = FloatPoint(rect.x(), rect.maxY());
+    FloatPoint floatPoint = FloatPoint(rect.x(), rect.maxY());
 
-    auto floatRect = FloatRect(floatPoint, FloatSize());
-    CGPoint cgPoint = [self convertRectToSpace:floatRect space:ScreenSpace].origin;
-    return [NSValue valueWithPoint:NSPointFromCGPoint(cgPoint)];
+    CGPoint cgPoint = [self convertPointToScreenSpace:floatPoint];
+    
+    return [NSValue valueWithPoint:NSMakePoint(cgPoint.x, cgPoint.y)];
 }
 
 using AccessibilityRoleMap = HashMap<int, CFStringRef>;
@@ -3184,11 +3223,6 @@ IGNORE_WARNINGS_END
         return convertToNSArray(details);
     }
 
-    if ([attributeName isEqualToString:NSAccessibilityRelativeFrameAttribute]) {
-        auto rect = FloatRect(snappedIntRect(m_object->elementRect()));
-        return [NSValue valueWithRect:NSRectFromCGRect([self convertRectToSpace:rect space:PageSpace])];
-    }
-    
     if ([attributeName isEqualToString:@"AXErrorMessageElements"]) {
         AccessibilityObject::AccessibilityChildrenVector errorMessages;
         m_object->ariaErrorMessageElements(errorMessages);
index 5168a37..9898596 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r240209.
+
+        Broke GTK/WPE injected bundle
+
+        Reverted changeset:
+
+        "AX: Support returning relative frames for accessibility"
+        https://bugs.webkit.org/show_bug.cgi?id=193414
+        https://trac.webkit.org/changeset/240209
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index 5f754aa..265e6fe 100644 (file)
@@ -4041,21 +4041,6 @@ IGNORE_WARNINGS_END
     return _impl->accessibilityAttributeValue(attribute);
 }
 
-IGNORE_WARNINGS_BEGIN("deprecated-implementations")
-- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter
-IGNORE_WARNINGS_END
-{
-    return _impl->accessibilityAttributeValue(attribute, parameter);
-}
-
-IGNORE_WARNINGS_BEGIN("deprecated-implementations")
-- (NSArray<NSString *> *)accessibilityParameterizedAttributeNames
-IGNORE_WARNINGS_END
-{
-    NSArray<NSString *> *names = [super accessibilityParameterizedAttributeNames];
-    return [names arrayByAddingObject:@"AXConvertRelativeFrame"];
-}
-
 - (NSView *)hitTest:(NSPoint)point
 {
     if (!_impl)
index 6bde539..c7670b6 100644 (file)
@@ -809,21 +809,6 @@ IGNORE_WARNINGS_END
     return _data->_impl->accessibilityAttributeValue(attribute);
 }
 
-IGNORE_WARNINGS_BEGIN("deprecated-implementations")
-- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter
-IGNORE_WARNINGS_END
-{
-    return _data->_impl->accessibilityAttributeValue(attribute, parameter);
-}
-
-IGNORE_WARNINGS_BEGIN("deprecated-implementations")
-- (NSArray<NSString *> *)accessibilityParameterizedAttributeNames
-IGNORE_WARNINGS_END
-{
-    NSArray<NSString *> *names = [super accessibilityParameterizedAttributeNames];
-    return [names arrayByAddingObject:@"AXConvertRelativeFrame"];
-}
-
 - (NSView *)hitTest:(NSPoint)point
 {
     if (!_data)
index 6c8cecf..5b2138d 100644 (file)
@@ -409,7 +409,7 @@ public:
     bool accessibilityIsIgnored() const { return false; }
     id accessibilityHitTest(CGPoint);
     void enableAccessibilityIfNecessary();
-    id accessibilityAttributeValue(NSString *, id parameter = nil);
+    id accessibilityAttributeValue(NSString *);
 
     NSTrackingArea *primaryTrackingArea() const { return m_primaryTrackingArea.get(); }
     void setPrimaryTrackingArea(NSTrackingArea *);
index 064e0df..23a96d9 100644 (file)
@@ -3589,7 +3589,7 @@ void WebViewImpl::enableAccessibilityIfNecessary()
     updateWindowAndViewFrames();
 }
 
-id WebViewImpl::accessibilityAttributeValue(NSString *attribute, id parameter)
+id WebViewImpl::accessibilityAttributeValue(NSString *attribute)
 {
     enableAccessibilityIfNecessary();
 
@@ -3612,13 +3612,6 @@ id WebViewImpl::accessibilityAttributeValue(NSString *attribute, id parameter)
             if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
                 return @YES;
     
-    if ([attribute isEqualToString:@"AXConvertRelativeFrame"]) {
-        if ([parameter isKindOfClass:[NSValue class]]) {
-            NSRect rect = [(NSValue *)parameter rectValue];
-            return [NSValue valueWithRect:m_pageClient->rootViewToScreen(IntRect(rect))];
-        }
-    }
-    
     return [m_view _web_superAccessibilityAttributeValue:attribute];
 }
 
index ffc9764..dca2fb4 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r240209.
+
+        Broke GTK/WPE injected bundle
+
+        Reverted changeset:
+
+        "AX: Support returning relative frames for accessibility"
+        https://bugs.webkit.org/show_bug.cgi?id=193414
+        https://trac.webkit.org/changeset/240209
+
 2019-01-12  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Avoid importing directly from subumbrella frameworks
index fd60d40..b242a96 100644 (file)
@@ -162,9 +162,9 @@ static NSString* attributesOfElement(id accessibilityObject)
             continue;
         
         // Skip screen-specific information.
-        if ([attribute isEqualToString:@"_AXPrimaryScreenHeight"] || [attribute isEqualToString:@"AXRelativeFrame"])
+        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 45c31c0..f24dce8 100644 (file)
@@ -109,7 +109,6 @@ public:
 #endif
 
     // Attributes - platform-independent implementations
-    JSRetainPtr<JSStringRef> stringDescriptionOfAttributeValue(JSStringRef attribute);
     JSRetainPtr<JSStringRef> stringAttributeValue(JSStringRef attribute);
     double numberAttributeValue(JSStringRef attribute);
     JSValueRef uiElementArrayAttributeValue(JSStringRef attribute) const;
index 9be0b1c..7d5d69d 100644 (file)
@@ -58,7 +58,6 @@ interface AccessibilityUIElement {
     readonly attribute long insertionPointLineNumber;
     readonly attribute DOMString selectedTextRange;
 
-    DOMString stringDescriptionOfAttributeValue(DOMString attr);
     DOMString stringAttributeValue(DOMString attr);
     double numberAttributeValue(DOMString attr);
     object uiElementArrayAttributeValue(DOMString attr);
index 5913b5d..9f8108a 100644 (file)
@@ -348,11 +348,6 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
     return createEmptyJSString();
 }
 
-JSRetainPtr<JSStringRef> AccessibilityUIElement::stringDescriptionOfAttributeValue(JSStringRef attribute)
-{
-    return createEmptyJSString();
-}
-
 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
 {
     if (JSStringIsEqualToUTF8CString(attribute, "AXPlaceholderValue"))
index 02e83a6..669d6ee 100644 (file)
@@ -176,9 +176,9 @@ static NSString* attributesOfElement(id accessibilityObject)
             continue;
         
         // Skip screen-specific information.
-        if ([attribute isEqualToString:@"_AXPrimaryScreenHeight"] || [attribute isEqualToString:@"AXRelativeFrame"])
+        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
@@ -556,15 +556,6 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
     NSString* attributes = attributesOfElement(m_element);
     return [attributes createJSStringRef];
 }
-    
-JSRetainPtr<JSStringRef> AccessibilityUIElement::stringDescriptionOfAttributeValue(JSStringRef attribute)
-{
-    BEGIN_AX_OBJC_EXCEPTIONS
-    NSString *value = descriptionOfValue([m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]], m_element);
-    return [value createJSStringRef];
-    END_AX_OBJC_EXCEPTIONS
-    return nullptr;
-}
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
 {