Commit 81f8cd51 authored by cfleizach@apple.com's avatar cfleizach@apple.com

AX: The bounding paths should be made available through accessibility

https://bugs.webkit.org/show_bug.cgi?id=113817

Reviewed by David Kilzer.

Source/WebCore: 

This allows bounding paths to be returned for some web elements (image map areas and SVG shapes).
This provides more accuracy when assistive technologies highlight elements.
The Mac and iOS platforms share some code to help transform paths to their screen coordinates.

Tests: platform/iphone-simulator/accessibility/element-paths.html
       platform/mac/accessibility/element-paths.html

* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
(WebCore):
(WebCore::AccessibilityImageMapLink::elementPath):
(WebCore::AccessibilityImageMapLink::elementRect):
* accessibility/AccessibilityImageMapLink.h:
(AccessibilityImageMapLink):
(WebCore::AccessibilityImageMapLink::supportsPath):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::elementPath):
(WebCore::AccessibilityObject::supportsPath):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::supportsPath):
(WebCore::AccessibilityRenderObject::elementPath):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityPath]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
(WebCore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(PathConversionInfo):
(ConvertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(WebTransformCGPathToNSBezierPath):
(-[WebAccessibilityObjectWrapper bezierPathFromPath:]):
(-[WebAccessibilityObjectWrapper path]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools: 

Add a pathDescription property for testing so that it's possible
to verify that a path is being returned correctly.

* DumpRenderTree/AccessibilityUIElement.cpp:
(getPathDescriptionCallback):
(AccessibilityUIElement::pathDescription):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(_CGPathEnumerationIteration):
(AccessibilityUIElement::pathDescription):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::pathDescription):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::pathDescription):
(WTR):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(AccessibilityUIElement):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::pathDescription):
(WTR):

LayoutTests: 

Add new tests for Mac and iOS to verify that path output works.
Modify existing tests to indicate that there is a new AXAttribute, AXPath.

