Bug 71298 - AX: WK2: layout tests that require hit testing do not work with WK2
Summary: AX: WK2: layout tests that require hit testing do not work with WK2
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
: 98371 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-01 10:06 PDT by chris fleizach
Modified: 2015-06-19 19:06 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2011-11-01 10:06:19 PDT
These tests

+platform/mac/accessibility/html-slider-indicator.html
+platform/mac/accessibility/listbox-hit-test.html
+platform/mac/accessibility/iframe-with-title-correct-hierarchy.html

which require hit testing do not work with WK2 right now.
Comment 1 Radar WebKit Bug Importer 2013-12-20 11:25:30 PST
<rdar://problem/15710006>
Comment 2 Martin Robinson 2015-05-08 16:07:23 PDT
*** Bug 98371 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Bates 2015-06-19 19:01:08 PDT
From looking at <http://trac.webkit.org/browser/trunk/Source/WebKit/mac/WebView/WebHTMLView.mm?rev=185021#L4636> and <http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm?rev=165870#L51>, window.accessibilityController.elementAtPoint() expects that the specified coordinates of the point are with respect to the screen coordinate system and ultimately converts them to document ("content") coordinates. But the analogous function in WebKitTestRunner, <http://trac.webkit.org/browser/trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp?rev=179409#L92>, expects the specified coordinates to be with respect to the document coordinate system (*). We need to teach WebKitTestRunner to convert from screen coordinates to document coordinates.

On another note, I'm unclear how we came to the decision to have methods on AccessibilityController and AccessibilityUIElement take and return points with respect to the screen coordinate system as opposed to the document coordinate system. I take it there is value in using screen coordinates?

(*) The point is ultimately passed unchanged through to AccessibilityRenderObject::accessibilityHitTest(). And AccessibilityRenderObject::accessibilityHitTest() assumes the point is in document coordinates. The call chain has the form:
... => JSAccessibilityController::elementAtPoint() => AccessibilityController::elementAtPoint() => AccessibilityUIElement::elementAtPoint() => -[WebAccessibilityObjectWrapper accessibilityHitTest:] => AccessibilityScrollView::accessibilityHitTest() => AccessibilityRenderObject::accessibilityHitTest().
Comment 4 chris fleizach 2015-06-19 19:06:20 PDT
(In reply to comment #3)
> From looking at
> <http://trac.webkit.org/browser/trunk/Source/WebKit/mac/WebView/WebHTMLView.
> mm?rev=185021#L4636> and
> <http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/
> AccessibilityControllerMac.mm?rev=165870#L51>,
> window.accessibilityController.elementAtPoint() expects that the specified
> coordinates of the point are with respect to the screen coordinate system
> and ultimately converts them to document ("content") coordinates. But the
> analogous function in WebKitTestRunner,
> <http://trac.webkit.org/browser/trunk/Tools/WebKitTestRunner/InjectedBundle/
> AccessibilityController.cpp?rev=179409#L92>, expects the specified
> coordinates to be with respect to the document coordinate system (*). We
> need to teach WebKitTestRunner to convert from screen coordinates to
> document coordinates.
> 
> On another note, I'm unclear how we came to the decision to have methods on
> AccessibilityController and AccessibilityUIElement take and return points
> with respect to the screen coordinate system as opposed to the document
> coordinate system. I take it there is value in using screen coordinates?
> 
> (*) The point is ultimately passed unchanged through to
> AccessibilityRenderObject::accessibilityHitTest(). And
> AccessibilityRenderObject::accessibilityHitTest() assumes the point is in
> document coordinates. The call chain has the form:
> ... => JSAccessibilityController::elementAtPoint() =>
> AccessibilityController::elementAtPoint() =>
> AccessibilityUIElement::elementAtPoint() => -[WebAccessibilityObjectWrapper
> accessibilityHitTest:] => AccessibilityScrollView::accessibilityHitTest() =>
> AccessibilityRenderObject::accessibilityHitTest().

I think we generally want the testing points to be in document coordinates, but i think we may have done it this way so that we could take the value for the origin or the clickPoint and pass that back into the hit test. those points coming out i believe are converted to system coords