Title: [138260] trunk
Revision
138260
Author
dmazz...@google.com
Date
2012-12-20 09:29:34 -0800 (Thu, 20 Dec 2012)

Log Message

AX: support clickPoint in DRT for chromium
https://bugs.webkit.org/show_bug.cgi?id=97359

Reviewed by Chris Fleizach.

Source/WebCore:

When computing the accessible bounding box of an
SVG root, be sure to call a method that uses transforms,
otherwise an assertion fails.

Newly unskipped tests: accessibility/svg-bounds.html and
accessibility/svg-remote-element.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundingBoxRect):

Source/WebKit/chromium:

Exposes the clickPoint accessibility method in WebAccessibilityObject.

* public/WebAccessibilityObject.h:
(WebAccessibilityObject):
* src/WebAccessibilityObject.cpp:
(WebKit::WebAccessibilityObject::clickPoint):
(WebKit):

Tools:

Implement clickPointX, clickPointY, and elementAtPoint for Chromium, so that
several more tests can pass.

* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
(WebTestRunner::AccessibilityUIElement::AccessibilityUIElement):
(WebTestRunner::AccessibilityUIElement::clickPointXGetterCallback):
(WebTestRunner):
(WebTestRunner::AccessibilityUIElement::clickPointYGetterCallback):
(WebTestRunner::AccessibilityUIElement::elementAtPointCallback):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
(AccessibilityUIElement):

LayoutTests:

Enable four more tests now that clickPointX, clickPointY,
and elementAtPoint are implemented for Chromium.

Minor fixes to two tests to make them more robust
across platfoms and when run in parallel.

