GNOME Bugzilla – Bug 447191
Firefox read page summary
Last modified: 2008-07-22 19:28:04 UTC
Read Page Summary reports the following information when activated. 1. Total number of headings, forms, tables, visited links, and unvisited links in the document. 2. Language of the document, if provided on the document frame accessible.
Created attachment 89947 [details] [review] first version of read page summary
Implemented item 1 but not item 2 of opening comment. Also, implemented the percentage of document read.
This command along with the 'go to' navigation commands have a fundamental flaw in that they are not interruptible. This is a major problem for a couple different reasons. First, in very large pages (eg digg.com w/many comments), navigation from the top of the page to an item that may be at the bottom of the page could leave the user hanging for several moments. During this time the user may think the screen reader has crashed or is malfunctioning somehow. In addition, the CPU usage will spike during the search. Second, LSR occasional had circular navigation problems due to Firefox bugs. This caused CPU usage to spike to the point of locking the desktop. I am not sure if this is a problem with Orca. This turns out to be a very difficult problem to solve. In LSR, we applied a bandaid to alleviate some of the woes. We included a user setting for 'search depth', which is really just the maximum number of nodes visited before the search returns 'not found' or 'maximum number of nodes seen'. We also included announcements which indicated progress like '1000 nodes searched'. The real solution to the problem may involve the Collection interface or some sort of chunking scheme where the search 'checks back' to see if it has been interrupted. However, I don't have a concrete plan for this.
I'm not sure what I'm doing wrong here but I've applied this patch to both my laptop and desktop and doublepressing the whereamI key while in firefox seems to be giving me no feedback.
Created attachment 90228 [details] [review] second version of read page summary I fixed a small bug involving layout tables. Evidently my test pages didn't have any tables. Sorry for the inconvenience.
This feature now works great on most sites. I like the way the information is being presented. For some reason it still isn't working on slashdot.org though.
I suspect this is a Firefox bug, possibly involving improper use of embed characters. The following stack trace is seen when triggering this command on slashdot.org: Traceback (most recent call last):
+ Trace 141967
consumed = self._function(script, inputEvent)
return self.whereAmI.whereAmI(obj, doubleClick, orcaKey)
self.readPageSummary(obj)
obj = self._script.findNextObject(obj)
childOffset = self.getCharacterOffsetInParent(child)
if obj.hyperlink:
This occurs on a 'panel' accessible. This accessible is the search box located at the top right of the page. I find it strange that it is even a 'panel' accessible. Something is wrong with it or the form (it's parent).
Yech! The offending code seems to be in findNextObject: ... index = 0 while index < obj.childCount: child = obj.child(index) childOffset = self.getCharacterOffsetInParent(child) if isinstance(child, atspi.Accessible) and \ not (obj.role == rolenames.ROLE_DOCUMENT_FRAME and \ childOffset < characterOffset): nextObj = child break else: index += 1 ... Looks like the return value of "child = obj.child(index)" is None. Very odd and very broken if this is the case. For a defensive maneuver, you might try changing the "if" to include "if child and ..." Then, the next thing to do is figure out what HTML construct is causing Gecko to give us a broken hierarchy and log a bug. :-( See the "Notes on filing bugs with Mozilla" section of http://live.gnome.org/Orca/MozillaBugs for what we do when we file a Mozilla bug. It's a bit labor intensive, but it helps us and our users track things more easily in the long run.
BTW, I would prefer you put the Gecko WhereAmI subclass in Gecko.py rather than where_am_I.py. This parallels what we do with speechgenerator and braillegenerator subclasses, and helps keep the subclasses with the thing they are written for. Thanks!
Created attachment 90271 [details] [review] third version of read page summary I moved GeckoWhereAmI to Gecko.py as recommended and put a bandaid in place which checks that child is not None in findNextObject(). The script works fine now on slashdot.org. I will now investigate the Firefox bug and I believe this patch is ready to be committed.
Created attachment 90272 [details] [review] third version of read page summary
Looks good - please check in (with the exception of the where_am_I.py module, which seems to be just whitespace). If you want to eliminate tabs and trailing whitespace, please do. :-) Thanks Scott!
Committed to repository.
Created attachment 90274 [details] test page that illustrates slashdot bug minimal html test page that illustrates slashdot bug. The problem seems to be the "fieldset" html tag.
I just had a thought while testing this. Should we really bother speaking an element type if there are 0 of that type? For example: "0 tables" seems unnecessary to me. I don't feel really strongly about this but it's just a thought.
Created attachment 90279 [details] [review] fourth version of read page summary I like the idea. Here is a new patch. In the future we may consider a list of accessibles the user can choose from and output only those items. It would be best to wait for Collections because that could easily fit into the MatchRule concept.
Thanks I like this better as well.
(In reply to comment #16) > Created an attachment (id=90279) [edit] > fourth version of read page summary > > I like the idea. Here is a new patch. In the future we may consider a list of > accessibles the user can choose from and output only those items. It would be > best to wait for Collections because that could easily fit into the MatchRule > concept. Please remember to include docs for the translators. Thanks!
Translation docs committed to repository.