OSDN Git Service

MSHTMLTextInfo._expandToLine: textRange.select() sometimes throws focus onto the...
authorJames Teh <jamie@jantrid.net>
Fri, 17 Jun 2011 08:00:33 +0000 (18:00 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 17 Jun 2011 08:00:33 +0000 (18:00 +1000)
Fixes a rare problem where the focus kept bouncing infinitely between the document and a multi-line editable text field in focus mode.
Fixes #1566.

source/NVDAObjects/IAccessible/MSHTML.py
user_docs/en/changes.t2t

index af635a9..d079dd0 100644 (file)
@@ -166,7 +166,9 @@ class MSHTMLTextInfo(textInfos.TextInfo):
                with self.obj.suspendCaretEvents():\r
                        selObj=parent.document.selection\r
                        oldSelRange=selObj.createRange().duplicate()\r
-                       textRange.select()\r
+                       # #1566: Calling textRange.select() sometimes throws focus onto the document,\r
+                       # so create a new range from the selection and move the selection using that.\r
+                       selObj.createRange().moveToBookmark(textRange.getBookmark())\r
                        KeyboardInputGesture.fromName("home").send()\r
                        api.processPendingEvents(False)\r
                        newSelStartMark=selObj.createRange().getBookmark()\r
index d77e787..a5de4af 100644 (file)
@@ -95,6 +95,7 @@ Highlights of this release include major improvements concerning punctuation and
 - NVDA no longer fails to announce the new cell when moving in an Excel spreadsheet after cutting and pasting. (#1567)\r
 - NVDA no longer becomes worse at guessing color names the more colors it announces.\r
 - In Internet Explorer and other MSHTML controls, fixed the inability to read parts of rare pages which contain iframes marked with an ARIA role of presentation. (#1569)\r
+- In Internet Explorer and other MSHTML controls, fixed a rare problem where the focus kept bouncing infinitely between the document and a multi-line editable text field in focus mode. (#1566)\r
 \r
 \r
 == Changes for Developers ==\r