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 538680 - collection.getMatchesTo() seems to ignore the count
collection.getMatchesTo() seems to ignore the count
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: general
1.23.x
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
Li Yuan
: 538682 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-16 22:23 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2010-04-12 03:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
The attachment I promised and then forgot to attach. (385 bytes, text/html)
2008-06-25 22:40 UTC, Joanmarie Diggs (IRC: joanie)
  Details
Proposed patch. (603 bytes, patch)
2010-04-10 15:51 UTC, Mike Gorse
none Details | Review
Revised patch. (1.42 KB, patch)
2010-04-10 16:58 UTC, Mike Gorse
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2008-06-16 22:23:55 UTC
Steps to reproduce:

1. Open the (to be) attached sample in Accerciser
2. Select document frame in Accerciser's hierarchy
3. In the iPython Console type:

  c = acc.queryCollection()
  s = StateSet()
  rule = c.createMatchRule(s.raw(), c.MATCH_ANY, [], c.MATCH_ANY, [ROLE_HEADING], c.MATCH_ANY, "", c.MATCH_ALL, False)

4. Select the accessible for the "Heading 4" heading/label
5. In the iPython Console type:

  rs = c.getMatchesTo(acc, rule, c.SORT_ORDER_CANONICAL, c.TREE_INORDER, True, 1, True)

Expected results: rs would have a length of 1 (the accessible for "Heading 3") because a count of 1 was specified.

Actual results:  rs has a length of 3 (all of the headings from the top of the document frame to the current item).

When you do a similar query with getMatchesFrom(), you reliably get (at most) the number you specify in the count.
Comment 1 Joanmarie Diggs (IRC: joanie) 2008-06-25 22:40:44 UTC
Created attachment 113440 [details]
The attachment I promised and then forgot to attach.

Sorry about that.  Here's the attached test case. :-)
Comment 2 Joanmarie Diggs (IRC: joanie) 2010-04-08 23:11:57 UTC
Li, could you please take a look at this one (using Firefox as the browser for viewing the test case, since Gecko has implemented the collection interface)?

The impact of this bug is that Orca's structural navigation can be incredibly, painfully slow on large web pages. Users would be thrilled if this were not the case.

I'm assuming the bug is in at-spi; if it's in Firefox, knowing that for certain would be helpful so that we can get it fixed there.

Thanks!
Comment 3 Li Yuan 2010-04-09 02:20:13 UTC
Adding Mike to the cc list, since he is the master of collection.
Comment 4 Mike Gorse 2010-04-10 15:51:01 UTC
Created attachment 158370 [details] [review]
Proposed patch.

For the record, I did not originally write this code.  Anyway, yeah, it looks as though we're ignoring the count for the reverse-canonical search.  Thanks for tracking it down, Joanie.

I'll commit this patch if Li is okay with it.
Comment 5 Joanmarie Diggs (IRC: joanie) 2010-04-10 16:16:19 UTC
Woo hoo! Thanks Mike!!

If it is committed, I'd ask that it be considered for both master and the branch for gnome-2-30. While I've not tried it yet, it should in theory make structural navigation by previous item much speedier on large web pages.
Comment 6 Mike Gorse 2010-04-10 16:58:35 UTC
Created attachment 158375 [details] [review]
Revised patch.

Avoids unnecessary recursion.  Also, the previous patch broke handling ofn
max == 0, which apparently means "no limit"
Comment 7 Li Yuan 2010-04-12 02:32:09 UTC
Review of attachment 158375 [details] [review]:

I am OK with the patch.
Comment 8 Mike Gorse 2010-04-12 03:02:13 UTC
It's pushed to master (I don't think I have permission to mark the attachment committed or to close the bug).  Also, there isn't currently a tag for 2.30 (should I have created one before pushing?)
Comment 9 Li Yuan 2010-04-12 03:18:22 UTC
We have a tag for at-spi 1.30.0. (http://git.gnome.org/browse/at-spi/tag/?id=AT_SPI_1_30_0) Do you mean a branch for gnome 2.30? Since we are going to commit this patch in the branch anyway, I think it is OK to create the branch after pushing.
Comment 10 Li Yuan 2010-04-12 03:45:25 UTC
Review of attachment 158375 [details] [review]:

Committed
Comment 11 Joanmarie Diggs (IRC: joanie) 2010-04-12 03:52:46 UTC
*** Bug 538682 has been marked as a duplicate of this bug. ***