* platform/iphone-simulator/accessibility/element-paths-expected.txt: Added.
* platform/iphone-simulator/accessibility/element-paths.html: Added.
* platform/mac/accessibility/document-links-expected.txt:
* platform/mac/accessibility/element-paths-expected.txt: Added.
* platform/mac/accessibility/element-paths.html: Added.
* platform/mac/accessibility/image-map2-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9f50c06e
2013-04-09 Chris Fleizach <cfleizach@apple.com>
AX: The bounding paths should be made available through accessibility
https://bugs.webkit.org/show_bug.cgi?id=113817
Reviewed by David Kilzer.
Add new tests for Mac and iOS to verify that path output works.
Modify existing tests to indicate that there is a new AXAttribute, AXPath.
* platform/iphone-simulator/accessibility/element-paths-expected.txt: Added.
* platform/iphone-simulator/accessibility/element-paths.html: Added.
* platform/mac/accessibility/document-links-expected.txt:
* platform/mac/accessibility/element-paths-expected.txt: Added.
* platform/mac/accessibility/element-paths.html: Added.
* platform/mac/accessibility/image-map2-expected.txt:
2013-04-09 Arnaud Renevier <a.renevier@sisa.samsung.com>
Whitespace in particular source code changes rendering; does not in Firefox
This tests SVG group elements are accessible and that the svg:title element is returned properly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
SVG path description
Start Path
Move to point
Line to
Line to
Close
Map1 path description
Start Path
Move to point
Line to
Line to
Line to
Line to
Close
Map2 path description
Start Path
Move to point
Curve to
Curve to
Curve to
Curve to
Close
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path role="button" id="svg" d="M150 0 L75 200 L225 200 Z" />
</svg>
<map name="imagemap1">
<AREA id="map1" shape="polygon" coords="90,25,162,26,163,96,89,25,90,24" href="triangle.html">
<AREA id="map2" shape="circle" coords="130,304,110" href="circle.html">
</map>
<img src="resources/cake.png" border="0" align="left" usemap="#imagemap1" vspace="1">
<div id="console"></div>
<script>
description("This tests SVG group elements are accessible and that the svg:title element is returned properly.");
if (window.accessibilityController) {
var svg = accessibilityController.accessibleElementById("svg");
debug("SVG path description" + svg.pathDescription);
var map1 = accessibilityController.accessibleElementById("map1");
debug("Map1 path description" + map1.pathDescription);
var map2 = accessibilityController.accessibleElementById("map2");
debug("Map2 path description" + map2.pathDescription);
}
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -24,6 +24,7 @@ AXTopLevelUIElement: <AXLink: 'Link1'>
AXURL: http://www.apple.com/
AXAccessKey: (null)
AXARIABusy: 0
AXPath: <AXLink: 'Link1'>
------------
AXRole: AXLink
......@@ -50,6 +51,7 @@ AXTopLevelUIElement: <AXLink: 'Link2'>
AXURL: http://www.apple.com/
AXAccessKey: (null)
AXARIABusy: 0
AXPath: <AXLink: 'Link2'>
------------
AXRole: AXLink
......
This tests SVG group elements are accessible and that the svg:title element is returned properly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS svg.isAttributeSupported('AXPath') is true
SVG path description
Start Path
Move to point
Line to
Line to
Close
Move to point
PASS map1.isAttributeSupported('AXPath') is true
Map1 path description
Start Path
Move to point
Line to
Line to
Line to
Line to
Close
Move to point
PASS map2.isAttributeSupported('AXPath') is true
Map2 path description
Start Path
Move to point
Curve to
Curve to
Curve to
Curve to
Close
Move to point
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path role="button" id="svg" d="M150 0 L75 200 L225 200 Z" />
</svg>
<map name="imagemap1">
<AREA id="map1" shape="polygon" coords="90,25,162,26,163,96,89,25,90,24" href="triangle.html">
<AREA id="map2" shape="circle" coords="130,304,110" href="circle.html">
</map>
<img src="resources/cake.png" border="1" align="left" usemap="#imagemap1" vspace="1">
<div id="console"></div>
<script>
description("This tests SVG group elements are accessible and that the svg:title element is returned properly.");
if (window.accessibilityController) {
var svg = accessibilityController.accessibleElementById("svg");
shouldBeTrue("svg.isAttributeSupported('AXPath')");
debug("SVG path description" + svg.pathDescription);
var map1 = accessibilityController.accessibleElementById("map1");
shouldBeTrue("map1.isAttributeSupported('AXPath')");
debug("Map1 path description" + map1.pathDescription);
var map2 = accessibilityController.accessibleElementById("map2");
shouldBeTrue("map2.isAttributeSupported('AXPath')");
debug("Map2 path description" + map2.pathDescription);
}
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -48,6 +48,7 @@ AXTopLevelUIElement: <AXLink>
AXURL: http://www.apple.com/
AXAccessKey: (null)
AXARIABusy: 0
AXPath: <AXLink>
------------
AXRole: AXLink
......@@ -74,6 +75,7 @@ AXTopLevelUIElement: <AXLink>
AXURL: http://www.apple.com/
AXAccessKey: (null)
AXARIABusy: 0
AXPath: <AXLink>
------------
......
2013-04-09 Chris Fleizach <cfleizach@apple.com>
AX: The bounding paths should be made available through accessibility
https://bugs.webkit.org/show_bug.cgi?id=113817
Reviewed by David Kilzer.
This allows bounding paths to be returned for some web elements (image map areas and SVG shapes).
This provides more accuracy when assistive technologies highlight elements.
The Mac and iOS platforms share some code to help transform paths to their screen coordinates.
Tests: platform/iphone-simulator/accessibility/element-paths.html
platform/mac/accessibility/element-paths.html
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
(WebCore):
(WebCore::AccessibilityImageMapLink::elementPath):
(WebCore::AccessibilityImageMapLink::elementRect):
* accessibility/AccessibilityImageMapLink.h:
(AccessibilityImageMapLink):
(WebCore::AccessibilityImageMapLink::supportsPath):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::elementPath):
(WebCore::AccessibilityObject::supportsPath):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::supportsPath):
(WebCore::AccessibilityRenderObject::elementPath):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityPath]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
(WebCore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(PathConversionInfo):
(ConvertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(WebTransformCGPathToNSBezierPath):
(-[WebAccessibilityObjectWrapper bezierPathFromPath:]):
(-[WebAccessibilityObjectWrapper path]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2013-04-09 Benjamin Poulain <bpoulain@apple.com>
Remove the WebKit copy of GLU and the file using it
......@@ -134,17 +134,32 @@ String AccessibilityImageMapLink::title() const
return String();
}
LayoutRect AccessibilityImageMapLink::elementRect() const
RenderObject* AccessibilityImageMapLink::imageMapLinkRenderer() const
{
if (!m_mapElement.get() || !m_areaElement.get())
return LayoutRect();
return 0;
RenderObject* renderer;
RenderObject* renderer = 0;
if (m_parent && m_parent->isAccessibilityRenderObject())
renderer = static_cast<AccessibilityRenderObject*>(m_parent)->renderer();
else
renderer = m_mapElement->renderer();
return renderer;
}
Path AccessibilityImageMapLink::elementPath() const
{
RenderObject* renderer = imageMapLinkRenderer();
if (!renderer)
return Path();
return m_areaElement->computePath(renderer);
}
LayoutRect AccessibilityImageMapLink::elementRect() const
{
RenderObject* renderer = imageMapLinkRenderer();
if (!renderer)
return LayoutRect();
......
......@@ -72,8 +72,11 @@ private:
RefPtr<HTMLAreaElement> m_areaElement;
RefPtr<HTMLMapElement> m_mapElement;
virtual Path elementPath() const;
RenderObject* imageMapLinkRenderer() const;
virtual void accessibilityText(Vector<AccessibilityText>&);
virtual bool isImageMapLink() const { return true; }
virtual bool supportsPath() const { return true; }
};
} // namespace WebCore
......
......@@ -32,6 +32,7 @@
#include "FloatQuad.h"
#include "LayoutRect.h"
#include "Path.h"
#include "TextIterator.h"
#include "VisiblePosition.h"
#include "VisibleSelection.h"
......@@ -605,6 +606,8 @@ public:
IntSize pixelSnappedSize() const { return elementRect().pixelSnappedSize(); }
virtual IntPoint clickPoint();
static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&);
virtual Path elementPath() const { return Path(); }
virtual bool supportsPath() const { return false; }
TextIteratorBehavior textIteratorBehaviorForTextRange() const;
virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); }
......@@ -671,7 +674,7 @@ public:
bool isDescendantOfObject(const AccessibilityObject*) const;
bool isAncestorOfObject(const AccessibilityObject*) const;
AccessibilityObject* firstAnonymousBlockChild() const;
static AccessibilityRole ariaRoleToWebCoreRole(const String&);
bool hasAttribute(const QualifiedName&) const;
const AtomicString& getAttribute(const QualifiedName&) const;
......
......@@ -836,6 +836,26 @@ LayoutRect AccessibilityRenderObject::elementRect() const
return boundingBoxRect();
}
bool AccessibilityRenderObject::supportsPath() const
{
#if ENABLE(SVG)
if (m_renderer && m_renderer->isSVGShape())
return true;
#endif
return false;
}
Path AccessibilityRenderObject::elementPath() const
{
#if ENABLE(SVG)
if (m_renderer && m_renderer->isSVGShape())
return toRenderSVGShape(m_renderer)->path();
#endif
return Path();
}
IntPoint AccessibilityRenderObject::clickPoint()
{
......
......@@ -235,7 +235,8 @@ private:
Element* rootEditableElementForPosition(const Position&) const;
bool nodeIsTextControl(const Node*) const;
virtual void setNeedsToUpdateChildren() { m_childrenDirty = true; }
virtual Path elementPath() const;
bool isTabItemSelected() const;
LayoutRect checkboxOrRadioRect() const;
void addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const;
......@@ -253,7 +254,8 @@ private:
AccessibilitySVGRoot* remoteSVGRootElement() const;
AccessibilityObject* remoteSVGElementHitTest(const IntPoint&) const;
void offsetBoundingBoxForRemoteSVGElement(LayoutRect&) const;
virtual bool supportsPath() const;
void addHiddenChildren();
void addTextFieldChildren();
void addImageMapChildren();
......@@ -275,7 +277,7 @@ private:
virtual const AtomicString& ariaLiveRegionRelevant() const;
virtual bool ariaLiveRegionAtomic() const;
virtual bool ariaLiveRegionBusy() const;
bool inheritsPresentationalRole() const;
#if ENABLE(MATHML)
......
......@@ -368,6 +368,22 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
return NSNotFound;
}
- (CGPathRef)_accessibilityPath
{
if (![self _prepareAccessibilityCall])
return NULL;
if (!m_object->supportsPath())
return NULL;
Path path = m_object->elementPath();
if (path.isEmpty())
return NULL;
Path transformedPath = [self convertPathToScreenSpace:path];
return transformedPath.platformPath();
}
- (NSString *)accessibilityLanguage
{
if (![self _prepareAccessibilityCall])
......@@ -937,7 +953,29 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
return (NSURL*)url;
}
- (CGRect)_convertIntRectToScreenCoordinates:(IntRect)rect
- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
{
if (!m_object)
return CGPointZero;
CGPoint cgPoint = CGPointMake(point.x(), point.y());
FrameView* frameView = m_object->documentFrameView();
if (frameView) {
WAKView* view = frameView->documentView();
cgPoint = [view 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];
return cgPoint;
}
- (CGRect)convertRectToScreenSpace:(IntRect &)rect
{
if (!m_object)
return CGRectZero;
......@@ -980,7 +1018,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
return CGPointZero;
IntRect rect = pixelSnappedIntRect(m_object->boundingBoxRect());
CGRect cgRect = [self _convertIntRectToScreenCoordinates:rect];
CGRect cgRect = [self convertRectToScreenSpace:rect];
return CGPointMake(CGRectGetMidX(cgRect), CGRectGetMidY(cgRect));
}
......@@ -990,7 +1028,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
return CGRectZero;
IntRect rect = pixelSnappedIntRect(m_object->elementRect());
return [self _convertIntRectToScreenCoordinates:rect];
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).
......@@ -1879,7 +1917,7 @@ static void AXAttributedStringAppendText(NSMutableAttributedString* attrString,
return CGRectZero;
IntRect rect = m_object->boundsForVisiblePositionRange(VisiblePositionRange([startMarker visiblePosition], [endMarker visiblePosition]));
return [self _convertIntRectToScreenCoordinates:rect];
return [self convertRectToScreenSpace:rect];
}
- (WebAccessibilityTextMarker *)textMarkerForPoint:(CGPoint)point
......
......@@ -31,6 +31,9 @@
namespace WebCore {
class AccessibilityObject;
class IntRect;
class FloatPoint;
class Path;
class VisiblePosition;
}
......@@ -51,6 +54,9 @@ class VisiblePosition;
// Used to inform an element when a notification is posted for it. Used by DRT.
- (void)accessibilityPostedNotification:(NSString *)notificationName;
- (CGPathRef)convertPathToScreenSpace:(WebCore::Path &)path;
- (CGPoint)convertPointToScreenSpace:(WebCore::FloatPoint &)point;
@end
#endif // WebAccessibilityObjectWrapperBase_h
......@@ -232,6 +232,66 @@ using namespace std;
return [NSString string];
}
struct PathConversionInfo {
WebAccessibilityObjectWrapperBase *wrapper;
CGMutablePathRef path;
};
static void ConvertPathToScreenSpaceFunction(void* info, const PathElement* element)
{
PathConversionInfo* conversion = (PathConversionInfo*)info;
WebAccessibilityObjectWrapperBase *wrapper = conversion->wrapper;
CGMutablePathRef newPath = conversion->path;
switch (element->type) {
case PathElementMoveToPoint:
{
CGPoint newPoint = [wrapper convertPointToScreenSpace:element->points[0]];
CGPathMoveToPoint(newPath, nil, newPoint.x, newPoint.y);
break;
}
case PathElementAddLineToPoint:
{
CGPoint newPoint = [wrapper convertPointToScreenSpace:element->points[0]];
CGPathAddLineToPoint(newPath, nil, newPoint.x, newPoint.y);
break;
}
case PathElementAddQuadCurveToPoint:
{
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:
{
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;
}
case PathElementCloseSubpath:
{
CGPathCloseSubpath(newPath);
break;
}
}
}
- (CGPathRef)convertPathToScreenSpace:(Path &)path
{
PathConversionInfo conversion = { self, CGPathCreateMutable() };
path.apply(&conversion, ConvertPathToScreenSpaceFunction);
return (CGPathRef)[(id)conversion.path autorelease];
}
- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
{
UNUSED_PARAM(point);
ASSERT_NOT_REACHED();
return CGPointZero;
}
// This is set by DRT when it wants to listen for notifications.
static BOOL accessibilityShouldRepostNotifications;
+ (void)accessibilitySetShouldRepostNotifications:(BOOL)repost
......
......@@ -350,6 +350,10 @@ using namespace std;
#define NSAccessibilityScrollToVisibleAction @"AXScrollToVisible"
#endif
#ifndef NSAccessibilityPathAttribute
#define NSAccessibilityPathAttribute @"AXPath"
#endif
// Math attributes
#define NSAccessibilityMathRootRadicandAttribute @"AXMathRootRadicand"
#define NSAccessibilityMathRootIndexAttribute @"AXMathRootIndex"
......@@ -1035,6 +1039,9 @@ static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosit
[additional addObject:NSAccessibilityMathFencedCloseAttribute];
}
if (m_object->supportsPath())
[additional addObject:NSAccessibilityPathAttribute];
return additional;
}
......@@ -1478,23 +1485,18 @@ static NSMutableArray* convertToNSArray(const AccessibilityObject::Accessibility
return [self textMarkerRangeFromVisiblePositions:selection.visibleStart() endPosition:selection.visibleEnd()];
}
- (NSValue *)position
- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point
{
IntRect rect = pixelSnappedIntRect(m_object->elementRect());
NSPoint point;
FrameView* frameView = m_object->documentFrameView();
// WebKit1 code path... platformWidget() exists.
if (frameView && frameView->platformWidget()) {
// The Cocoa accessibility API wants the lower-left corner.
point = NSMakePoint(rect.x(), rect.maxY());