* accessibility/svg-bounds.html: Updated
* accessibility/svg-bounds-expected.txt: Added (made cross-platform
* accessibility/svg-remote-element.html: Updated
* accessibility/svg-remote-element-expected.txt: Added (made cross-platform)
* platform/mac/accessibility/svg-bounds-expected.txt: Deleted
* platform/mac/accessibility/svg-remote-element-expected.txt: Deleted
* platform/chromium/TestExpectations: Updated

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (138259 => 138260)


--- trunk/LayoutTests/ChangeLog	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/ChangeLog	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,3 +1,24 @@
+2012-12-20  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: support clickPoint in DRT for chromium
+        https://bugs.webkit.org/show_bug.cgi?id=97359
+
+        Reviewed by Chris Fleizach.
+
+        Enable four more tests now that clickPointX, clickPointY,
+        and elementAtPoint are implemented for Chromium.
+
+        Minor fixes to two tests to make them more robust
+        across platfoms and when run in parallel.
+
+        * accessibility/svg-bounds.html: Updated
+        * accessibility/svg-bounds-expected.txt: Added (made cross-platform
+        * accessibility/svg-remote-element.html: Updated
+        * accessibility/svg-remote-element-expected.txt: Added (made cross-platform)
+        * platform/mac/accessibility/svg-bounds-expected.txt: Deleted
+        * platform/mac/accessibility/svg-remote-element-expected.txt: Deleted
+        * platform/chromium/TestExpectations: Updated
+
 2012-12-20  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [Qt]REGRESSION(r138222): It made fast/forms/number/number-spinbutton-click-in-iframe.html crash

Copied: trunk/LayoutTests/accessibility/svg-bounds-expected.txt (from rev 138259, trunk/LayoutTests/platform/chromium/accessibility/svg-bounds-expected.txt) (0 => 138260)


--- trunk/LayoutTests/accessibility/svg-bounds-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/svg-bounds-expected.txt	2012-12-20 17:29:34 UTC (rev 138260)
@@ -0,0 +1,44 @@
+Test
+This test ensures the accessibility bounds of embedded SVG objects are correct.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+container location: (607, 107)
+Face role: AXRole: AXButton
+Face label: AXDescription: face
+FaceX: 0
+FaceY: 0
+
+
+Eye role: AXRole: AXButton
+Eye label: AXDescription: left-eye
+EyeX: 103
+EyeY: 148
+
+
+Nose role: AXRole: AXButton
+Nose label: AXDescription: nose
+NoseX: 193
+NoseY: 206
+
+
+Mouth role: AXRole: AXButton
+Mouth label: AXDescription: smile
+MouthX: 115
+MouthY: 275
+
+
+Text role: AXRole: AXStaticText
+TextX/10: 15
+TextY/10: 11
+
+
+Image role: AXRole: AXImage
+Image label: AXDescription: Test Image
+ImageX: 21
+ImageY: 21
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/accessibility/svg-bounds.html (138259 => 138260)


--- trunk/LayoutTests/accessibility/svg-bounds.html	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/accessibility/svg-bounds.html	2012-12-20 17:29:34 UTC (rev 138260)
@@ -3,17 +3,17 @@
 <body>
 <script src=""
 
-<div id="container" style="position: relative; top: 1000px; left: 1000px; width:400px; height: 400px;" role="group" tabindex="0">
+<div id="container" style="position: relative; top: 100px; left: 600px; width:400px; height: 400px;" role="group" tabindex="0">
 
-<svg>
+<svg role="group" id="svgroot">
 
   <circle role="button" aria-label="face" id="face" r="200" cx="200" cy="200" stroke="red" stroke-width="1" fill="yellow" />
   <ellipse role="button" aria-label="left-eye" id="left-eye" cx="120" cy="180" rx="18" ry="33" fill="black"/>
   <ellipse role="button" aria-label="right-eye" id="right-eye" cx="280" cy="120" rx="18" ry="33" fill="black"/>
   <ellipse role="button" aria-label="nose" id="nose" cx="200" cy="220" rx="8" ry="15" fill="black"/>
   <path role="button" aria-label="smile" id="smile" stroke-width="10" stroke="black" fill="none" stroke-linecap="round" d="M120,280 Q200,330 290,280"/>
-  <text x="0" y="15" fill="red">Test</text>  
-  <image x="20" y="20" width="300" height="80" aria-label="Test Image" xlink:href="" />
+  <text x="150" y="130" fill="red">Test</text>  
+  <image x="20" y="20" width="300" height="80" aria-label="Test Image" xlink:href="" />
 
 </svg>
 </div>
@@ -37,7 +37,7 @@
 if (window.testRunner && window.accessibilityController) {
     window.testRunner.dumpAsText();
  
-    var container = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0);
+    var container = accessibilityController.accessibleElementById("svgroot");
 
     var x = pageX(container) - 1;
     var y = pageY(container) - 1;
@@ -69,13 +69,15 @@
     debug('Mouth role: ' + mouth.role);
     debug('Mouth label: ' + mouth.description);
     debug('MouthX: ' + (pageX(mouth) - x));
-    debug('MouthY: ' + Math.abs(pageY(mouth) - y));
+    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
     debug('<br>');
 
+    // Text varies by about 1 - 2 pixels depending on the platform,
+    // so just print the text coordinates divided by 10.
     var text = container.childAtIndex(5).childAtIndex(0);
     debug('Text role: ' + text.role);
-    debug('TextX: ' + (pageX(text) - x));
-    debug('TextY: ' + Math.abs(pageY(text) - y));
+    debug('TextX/10: ' + Math.floor((pageX(text) - x) / 10));
+    debug('TextY/10: ' + Math.floor(Math.abs(pageY(text) - y) / 10));
     debug('<br>');
 
     var image = container.childAtIndex(6);

Modified: trunk/LayoutTests/accessibility/svg-remote-element-expected.txt (138259 => 138260)


--- trunk/LayoutTests/accessibility/svg-remote-element-expected.txt	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/accessibility/svg-remote-element-expected.txt	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,15 +1,10 @@
 
-
-
 This test ensures that accessibility elements can be created out of what a remote SVG image defines.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS successfullyParsed is true
-
-TEST COMPLETE
-container location: (7, 43)
+container location: (7, 7)
 Face role: AXRole: AXButton
 Face label: AXDescription: face
 FaceX: 0
@@ -31,7 +26,10 @@
 Mouth role: AXRole: AXButton
 Mouth label: AXDescription: smile
 MouthX: 115
-MouthY: 274.5
+MouthY: 275
 
 
+PASS successfullyParsed is true
 
+TEST COMPLETE
+

Modified: trunk/LayoutTests/accessibility/svg-remote-element.html (138259 => 138260)


--- trunk/LayoutTests/accessibility/svg-remote-element.html	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/accessibility/svg-remote-element.html	2012-12-20 17:29:34 UTC (rev 138260)
@@ -3,14 +3,13 @@
 <body>
 <script src=""
 
-<br><br>
-
 <img tabindex="0" id="svg-image" src="" alt="interactive SVG" >
 
 <div id="console"></div>
 <script>
 
 description("This test ensures that accessibility elements can be created out of what a remote SVG image defines.")
+window.jsTestIsAsync = true;
 
 // Return the page's relative coordinates. If we rely on the x() or y() of the accessibility object, then
 // accessibility transforms are applied that fail because there is no window available
@@ -23,7 +22,6 @@
 }
 
 if (window.accessibilityController) {
-    window.testRunner.waitUntilDone();
     document.getElementById("svg-image").addEventListener("load", runAXTest);
 }
 
@@ -60,10 +58,10 @@
     debug('Mouth role: ' + mouth.role);
     debug('Mouth label: ' + mouth.description);
     debug('MouthX: ' + (pageX(mouth) - x));
-    debug('MouthY: ' + Math.abs(pageY(mouth) - y));
+    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
     debug('<br>');
 
-    window.testRunner.notifyDone();
+    finishJSTest();
 }
 
 </script>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (138259 => 138260)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1434,7 +1434,6 @@
 crbug.com/10322 accessibility/aria-invalid.html [ Skip ]
 crbug.com/10322 accessibility/aria-menubar-menuitems.html [ Skip ]
 crbug.com/10322 accessibility/aria-tables.html [ Skip ]
