After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 447191 - Firefox read page summary
Firefox read page summary
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
unspecified
Other Linux
: Normal enhancement
: 2.20.0
Assigned To: Scott Haeger
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-06-13 15:56 UTC by Scott Haeger
Modified: 2008-07-22 19:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first version of read page summary (3.93 KB, patch)
2007-06-14 13:23 UTC, Scott Haeger
none Details | Review
second version of read page summary (3.94 KB, patch)
2007-06-18 19:32 UTC, Scott Haeger
needs-work Details | Review
third version of read page summary (3.94 KB, patch)
2007-06-19 13:39 UTC, Scott Haeger
none Details | Review
third version of read page summary (5.00 KB, patch)
2007-06-19 13:50 UTC, Scott Haeger
accepted-commit_now Details | Review
test page that illustrates slashdot bug (250 bytes, text/html)
2007-06-19 14:34 UTC, Scott Haeger
  Details
fourth version of read page summary (1.19 KB, patch)
2007-06-19 16:21 UTC, Scott Haeger
none Details | Review

Description Scott Haeger 2007-06-13 15:56:54 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.
Comment 1 Scott Haeger 2007-06-14 13:23:35 UTC
Created attachment 89947 [details] [review]
first version of read page summary
Comment 2 Scott Haeger 2007-06-14 13:26:02 UTC
Implemented item 1 but not item 2 of opening comment.  Also, implemented the percentage of document read.
Comment 3 Scott Haeger 2007-06-14 14:04:43 UTC
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.
Comment 4 Mike Pedersen 2007-06-18 19:18:58 UTC
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.
Comment 5 Scott Haeger 2007-06-18 19:32:47 UTC
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.
Comment 6 Mike Pedersen 2007-06-18 19:47:24 UTC
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.  
Comment 7 Scott Haeger 2007-06-18 20:17:30 UTC
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):
  • File "/usr/local/lib/python2.4/site-packages/orca/input_event.py", line 182 in processInputEvent
    consumed = self._function(script, inputEvent)
  • File "/usr/local/lib/python2.4/site-packages/orca/default.py", line 1834 in whereAmI
    return self.whereAmI.whereAmI(obj, doubleClick, orcaKey)
  • File "/usr/local/lib/python2.4/site-packages/orca/where_am_I.py", line 1436 in whereAmI
    self.readPageSummary(obj)
  • File "/usr/local/lib/python2.4/site-packages/orca/where_am_I.py", line 1471 in readPageSummary
    obj = self._script.findNextObject(obj)
  • File "/usr/local/lib/python2.4/site-packages/orca/Gecko.py", line 5372 in findNextObject
    childOffset = self.getCharacterOffsetInParent(child)
  • File "/usr/local/lib/python2.4/site-packages/orca/Gecko.py", line 3910 in getCharacterOffsetInParent
    if obj.hyperlink:
AttributeError: 'NoneType' object has no attribute '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).
Comment 8 Willie Walker 2007-06-19 00:05:20 UTC
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.
Comment 9 Willie Walker 2007-06-19 00:12:14 UTC
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!
Comment 10 Scott Haeger 2007-06-19 13:39:18 UTC
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.
Comment 11 Scott Haeger 2007-06-19 13:50:27 UTC
Created attachment 90272 [details] [review]
third version of read page summary
Comment 12 Willie Walker 2007-06-19 14:09:21 UTC
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!
Comment 13 Scott Haeger 2007-06-19 14:32:49 UTC
Committed to repository.
Comment 14 Scott Haeger 2007-06-19 14:34:42 UTC
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.
Comment 15 Mike Pedersen 2007-06-19 14:42:27 UTC
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.  
Comment 16 Scott Haeger 2007-06-19 16:21:27 UTC
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.
Comment 17 Mike Pedersen 2007-06-19 16:28:29 UTC
Thanks I like this better as well.
Comment 18 Willie Walker 2007-07-08 16:58:24 UTC
(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!
Comment 19 Scott Haeger 2007-07-08 19:35:29 UTC
Translation docs committed to repository.