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 462883 - [will] ARIA tooltips/alerts are not being output
[will] ARIA tooltips/alerts are not being output
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: 2.22.0
Assigned To: Scott Haeger
Orca Maintainers
Depends on:
Blocks: 423348
 
 
Reported: 2007-08-02 19:09 UTC by Scott Haeger
Modified: 2008-07-22 19:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first version of ARIA tooltips/alerts are not being output (3.94 KB, patch)
2007-08-03 18:58 UTC, Scott Haeger
none Details | Review
second version of ARIA tooltips/alerts (3.69 KB, patch)
2007-11-05 17:04 UTC, Scott Haeger
none Details | Review
working test case (682 bytes, text/html)
2007-11-06 15:25 UTC, Scott Haeger
  Details
third version of ARIA tooltips/alerts (3.43 KB, patch)
2007-11-06 16:15 UTC, Scott Haeger
reviewed Details | Review
fourth version of ARIA tooltips/alerts (615 bytes, patch)
2007-12-03 18:43 UTC, Scott Haeger
none Details | Review
first version post live regions commit (5.33 KB, patch)
2008-01-30 20:10 UTC, Scott Haeger
none Details | Review
second version post live region commit (8.99 KB, patch)
2008-01-31 16:30 UTC, Scott Haeger
accepted-commit_now Details | Review

Description Scott Haeger 2007-08-02 19:09:17 UTC
ARIA tooltips/alerts are not being output.  

It is known that the dojo tooltips use wairole:alert see http://trac.dojotoolkit.org/ticket/3957 and the other test case uses wairole:tooltip (I believe).  There also has been double output on JAWS see https://bugzilla.mozilla.org/show_bug.cgi?id=390673 and I have seen an excessive amount of at-spi events when the alert appears.

Test cases
* HTML tooltip link at http://developer.mozilla.org/en/docs/Accessible_DHTML#Supported_roles
* Dojo tooltip example at 
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Tooltip.html
Comment 1 Scott Haeger 2007-08-03 18:58:48 UTC
Created attachment 93053 [details] [review]
first version of ARIA tooltips/alerts are not being output

This patch suffers from the Mozilla bug listed in the opening comment (double announcements), but seems to perform good on the test cases.

Notes and questions:
1) The object pointed to by the object:children-changed:add event is not always the alert/tooltip, sometimes the tooltip is a child of this object.
2) Should we stylize the output?  It is an alert.
3) Is braille handled properly?
4) Is monitoring object:children-changed events too costly?
Comment 2 Willie Walker 2007-08-08 22:34:11 UTC
(In reply to comment #1)
> This patch suffers from the Mozilla bug listed in the opening comment (double
> announcements), but seems to perform good on the test cases.

Seems to work OK for me!  I don't get the double announcements from the tooltips on http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Tooltip.html.  I did notice this stack trace, though:

Traceback (most recent call last):
  • File "/usr/local/lib/python2.5/site-packages/orca/focus_tracking_presenter.py", line 627 in _processObjectEvent
    s.processObjectEvent(event)
  • File "/usr/local/lib/python2.5/site-packages/orca/script.py", line 296 in processObjectEvent
    self.listeners[key](event)
  • File "/usr/local/lib/python2.5/site-packages/orca/Gecko.py", line 3689 in onChildrenChanged
  • File "/usr/local/lib/python2.5/site-packages/orca/Gecko.py", line 5047 in isAriaAlert
    for attr in obj.attributes:
AttributeError: 'NoneType' object has no attribute 'attributes'

> Notes and questions:
> 1) The object pointed to by the object:children-changed:add event is not always
> the alert/tooltip, sometimes the tooltip is a child of this object.

Bummer.  This can make processing children-changed events expensive if we get lots and lots of children-changed events.  I see lots of name-changed events for the tooltips in the Dojo example, many of which seem redundant for some odd reason.  I wonder if we can use those?  If not, I guess we can try to figure out some optimization scheme for ignoring children-changed events in some cases (e.g., the page is loading).

> 2) Should we stylize the output?  It is an alert.
> 3) Is braille handled properly?

It looks like the current tooltip handling code for GTK+ just presents the tooltip text with no other information. Mike, should we be presenting rolename information?

> 4) Is monitoring object:children-changed events too costly?

