>+ /* Now that selection is done, move the focus to the selection. */
>+ nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
>+ if (fm) {
>+ nsCOMPtr<nsIPresShell> shell = GetPresShell();
>+ NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
>+ nsCOMPtr<nsIDocument> doc = shell->GetDocument();
>+ NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
It's preferable to add GetDocumentNode() method to nsAccessNode and use it here
>+ is(aAcc.selected, aSelectedBefore,
>+ "Wrong selected state before focus for ID " + aID + "!");
>+ document.getElementById(aID).focus();
>+ is(aAcc.selected, aSelectedAfter,
>+ "Wrong seleccted state after focus for ID " + aID + "!");
>+ }
>+
>+ function doTest()
>+ {
>+ //////////////////////////////////////////////////////////////////////////
>+ // normal hyperlink
>+ var link4 = getAccessible("link4", [nsIAccessibleHyperLink]);
>+ testFocus("link4", link4, false, true);
>+ heading1 = getAccessible("heading1", [nsIAccessibleText]);
>+ heading1.caretOffset = 3;
>+ testFocus("link4", link4, false, true);
I'm not sure what you test here, it looks like you ensure caretOffset removes the focus from link. Can you describe please what you want to check here?
(From update of attachment 448030)
>+ /* Now that selection is done, move the focus to the selection. */ nsIFocusManager > fm = do_GetService( FOCUSMANAGER_ CONTRACTID) ; nsIPresShell> shell = GetPresShell(); TRUE(shell, NS_ERROR_FAILURE); nsIDocument> doc = shell-> GetDocument( );
>+ nsCOMPtr<
>+ if (fm) {
>+ nsCOMPtr<
>+ NS_ENSURE_
>+ nsCOMPtr<
>+ NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
It's preferable to add GetDocumentNode() method to nsAccessNode and use it here
>+ <script type="applicati on/javascript" >
>+ function testFocus(aID, aAcc, aSelectedBefore, aSelectedAfter)
>+ {
nit: you could merge aID and aAcc
>+ is(aAcc.selected, aSelectedBefore, getElementById( aID).focus( ); /////// /////// /////// /////// /////// /////// /////// /////// /////// //// "link4" , [nsIAccessibleH yperLink] ); "heading1" , [nsIAccessibleT ext]); caretOffset = 3;
>+ "Wrong selected state before focus for ID " + aID + "!");
>+ document.
>+ is(aAcc.selected, aSelectedAfter,
>+ "Wrong seleccted state after focus for ID " + aID + "!");
>+ }
>+
>+ function doTest()
>+ {
>+ ///////
>+ // normal hyperlink
>+ var link4 = getAccessible(
>+ testFocus("link4", link4, false, true);
>+ heading1 = getAccessible(
>+ heading1.
>+ testFocus("link4", link4, false, true);
I'm not sure what you test here, it looks like you ensure caretOffset removes the focus from link. Can you describe please what you want to check here?