Firefox broadcasts an EVENT_SYSTEM_SCROLLINGSTART event when jumping to a named anchor. WebKit should also broadcast this event.
<rdar://problem/7197644>
Created attachment 39504 [details] patch
Created attachment 39505 [details] DRT changes, layout test
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 on attachment 39505 [details] DRT changes, layout test This patch looks fine, but your new test and result are missing!
Created attachment 39565 [details] DRT changes, layout test Whoops! Added the test and result.
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
(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!
Committed r48367, r48368.