GNOME Bugzilla – Bug 538680
collection.getMatchesTo() seems to ignore the count
Last modified: 2010-04-12 03:52:46 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.
Created attachment 113440 [details] The attachment I promised and then forgot to attach. Sorry about that. Here's the attached test case. :-)
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!
Adding Mike to the cc list, since he is the master of collection.
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.
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.
Created attachment 158375 [details] [review] Revised patch. Avoids unnecessary recursion. Also, the previous patch broke handling ofn max == 0, which apparently means "no limit"
Review of attachment 158375 [details] [review]: I am OK with the patch.
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?)
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.
Review of attachment 158375 [details] [review]: Committed
*** Bug 538682 has been marked as a duplicate of this bug. ***