It might be, but if there's no other way, we'll need to cope.  :-(

By the way, is there a keyboard mechanism for Gecko to pop up a tooltip?  In GTK+ it is Ctrl+F1.  I've only been able to pop up tooltips in Gecko via mouse-overs :-(.  

Note also that there is a setting to ignore tooltips popped up by mouse overs: settings.presentTooltips.  If it is False, tooltips popped up by mouse overs should be ignored. 
Comment 3 Willie Walker 2007-08-30 16:10:39 UTC
> AttributeError: 'NoneType' object has no attribute 'attributes'

For reference, this being addressed as part of bug 469686.
Comment 4 Scott Haeger 2007-11-05 17:04:15 UTC
Created attachment 98572 [details] [review]
second version of ARIA tooltips/alerts

First version post-pyatspi migration.

The any_data field for object-children:changed:add:system events is now None for tooltips/alerts.  I will consult with Aaron about this problem.  What is strange is that the any_data field is now correct for live region events but None for these types of events, both of which are object-children:changed:add:system events.
Comment 5 Scott Haeger 2007-11-06 15:20:36 UTC
Mozilla bug that tracks the any_data problem https://bugzilla.mozilla.org/show_bug.cgi?id=402597 .

Highlights:
Accessibility::Event.any_data is correct if you change the 'span' to a 'p' for
the tooltip in http://www.mozilla.org/access/dhtml/new/tooltip .  Please fix
span issue (tough one I'm sure) or change the example, possibly mentioning
<span> unsupported.

The UIUC examples seen here
http://test.cita.uiuc.edu/aria/tooltip/view_xhtml.php?title=Tooltip%20Example%201&ginc=includes/tooltip1_xhtml.inc&gcss=css/tooltip1_xhtml.css&gjs=js/tooltip1_xhtml.js,../js/widgets_xhtml.js,../js/globals.js
and
http://test.cita.uiuc.edu/aria/tooltip/view_html.php?title=Tooltip%20Example%201&ginc=includes/tooltip1.inc&gcss=css/tooltip1.css&gjs=js/tooltip1.js,../js/widgets.js,../js/globals.js
do not trigger any AT-SPI events during the tooltip showing sequence.

The dojo example seen here
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Tooltip.html
also uses a span for the tooltip.  However, changing it to a <p> did not fix
the problem.  I tried several markup changes to the surrounding tooltip markup,
all with no luck.  The event.any_data field is always None for
object:children-changed:add:system events.  Also of note is that the
object:text-changed:inserted:system events appear to be of little worth to Orca
for tooltip announcements.
Comment 6 Scott Haeger 2007-11-06 15:25:31 UTC
Created attachment 98667 [details]
working test case

This is a working test case.  Most test cases are currently unsupported due to the any_data issue for children-changed events.  This test case is an adaptation of the Mozilla example, where <span> is replaced with <p> for the tooltip.
Comment 7 Scott Haeger 2007-11-06 16:15:11 UTC
Created attachment 98670 [details] [review]
third version of ARIA tooltips/alerts

Patch that works well on the attached test case.  It should also work with other alerts/tooltips as long as the object:children-changed:add:system events has a good any_data field and has proper ARIA 'xml-roles' markup.
Comment 8 Willie Walker 2007-11-27 17:39:53 UTC
This looks good from a code perspective -- the changes are relatively isolated and safe.  Mike, what are your thoughts from a user interface perspective?
Comment 9 Mike Pedersen 2007-11-28 20:20:45 UTC
With the limited number of test cases currently available I think this functionality is OK.  
Comment 10 Scott Haeger 2007-11-29 18:57:47 UTC
(In reply to comment #8)
> This looks good from a code perspective 

I'm wondering if I should put more safeguards against container objects.  Probably won't happen with a tooltip, but you never know.

> the changes are relatively isolated and safe.  

Famous last words :)  The changes are not so isolated.  It introduces a listener for object:children-changed events into Gecko.py.  I think the performance ding might be noticeable, especially on page loads.

Comment 11 Willie Walker 2007-11-29 19:06:04 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > This looks good from a code perspective 
> 
> I'm wondering if I should put more safeguards against container objects. 
> Probably won't happen with a tooltip, but you never know.

If you think it's necessary, then feel free.  :-)

> > the changes are relatively isolated and safe.  
> 
> Famous last words :)  The changes are not so isolated.  It introduces a
> listener for object:children-changed events into Gecko.py.  I think the
> performance ding might be noticeable, especially on page loads.

Well...the self.noOp listener was already doing this, so it shouldn't introduce too much overhead, except for the string compare to "object:children-changed:add:system".
Comment 12 Scott Haeger 2007-11-30 14:25:10 UTC
Committed to trunk with no additional changes as discussed in comment #10.
Comment 13 Scott Haeger 2007-12-03 18:43:22 UTC
Created attachment 100131 [details] [review]
fourth version of ARIA tooltips/alerts

Added sanity check for event.any_data.
Comment 14 Scott Haeger 2007-12-03 18:51:28 UTC
sanity check committed into trunk.
Comment 15 Scott Haeger 2008-01-30 20:10:08 UTC
Created attachment 104061 [details] [review]
first version post live regions commit

This version treats all tooltip/alerts as a live region.  The following things need to be done to accomplish this:

1) Use STATE_SELECTABLE instead of STATE_FOCUSABLE.  This allowed me to look at the target object (any_data) state for children-changed events in handleAsLiveRegion().  Looking at the target object and not the source object fixes some tooltip types and seems to be the correct thing to do here.  