-crbug.com/10322 accessibility/aria-text-role.html [ Skip ]
 crbug.com/10322 accessibility/aria-used-on-image-maps.html [ Skip ]
 crbug.com/10322 accessibility/deleting-iframe-destroys-axcache.html [ Skip ]
 crbug.com/10322 accessibility/document-attributes.html [ Skip ]
@@ -1442,7 +1441,6 @@
 crbug.com/10322 accessibility/image-map-update-parent-crash.html [ Skip ]
 crbug.com/10322 accessibility/image-map2.html [ Skip ]
 crbug.com/10322 accessibility/internal-link-anchors2.html [ Skip ]
-crbug.com/10322 accessibility/label-for-control-hittest.html [ Skip ]
 crbug.com/10322 accessibility/language-attribute.html [ Skip ]
 crbug.com/10322 accessibility/lists.html [ Skip ]
 crbug.com/10322 accessibility/media-element.html [ Skip ]
@@ -1460,8 +1458,6 @@
 crbug.com/10322 accessibility/transformed-element.html [ Skip ]
 crbug.com/10322 accessibility/visible-elements.html [ Skip ]
 
-webkit.org/b/97359 accessibility/svg-bounds.html [ Skip ]
-webkit.org/b/97359 accessibility/svg-remote-element.html [ Skip ]
 webkit.org/b/96529 accessibility/hidden-legend.html [ Skip ]
 webkit.org/b/73912 accessibility/aria-checkbox-text.html [ Skip ]
 webkit.org/b/99665 accessibility/loading-iframe-sends-notification.html [ Skip ]

Deleted: trunk/LayoutTests/platform/chromium/accessibility/svg-bounds-expected.txt (138259 => 138260)


--- trunk/LayoutTests/platform/chromium/accessibility/svg-bounds-expected.txt	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/platform/chromium/accessibility/svg-bounds-expected.txt	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,44 +0,0 @@
-Test
-This test ensures the accessibility bounds of embedded SVG objects are correct.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-container location: (1007, 1007)
-Face role: AXRole: AXButton
-Face label: AXDescription: face
-FaceX: 0
-FaceY: 0
-
-
-Eye role: AXRole: AXButton
-Eye label: AXDescription: left-eye
-EyeX: 103
-EyeY: 148
-
-
-Nose role: AXRole: AXButton
-Nose label: AXDescription: nose
-NoseX: 193
-NoseY: 206
-
-
-Mouth role: AXRole: AXButton
-Mouth label: AXDescription: smile
-MouthX: 115
-MouthY: 274.5
-
-
-Text role: AXRole: AXStaticText
-TextX: 0.5
-TextY: 2
-
-
-Image role: AXRole: AXImage
-Image label: AXDescription: Test Image
-ImageX: 21
-ImageY: 21
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/platform/mac/accessibility/svg-bounds-expected.txt (138259 => 138260)


