Bug 28899 - WebKit should broadcast an MSAA event when jumping to a named anchor
Summary: WebKit should broadcast an MSAA event when jumping to a named anchor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Jon Honeycutt
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-09-01 17:30 PDT by Jon Honeycutt
Modified: 2009-09-14 14:28 PDT (History)
0 users

See Also:


Attachments
patch (15.38 KB, patch)
2009-09-11 21:42 PDT, Jon Honeycutt
aroben: review+
aroben: commit-queue-
Details | Formatted Diff | Diff
DRT changes, layout test (10.68 KB, patch)
2009-09-11 21:42 PDT, Jon Honeycutt
aroben: review-
Details | Formatted Diff | Diff
DRT changes, layout test (13.12 KB, patch)
2009-09-14 12:49 PDT, Jon Honeycutt
aroben: review+
aroben: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Honeycutt 2009-09-01 17:30:53 PDT
Firefox broadcasts an EVENT_SYSTEM_SCROLLINGSTART event when jumping to a named anchor. WebKit should also broadcast this event.
Comment 1 Jon Honeycutt 2009-09-03 20:02:49 PDT
<rdar://problem/7197644>
Comment 2 Jon Honeycutt 2009-09-11 21:42:10 PDT
Created attachment 39504 [details]
patch
Comment 3 Jon Honeycutt 2009-09-11 21:42:40 PDT
Created attachment 39505 [details]
DRT changes, layout test
Comment 4 Adam Roben (:aroben) 2009-09-14 06:31:10 PDT
Comment on attachment 39504 [details]
patch

> +    DWORD msaaEvent;
> +    switch (notification) {
> +        case AXFocusedUIElementChanged:
> +            msaaEvent = EVENT_OBJECT_FOCUS;
> +            break;
> +
> +        case AXScrolledToAnchor:
> +            msaaEvent = EVENT_SYSTEM_SCROLLINGSTART;
> +            break;
> +
> +        default:
> +            return;
> +    }

It might be clearer to use a HashMap, though it probably doesn't matter as long as we only have two events we care about.

> +    // Windows will end up calling get_accChild() on the root accessible
> +    // object for the WebView, passing the child ID that we specify below. We
> +    // negate the AXID so we know that the caller is passing the ID of an
> +    // element, not the index of a child element.
> +
> +    ASSERT(obj->axObjectID() >= 1 && obj->axObjectID() <= numeric_limits<LONG>::max());

You should split this up into two assertions.

r=me
Comment 5 Adam Roben (:aroben) 2009-09-14 06:33:45 PDT
Comment on attachment 39505 [details]
DRT changes, layout test

This patch looks fine, but your new test and result are missing!
Comment 6 Jon Honeycutt 2009-09-14 12:49:26 PDT
Created attachment 39565 [details]
DRT changes, layout test

Whoops! Added the test and result.
Comment 7 Adam Roben (:aroben) 2009-09-14 12:53:35 PDT
Comment on attachment 39565 [details]
DRT changes, layout test

> +            function test()
> +            {
> +                if (window.layoutTestController)
> +                    document.getElementById("notDRT").style.visibility = "hidden";
> +
> +                accessibilityController.logScrollingStartEvents();
> +                layoutTestController.waitUntilDone();
> +                layoutTestController.dumpAsText();
> +                setTimeout(scrollToAnchor, 0);
> +            }
> +
> +            function scrollToAnchor()
> +            {
> +                if (window.eventSender) {
> +                    var input = document.getElementById('ANCHORLINK');
> +                    var x = input.offsetLeft;
> +                    var y = input.offsetTop;
> +                    eventSender.mouseMoveTo(x, y);
> +                    eventSender.mouseDown();
> +                    eventSender.mouseUp();
> +                }
> +
> +                layoutTestController.notifyDone();
> +            }

This will throw a bunch of JS exceptions when window.layoutTestController or window.accessibilityController don't exist.

r=me
Comment 8 Jon Honeycutt 2009-09-14 13:13:40 PDT
(In reply to comment #7)
> (From update of attachment 39565 [details])
> 
> This will throw a bunch of JS exceptions when window.layoutTestController or
> window.accessibilityController don't exist.

I changed test() to return early in this case.

> 
> r=me

Thanks!
Comment 9 Jon Honeycutt 2009-09-14 14:28:15 PDT
Committed r48367, r48368.