Changeset 138260 in webkit


Ignore:
Timestamp:
Dec 20, 2012, 9:29:34 AM (13 years ago)
Author:
dmazzoni@google.com
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
Location:
trunk
Files:
2 deleted
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138258 r138260  
     12012-12-20  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        AX: support clickPoint in DRT for chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=97359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Enable four more tests now that clickPointX, clickPointY,
     9        and elementAtPoint are implemented for Chromium.
     10
     11        Minor fixes to two tests to make them more robust
     12        across platfoms and when run in parallel.
     13
     14        * accessibility/svg-bounds.html: Updated
     15        * accessibility/svg-bounds-expected.txt: Added (made cross-platform
     16        * accessibility/svg-remote-element.html: Updated
     17        * accessibility/svg-remote-element-expected.txt: Added (made cross-platform)
     18        * platform/mac/accessibility/svg-bounds-expected.txt: Deleted
     19        * platform/mac/accessibility/svg-remote-element-expected.txt: Deleted
     20        * platform/chromium/TestExpectations: Updated
     21
    1222012-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    223
  • trunk/LayoutTests/accessibility/svg-bounds-expected.txt

    r138259 r138260  
    55
    66
    7 container location: (1007, 1007)
     7container location: (607, 107)
    88Face role: AXRole: AXButton
    99Face label: AXDescription: face
     
    2727Mouth label: AXDescription: smile
    2828MouthX: 115
    29 MouthY: 274.5
     29MouthY: 275
    3030
    3131
    3232Text role: AXRole: AXStaticText
    33 TextX: 0.5
    34 TextY: 2
     33TextX/10: 15
     34TextY/10: 11
    3535
    3636
  • trunk/LayoutTests/accessibility/svg-bounds.html

    r138121 r138260  
    44<script src="../fast/js/resources/js-test-pre.js"></script>
    55
    6 <div id="container" style="position: relative; top: 1000px; left: 1000px; width:400px; height: 400px;" role="group" tabindex="0">
     6<div id="container" style="position: relative; top: 100px; left: 600px; width:400px; height: 400px;" role="group" tabindex="0">
    77
    8 <svg>
     8<svg role="group" id="svgroot">
    99
    1010  <circle role="button" aria-label="face" id="face" r="200" cx="200" cy="200" stroke="red" stroke-width="1" fill="yellow" />
     
    1313  <ellipse role="button" aria-label="nose" id="nose" cx="200" cy="220" rx="8" ry="15" fill="black"/>
    1414  <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"/>
    15   <text x="0" y="15" fill="red">Test</text> 
    16   <image x="20" y="20" width="300" height="80" aria-label="Test Image" xlink:href="resources/cake.ong" />
     15  <text x="150" y="130" fill="red">Test</text> 
     16  <image x="20" y="20" width="300" height="80" aria-label="Test Image" xlink:href="resources/cake.png" />
    1717
    1818</svg>
     
    3838    window.testRunner.dumpAsText();
    3939 
    40     var container = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0);
     40    var container = accessibilityController.accessibleElementById("svgroot");
    4141
    4242    var x = pageX(container) - 1;
     
    7070    debug('Mouth label: ' + mouth.description);
    7171    debug('MouthX: ' + (pageX(mouth) - x));
    72     debug('MouthY: ' + Math.abs(pageY(mouth) - y));
     72    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
    7373    debug('<br>');
    7474
     75    // Text varies by about 1 - 2 pixels depending on the platform,
     76    // so just print the text coordinates divided by 10.
    7577    var text = container.childAtIndex(5).childAtIndex(0);
    7678    debug('Text role: ' + text.role);
    77     debug('TextX: ' + (pageX(text) - x));
    78     debug('TextY: ' + Math.abs(pageY(text) - y));
     79    debug('TextX/10: ' + Math.floor((pageX(text) - x) / 10));
     80    debug('TextY/10: ' + Math.floor(Math.abs(pageY(text) - y) / 10));
    7981    debug('<br>');
    8082
  • trunk/LayoutTests/accessibility/svg-remote-element-expected.txt

    r138121 r138260  
    1 
    2 
    31
    42This test ensures that accessibility elements can be created out of what a remote SVG image defines.
     
    75
    86
    9 PASS successfullyParsed is true
    10 
    11 TEST COMPLETE
    12 container location: (7, 43)
     7container location: (7, 7)
    138Face role: AXRole: AXButton
    149Face label: AXDescription: face
     
    3227Mouth label: AXDescription: smile
    3328MouthX: 115
    34 MouthY: 274.5
     29MouthY: 275
    3530
    3631
     32PASS successfullyParsed is true
    3733
     34TEST COMPLETE
     35
  • trunk/LayoutTests/accessibility/svg-remote-element.html

    r138121 r138260  
    33<body>
    44<script src="../fast/js/resources/js-test-pre.js"></script>
    5 
    6 <br><br>
    75
    86<img tabindex="0" id="svg-image" src="resources/svg-face.svg" alt="interactive SVG" >
     
    1210
    1311description("This test ensures that accessibility elements can be created out of what a remote SVG image defines.")
     12window.jsTestIsAsync = true;
    1413
    1514// Return the page's relative coordinates. If we rely on the x() or y() of the accessibility object, then
     
    2423
    2524if (window.accessibilityController) {
    26     window.testRunner.waitUntilDone();
    2725    document.getElementById("svg-image").addEventListener("load", runAXTest);
    2826}
     
    6159    debug('Mouth label: ' + mouth.description);
    6260    debug('MouthX: ' + (pageX(mouth) - x));
    63     debug('MouthY: ' + Math.abs(pageY(mouth) - y));
     61    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
    6462    debug('<br>');
    6563
    66     window.testRunner.notifyDone();
     64    finishJSTest();
    6765}
    6866
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r138250 r138260  
    14351435crbug.com/10322 accessibility/aria-menubar-menuitems.html [ Skip ]
    14361436crbug.com/10322 accessibility/aria-tables.html [ Skip ]
    1437 crbug.com/10322 accessibility/aria-text-role.html [ Skip ]
    14381437crbug.com/10322 accessibility/aria-used-on-image-maps.html [ Skip ]
    14391438crbug.com/10322 accessibility/deleting-iframe-destroys-axcache.html [ Skip ]
     
    14431442crbug.com/10322 accessibility/image-map2.html [ Skip ]
    14441443crbug.com/10322 accessibility/internal-link-anchors2.html [ Skip ]
    1445 crbug.com/10322 accessibility/label-for-control-hittest.html [ Skip ]
    14461444crbug.com/10322 accessibility/language-attribute.html [ Skip ]
    14471445crbug.com/10322 accessibility/lists.html [ Skip ]
     
    14611459crbug.com/10322 accessibility/visible-elements.html [ Skip ]
    14621460
    1463 webkit.org/b/97359 accessibility/svg-bounds.html [ Skip ]
    1464 webkit.org/b/97359 accessibility/svg-remote-element.html [ Skip ]
    14651461webkit.org/b/96529 accessibility/hidden-legend.html [ Skip ]
    14661462webkit.org/b/73912 accessibility/aria-checkbox-text.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r138258 r138260  
     12012-12-20  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        AX: support clickPoint in DRT for chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=97359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        When computing the accessible bounding box of an
     9        SVG root, be sure to call a method that uses transforms,
     10        otherwise an assertion fails.
     11
     12        Newly unskipped tests: accessibility/svg-bounds.html and
     13        accessibility/svg-remote-element.html
     14
     15        * accessibility/AccessibilityRenderObject.cpp:
     16        (WebCore::AccessibilityRenderObject::boundingBoxRect):
     17
    1182012-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r137962 r138260  
    784784    // absoluteFocusRingQuads will query the hierarchy below this element, which for large webpages can be very slow.
    785785    // For a web area, which will have the most elements of any element, absoluteQuads should be used.
     786    // We should also use absoluteQuads for SVG elements, otherwise transforms won't be applied.
    786787    Vector<FloatQuad> quads;
     788    bool isSVGRoot = false;
     789#if ENABLE(SVG)
     790    if (obj->isSVGRoot())
     791        isSVGRoot = true;
     792#endif
    787793    if (obj->isText())
    788794        toRenderText(obj)->absoluteQuads(quads, 0, RenderText::ClipToEllipsis);
    789     else if (isWebArea() || isSeamlessWebArea())
     795    else if (isWebArea() || isSeamlessWebArea() || isSVGRoot)
    790796        obj->absoluteQuads(quads);
    791797    else
  • trunk/Source/WebKit/chromium/ChangeLog

    r138236 r138260  
     12012-12-20  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        AX: support clickPoint in DRT for chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=97359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Exposes the clickPoint accessibility method in WebAccessibilityObject.
     9
     10        * public/WebAccessibilityObject.h:
     11        (WebAccessibilityObject):
     12        * src/WebAccessibilityObject.cpp:
     13        (WebKit::WebAccessibilityObject::clickPoint):
     14        (WebKit):
     15
    1162012-12-19  Pavel Feldman  <pfeldman@chromium.org>
    217
  • trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h

    r138121 r138260  
    129129    WEBKIT_EXPORT WebRect boundingBoxRect() const;
    130130    WEBKIT_EXPORT bool canvasHasFallbackContent() const;
     131    WEBKIT_EXPORT WebPoint clickPoint() const;
    131132    WEBKIT_EXPORT double estimatedLoadingProgress() const;
    132133    WEBKIT_EXPORT WebString helpText() const;
  • trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp

    r138175 r138260  
    491491}
    492492
     493WebPoint WebAccessibilityObject::clickPoint() const
     494{
     495    if (isDetached())
     496        return WebPoint();
     497
     498    return WebPoint(m_private->clickPoint());
     499}
     500
    493501double WebAccessibilityObject::estimatedLoadingProgress() const
    494502{
  • trunk/Tools/ChangeLog

    r138259 r138260  
     12012-12-20  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        AX: support clickPoint in DRT for chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=97359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Implement clickPointX, clickPointY, and elementAtPoint for Chromium, so that
     9        several more tests can pass.
     10
     11        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
     12        (WebTestRunner::AccessibilityUIElement::AccessibilityUIElement):
     13        (WebTestRunner::AccessibilityUIElement::clickPointXGetterCallback):
     14        (WebTestRunner):
     15        (WebTestRunner::AccessibilityUIElement::clickPointYGetterCallback):
     16        (WebTestRunner::AccessibilityUIElement::elementAtPointCallback):
     17        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
     18        (AccessibilityUIElement):
     19
    1202012-12-20  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp

    r138121 r138260  
    398398    bindProperty("isReadOnly", &AccessibilityUIElement::isReadOnlyGetterCallback);
    399399    bindProperty("orientation", &AccessibilityUIElement::orientationGetterCallback);
     400    bindProperty("clickPointX", &AccessibilityUIElement::clickPointXGetterCallback);
     401    bindProperty("clickPointY", &AccessibilityUIElement::clickPointYGetterCallback);
    400402
    401403    //
     
    649651}
    650652
     653void AccessibilityUIElement::clickPointXGetterCallback(CppVariant* result)
     654{
     655    result->set(accessibilityObject().clickPoint().x);
     656}
     657
     658void AccessibilityUIElement::clickPointYGetterCallback(CppVariant* result)
     659{
     660    result->set(accessibilityObject().clickPoint().y);
     661}
     662
    651663//
    652664// Methods
     
    726738}
    727739
    728 void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList&, CppVariant* result)
    729 {
    730     result->setNull();
     740void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList& arguments, CppVariant* result)
     741{
     742    result->setNull();
     743
     744    if (arguments.size() != 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
     745        return;
     746
     747    int x = arguments[0].toInt32();
     748    int y = arguments[1].toInt32();
     749    WebPoint point(x, y);
     750    WebAccessibilityObject obj = accessibilityObject().hitTest(point);
     751    if (obj.isNull())
     752        return;
     753
     754    result->set(*(m_factory->getOrCreate(obj)->getAsCppVariant()));
    731755}
    732756
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h

    r138121 r138260  
    9595    void isReadOnlyGetterCallback(CppVariant*);
    9696    void orientationGetterCallback(CppVariant*);
     97    void clickPointXGetterCallback(CppVariant*);
     98    void clickPointYGetterCallback(CppVariant*);
    9799
    98100    // Bound methods.
Note: See TracChangeset for help on using the changeset viewer.