--- trunk/LayoutTests/platform/mac/accessibility/svg-bounds-expected.txt	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/platform/mac/accessibility/svg-bounds-expected.txt	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,44 +0,0 @@
-Test
-This test ensures the accessibility bounds of embedded SVG objects are correct.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-container location: (1007, 1007)
-Face role: AXRole: AXButton
-Face label: AXDescription: face
-FaceX: 0
-FaceY: 0
-
-
-Eye role: AXRole: AXButton
-Eye label: AXDescription: left-eye
-EyeX: 103
-EyeY: 148
-
-
-Nose role: AXRole: AXButton
-Nose label: AXDescription: nose
-NoseX: 193
-NoseY: 206
-
-
-Mouth role: AXRole: AXButton
-Mouth label: AXDescription: smile
-MouthX: 115
-MouthY: 275.5
-
-
-Text role: AXRole: AXStaticText
-TextX: 1.5
-TextY: 2
-
-
-Image role: AXRole: AXImage
-Image label: AXDescription: Test Image
-ImageX: 21
-ImageY: 21
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/platform/mac/accessibility/svg-remote-element-expected.txt (138259 => 138260)


--- trunk/LayoutTests/platform/mac/accessibility/svg-remote-element-expected.txt	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/LayoutTests/platform/mac/accessibility/svg-remote-element-expected.txt	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,37 +0,0 @@
-
-
-
-This test ensures that accessibility elements can be created out of what a remote SVG image defines.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-container location: (7, 43)
-Face role: AXRole: AXButton
-Face label: AXDescription: face
-FaceX: 0
-FaceY: 0
-
-
-Eye role: AXRole: AXButton
-Eye label: AXDescription: left-eye
-EyeX: 103
-EyeY: 148
-
-
-Nose role: AXRole: AXButton
-Nose label: AXDescription: nose
-NoseX: 193
-NoseY: 206
-
-
-Mouth role: AXRole: AXButton
-Mouth label: AXDescription: smile
-MouthX: 115
-MouthY: 275.5
-
-
-

Modified: trunk/Source/WebCore/ChangeLog (138259 => 138260)


--- trunk/Source/WebCore/ChangeLog	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Source/WebCore/ChangeLog	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,3 +1,20 @@
+2012-12-20  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: support clickPoint in DRT for chromium
+        https://bugs.webkit.org/show_bug.cgi?id=97359
+
+        Reviewed by Chris Fleizach.
+
+        When computing the accessible bounding box of an
+        SVG root, be sure to call a method that uses transforms,
+        otherwise an assertion fails.
+
+        Newly unskipped tests: accessibility/svg-bounds.html and
+        accessibility/svg-remote-element.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::boundingBoxRect):
+
 2012-12-20  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [Qt]REGRESSION(r138222): It made fast/forms/number/number-spinbutton-click-in-iframe.html crash

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (138259 => 138260)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-20 17:29:34 UTC (rev 138260)
@@ -783,10 +783,16 @@
     
     // absoluteFocusRingQuads will query the hierarchy below this element, which for large webpages can be very slow.
     // For a web area, which will have the most elements of any element, absoluteQuads should be used.
+    // We should also use absoluteQuads for SVG elements, otherwise transforms won't be applied.
     Vector<FloatQuad> quads;
+    bool isSVGRoot = false;
+#if ENABLE(SVG)
+    if (obj->isSVGRoot())
+        isSVGRoot = true;
+#endif
     if (obj->isText())
         toRenderText(obj)->absoluteQuads(quads, 0, RenderText::ClipToEllipsis);
-    else if (isWebArea() || isSeamlessWebArea())
+    else if (isWebArea() || isSeamlessWebArea() || isSVGRoot)
         obj->absoluteQuads(quads);
     else
         obj->absoluteFocusRingQuads(quads);

Modified: trunk/Source/WebKit/chromium/ChangeLog (138259 => 138260)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,3 +1,18 @@
+2012-12-20  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: support clickPoint in DRT for chromium
+        https://bugs.webkit.org/show_bug.cgi?id=97359
+
+        Reviewed by Chris Fleizach.
+
+        Exposes the clickPoint accessibility method in WebAccessibilityObject.
+
+        * public/WebAccessibilityObject.h:
+        (WebAccessibilityObject):
+        * src/WebAccessibilityObject.cpp:
+        (WebKit::WebAccessibilityObject::clickPoint):
+        (WebKit):
+
 2012-12-19  Pavel Feldman  <pfeld...@chromium.org>
 
         Web Inspector: introduce Page.captureScreenshot

Modified: trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h (138259 => 138260)


--- trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h	2012-12-20 17:29:34 UTC (rev 138260)
@@ -128,6 +128,7 @@
     WEBKIT_EXPORT WebString ariaLiveRegionStatus() const;
     WEBKIT_EXPORT WebRect boundingBoxRect() const;
     WEBKIT_EXPORT bool canvasHasFallbackContent() const;