2) In liveregions._getMessage(), I took a closer look at how I was getting content for certain event types with and without ARIA markup and with atomic='true' and atomic='false'.  I think what I have now more accurately honors the atomic property.  Objects that do not have ARIA markup are treated like atomic='false'.

3) In liveregions._getMessage(), I changed the find(embed char) to a count(embed char).  We will get a children-changed event if we see an embed character.  The find() was just plain wrong.

The fix allows Orca to work on all tooltip examples (UIUC example will be updated soon), the finance sites and the live region test sets.  I also checked the bugzilla combobox horror.  Everything seems to work fine.
Comment 16 Scott Haeger 2008-01-30 20:11:39 UTC
Changed target milestone to 2.21.91
Comment 17 Scott Haeger 2008-01-30 21:28:55 UTC
The latest patch fails badly on the Mozilla ARIA alert example http://www.mozilla.org/access/dhtml/alert .  The problem is due to no ':system' on some of the object:children-changed:insert events.  As a result of this, these are immediately being rejected as not live regions in the first test in handleAsLiveRegion().  I'm not really sure what the best course of action is yet.  Is this a Firefox bug?
Comment 18 Marco Zehe 2008-01-30 22:40:52 UTC
Scott, can you check whether this is also true with a build prior to January 24? On January 24 builds, fix for Mozilla bug 407359 landed, which also had some changes to the way Alerts work, to prevent screen readers on Windows double-speaking or even triple-speaking them. I could imagine that this had an affect on the way Orca needs to handle such alerts like the "Do you want to remember this password" one.
Comment 19 Aaron Leventhal 2008-01-31 03:46:07 UTC
I would expect no :system on those events actually. I'm not sure you understand the purpose of :system.

If :system is not present, it means the user caused the change by clicking on something or pressing a key. That means it is probably *more* likely they want to hear whatever it is, since they made it happen and its not random. Sort of like when you tab or hit a key you want to hear the results of that.

As opposed to something like a change in a stock quote, which is called :system because the user did not cause the update to happen via any input they provided. Those kinds of changes are a bit more disorienting.
Comment 20 Scott Haeger 2008-01-31 04:17:27 UTC
The problem is some of those alerts trigger events with :system and others do not.  I would expect no :system for all of them.  Have we found an edge case where "*more* likely" doesn't hold?
Comment 21 Aaron Leventhal 2008-01-31 04:30:17 UTC
Any children-changed or text-changed event that is the result of a click or key should not have :system.

It's a bug when that's not true.
Comment 22 Scott Haeger 2008-01-31 16:30:19 UTC
Created attachment 104112 [details] [review]
second version post live region commit

This version builds on the last patch to include support for ARIA alerts.  Now, both ARIA alerts and tooltips are handled by the live region manager.  In addition to juggling the event.types and filter conditions, I added another filter in handleAsLiveRegion().  This filter looks at a new timestamp taken when we get a window:active event.  The filter prevents live region events that have occurred within 2 seconds of the document being 'loaded'.  This was required because I came across several pages that build dynamically after the page is loaded.  This dynamic building triggers events that mimic a live region change.  The new filter simply allows the page to be built before live regions are acted upon.
Comment 23 Aaron Leventhal 2008-01-31 16:37:14 UTC
I should have said this yesterday:
In the specific case of an alert I would not worry about whether it is :system or not. It should basically be treated as assertive or rude no matter what.

The idea of an alert is it is something the user really needs to know. It could be a severe weather alert or "servers going down in 10 minutes" type of thing that isn't necessarily generated by user input.

We still need to fix the bug on the Firefox side obviously. The :system indicator is still important for all non-alert changes.
Comment 24 Willie Walker 2008-02-08 18:52:57 UTC
Joanie helped give me a quick sanity check via IM.  This patch seems OK.  The only question is if the tooltip stuff respects the settings.presentToolTips setting.  If not, it's probably still OK to check this patch in and then open a separate bug to make sure the setting is honored.

The presentToolTips setting, btw, is hackily handled in focus_tracking_presenter.py right now.  The main notion is this:

1) If the user forced a tooltip to appear via a keyboard action (Ctrl+F1), then present the tooltip regardless of the setting.

2) If the tooltip appeared because of some non-keyboard action (e.g., mouse over), then present the tooltip only if the setting is true.
Comment 25 Scott Haeger 2008-02-08 19:36:24 UTC
committed to trunk.  Changed Target Milestone to 2.21.92.