[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

cfleizach at apple.com cfleizach at apple.com
Thu Apr 8 02:17:50 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0c8875a4b170cec68f52ecca3f2743453b0b421b
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Mar 9 17:42:29 2010 +0000

    AX: hit testing a list box doesn't work anymore
    https://bugs.webkit.org/show_bug.cgi?id=35893
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Since <option> elements don't have renderers, their hit testing needs
    to be handled with a special case.
    
    Test: platform/mac/accessibility/listbox-hit-test.html
    
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::ariaIsHidden):
    (WebCore::AccessibilityRenderObject::doAccessibilityHitTest):
    
    WebKitTools:
    
    * DumpRenderTree/AccessibilityController.cpp:
    (getElementAtPointCallback):
    (AccessibilityController::getJSClass):
    * DumpRenderTree/AccessibilityController.h:
    * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
    (AccessibilityController::elementAtPoint):
    * DumpRenderTree/mac/AccessibilityControllerMac.mm:
    (AccessibilityController::elementAtPoint):
    * DumpRenderTree/win/AccessibilityControllerWin.cpp:
    (AccessibilityController::elementAtPoint):
    
    LayoutTests:
    
    * platform/mac/accessibility/listbox-hit-test-expected.txt: Added.
    * platform/mac/accessibility/listbox-hit-test.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55729 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b9ccefd..47019cf 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-09  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        * platform/mac/accessibility/listbox-hit-test-expected.txt: Added.
+        * platform/mac/accessibility/listbox-hit-test.html: Added.
+
 2010-03-09  Csaba Osztrogonác  <ossy at webkit.org>
 
         [Qt] editing/execCommand/move-selection-back-line.html fails in DRT.
diff --git a/LayoutTests/platform/mac/accessibility/listbox-hit-test-expected.txt b/LayoutTests/platform/mac/accessibility/listbox-hit-test-expected.txt
new file mode 100644
index 0000000..e418c6f
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/listbox-hit-test-expected.txt
@@ -0,0 +1,13 @@
+
+This tests that hit testing works on a listbox.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.role is 'AXRole: AXStaticText'
+PASS element.stringValue is 'AXValue: test option that spans the width of the cell. test option that spans the width of the cell'
+PASS element.parentElement().role is 'AXRole: AXList'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/listbox-hit-test.html b/LayoutTests/platform/mac/accessibility/listbox-hit-test.html
new file mode 100644
index 0000000..e0e24b5
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/listbox-hit-test.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div tabindex=0 id="region">
+<select size=20>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+<option>test option that spans the width of the cell. test option that spans the width of the cell</option>
+</select>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that hit testing works on a listbox.");
+
+    if (window.accessibilityController) {
+
+          document.getElementById("region").focus();
+          var region = accessibilityController.focusedElement;
+          
+          var element = accessibilityController.elementAtPoint(region.x + region.width/2, region.y + region.height/2);
+          shouldBe("element.role", "'AXRole: AXStaticText'");
+          shouldBe("element.stringValue", "'AXValue: test option that spans the width of the cell. test option that spans the width of the cell'");
+          shouldBe("element.parentElement().role", "'AXRole: AXList'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d392fd1..1c5669f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-03-09  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        Since <option> elements don't have renderers, their hit testing needs
+        to be handled with a special case.
+
+        Test: platform/mac/accessibility/listbox-hit-test.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::ariaIsHidden):
+        (WebCore::AccessibilityRenderObject::doAccessibilityHitTest):
+
 2010-03-09  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index c39a81a..4c12b91 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1412,13 +1412,13 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
     
 bool AccessibilityRenderObject::ariaIsHidden() const
 {
-    if (equalIgnoringCase(getAttribute(aria_hiddenAttr).string(), "true"))
+    if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
         return true;
     
     // aria-hidden hides this object and any children
     AccessibilityObject* object = parentObject();
     while (object) {
-        if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_cast<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr).string(), "true"))
+        if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_cast<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr), "true"))
             return true;
         object = object->parentObject();
     }
@@ -2485,6 +2485,9 @@ AccessibilityObject* AccessibilityRenderObject::doAccessibilityHitTest(const Int
     if (node->hasTagName(areaTag)) 
         return accessibilityImageMapHitTest(static_cast<HTMLAreaElement*>(node), point);
     
+    if (node->hasTagName(optionTag))
+        node = static_cast<HTMLOptionElement*>(node)->ownerSelectElement();
+    
     RenderObject* obj = node->renderer();
     if (!obj)
         return 0;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1577037..8f5ef17 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-03-09  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        * DumpRenderTree/AccessibilityController.cpp:
+        (getElementAtPointCallback):
+        (AccessibilityController::getJSClass):
+        * DumpRenderTree/AccessibilityController.h:
+        * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+        (AccessibilityController::elementAtPoint):
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+        (AccessibilityController::elementAtPoint):
+        * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+        (AccessibilityController::elementAtPoint):
+
 2010-03-03  Fumitoshi Ukai  <ukai at chromium.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
index 045bc80..798389f 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
@@ -77,12 +77,26 @@ static JSValueRef logScrollingStartEventsCallback(JSContextRef ctx, JSObjectRef,
     return JSValueMakeUndefined(ctx);
 }
 
+static JSValueRef getElementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    int x = 0;
+    int y = 0;
+    if (argumentCount == 2) {
+        x = JSValueToNumber(context, arguments[0], exception);
+        y = JSValueToNumber(context, arguments[1], exception);
+    }
+    
+    AccessibilityController* controller = static_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject));
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, controller->elementAtPoint(x, y));
+}
+
 JSClassRef AccessibilityController::getJSClass()
 {
     static JSStaticFunction staticFunctions[] = {
         { "logFocusEvents", logFocusEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "logValueChangeEvents", logValueChangeEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "logScrollingStartEvents", logScrollingStartEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "elementAtPoint", getElementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0 }
     };
 
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.h b/WebKitTools/DumpRenderTree/AccessibilityController.h
index de58f84..5a6ca13 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.h
@@ -45,6 +45,7 @@ public:
     // Controller Methods - platform-independent implementations
     AccessibilityUIElement rootElement();
     AccessibilityUIElement focusedElement();
+    AccessibilityUIElement elementAtPoint(int x, int y);
 
     void setLogFocusEvents(bool);
     void setLogValueChangeEvents(bool);
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
index 12653fc..ab9f021 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
@@ -46,6 +46,12 @@ AccessibilityController::~AccessibilityController()
 {
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    // FIXME: implement
+    return 0;
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     AtkObject* accessible =  webkit_web_frame_get_focused_accessible_element(mainFrame);
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
index 4d2da6e..a41575a 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
@@ -40,6 +40,12 @@ AccessibilityController::~AccessibilityController()
 {
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    id accessibilityObject = [[[mainFrame frameView] documentView] accessibilityHitTest:NSMakePoint((CGFloat)x, (CGFloat)y)];
+    return AccessibilityUIElement(accessibilityObject);    
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     // FIXME: we could do some caching here.
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
index 6b35948..255bfc3 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
@@ -59,6 +59,12 @@ AccessibilityController::~AccessibilityController()
         JSValueUnprotect(frame->globalContext(), it->second);
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    // FIXME: implement
+    return 0;
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     COMPtr<IAccessible> rootAccessible = rootElement().platformUIElement();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list