+    WEBKIT_EXPORT WebPoint clickPoint() const;
     WEBKIT_EXPORT double estimatedLoadingProgress() const;
     WEBKIT_EXPORT WebString helpText() const;
     WEBKIT_EXPORT int headingLevel() const;

Modified: trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp (138259 => 138260)


--- trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp	2012-12-20 17:29:34 UTC (rev 138260)
@@ -490,6 +490,14 @@
     return m_private->canvasHasFallbackContent();
 }
 
+WebPoint WebAccessibilityObject::clickPoint() const
+{
+    if (isDetached())
+        return WebPoint();
+
+    return WebPoint(m_private->clickPoint());
+}
+
 double WebAccessibilityObject::estimatedLoadingProgress() const
 {
     if (isDetached())

Modified: trunk/Tools/ChangeLog (138259 => 138260)


--- trunk/Tools/ChangeLog	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Tools/ChangeLog	2012-12-20 17:29:34 UTC (rev 138260)
@@ -1,3 +1,22 @@
+2012-12-20  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: support clickPoint in DRT for chromium
+        https://bugs.webkit.org/show_bug.cgi?id=97359
+
+        Reviewed by Chris Fleizach.
+
+        Implement clickPointX, clickPointY, and elementAtPoint for Chromium, so that
+        several more tests can pass.
+
+        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
+        (WebTestRunner::AccessibilityUIElement::AccessibilityUIElement):
+        (WebTestRunner::AccessibilityUIElement::clickPointXGetterCallback):
+        (WebTestRunner):
+        (WebTestRunner::AccessibilityUIElement::clickPointYGetterCallback):
+        (WebTestRunner::AccessibilityUIElement::elementAtPointCallback):
+        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
+        (AccessibilityUIElement):
+
 2012-12-20  Dan Bernstein  <m...@apple.com>
 
         prepare-ChangeLog adds "Additional information of the change such as approach, rationale" where it doesn't make sense

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp (138259 => 138260)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp	2012-12-20 17:29:34 UTC (rev 138260)
@@ -397,6 +397,8 @@
     bindProperty("isValid", &AccessibilityUIElement::isValidGetterCallback);
     bindProperty("isReadOnly", &AccessibilityUIElement::isReadOnlyGetterCallback);
     bindProperty("orientation", &AccessibilityUIElement::orientationGetterCallback);
+    bindProperty("clickPointX", &AccessibilityUIElement::clickPointXGetterCallback);
+    bindProperty("clickPointY", &AccessibilityUIElement::clickPointYGetterCallback);
 
     //
     // Methods
@@ -648,6 +650,16 @@
     result->set(getOrientation(accessibilityObject()));
 }
 
+void AccessibilityUIElement::clickPointXGetterCallback(CppVariant* result)
+{
+    result->set(accessibilityObject().clickPoint().x);
+}
+
+void AccessibilityUIElement::clickPointYGetterCallback(CppVariant* result)
+{
+    result->set(accessibilityObject().clickPoint().y);
+}
+
 //
 // Methods
 //
@@ -725,9 +737,21 @@
     result->set(*(child->getAsCppVariant()));
 }
 
-void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList&, CppVariant* result)
+void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
+
+    if (arguments.size() != 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+        return;
+
+    int x = arguments[0].toInt32();
+    int y = arguments[1].toInt32();
+    WebPoint point(x, y);
+    WebAccessibilityObject obj = accessibilityObject().hitTest(point);
+    if (obj.isNull())
+        return;
+
+    result->set(*(m_factory->getOrCreate(obj)->getAsCppVariant()));
 }
 
 void AccessibilityUIElement::attributesOfColumnHeadersCallback(const CppArgumentList&, CppVariant* result)

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h (138259 => 138260)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h	2012-12-20 17:26:37 UTC (rev 138259)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h	2012-12-20 17:29:34 UTC (rev 138260)
@@ -94,6 +94,8 @@
     void isValidGetterCallback(CppVariant*);
     void isReadOnlyGetterCallback(CppVariant*);
     void orientationGetterCallback(CppVariant*);
+    void clickPointXGetterCallback(CppVariant*);
+    void clickPointYGetterCallback(CppVariant*);
 
     // Bound methods.
     void allAttributesCallback(const CppArgumentList&, CppVariant*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to