Closed
Bug 624977
Opened 14 years ago
Closed 14 years ago
Optimize nsXulTreeAccessible selectedItems()
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
mozilla2.0b10
People
(Reporter: tbsaunde, Assigned: tbsaunde)
References
Details
Attachments
(2 files, 1 obsolete file)
1.22 KB,
patch
|
surkov
:
review+
davidb
:
approval2.0+
|
Details | Diff | Splinter Review |
4.08 KB,
patch
|
MarcoZ
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre
selectedITems() in nsXulTreeAccessible was iterating over all the rows of a xul tree when finding the list of selected items instead we use getRangeCount() and getRangeAt() from xul tree selection
Reproducible: Couldn't Reproduce
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #503082 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Component: Disability Access → Disability Access APIs
Product: Firefox → Core
Comment 2•14 years ago
|
||
Comment on attachment 503082 [details] [diff] [review]
a patch implementing this
nsITreeSelection::GetRangeAt is not optimal for us - http://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/tree/src/nsTreeSelection.cpp#584, but that is much better than we have now - traverse through all tree items and look each item through all ranges. I'd suggest to file followup bug to change nsITreeSelection what can be done after Firefox 4.
>+ PRInt32 selectionGroups, curGroup;
>+ selection->GetRangeCount(&selectionGroups);
>+ for (curGroup = 0; curGroup < selectionGroups; curGroup++) {
>+ PRInt32 curRow, firstRow, lastRow;
>+ selection->GetRangeAt(curGroup, &firstRow, &lastRow);
>+ for (curRow = firstRow; curRow <= lastRow; curRow++) {
>+ nsIAccessible* item = GetTreeItemAccessible(curRow);
> if (item)
> selectedItems->AppendElement(item, PR_FALSE);
> }
> }
I'd define variables where they are used, initialize them and change their names, also please use spaces (not tabs) like
>+ PRInt32 rangeCount = 0;
>+ selection->GetRangeCount(&rangeCount);
>+ for (PRint32 rangeIdx = 0; rangeIdx < rangeCount; rangeIdx++) {
>+ PRInt32 firstRowIdx = 0, lastRowIdx = -1;
> selection->GetRangeAt(rangeIdx, &firstRowIdx, &lastRowIdx);
>+ for (PRInt32 rowIdx = firstRowIdx; rowIdx <= lastRowIdx; rowIdx++) {
>+ nsIAccessible* item = GetTreeItemAccessible(rowIdx);
> if (item)
> selectedItems->AppendElement(item, PR_FALSE);
> }
> }
please update the patch and rerequest the review
Attachment #503082 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #503082 -
Flags: review?(surkov.alexander)
Updated•14 years ago
|
Assignee: nobody → trev.saunders
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 3•14 years ago
|
||
updated patch
Attachment #503101 -
Flags: review?(surkov.alexander)
Comment 4•14 years ago
|
||
Comment on attachment 503101 [details] [diff] [review]
updated patch basedon Surkov's comments
r=me, requesting an approval, that should be good perf improvement
Attachment #503101 -
Flags: review?(surkov.alexander)
Attachment #503101 -
Flags: review+
Attachment #503101 -
Flags: approval2.0?
Updated•14 years ago
|
Flags: in-testsuite?
Assignee | ||
Updated•14 years ago
|
Attachment #503082 -
Attachment is obsolete: true
Attachment #503082 -
Flags: review?(surkov.alexander)
Updated•14 years ago
|
QA Contact: disability.access → accessibility-apis
Comment 5•14 years ago
|
||
Comment on attachment 503101 [details] [diff] [review]
updated patch basedon Surkov's comments
a=me as long as we get a clean try server run, and please confirm that we have sufficient test coverage. (Nice one Trevor!)
Attachment #503101 -
Flags: approval2.0? → approval2.0+
Comment 6•14 years ago
|
||
Trevor to confirm test coverage you can purposely introduce various bugs and run our test suite to check for failures. If nothing fails we'll need to write tests.
Comment 7•14 years ago
|
||
Nice and green on tryserver.
Comment 8•14 years ago
|
||
(In reply to comment #7)
> Nice and green on tryserver.
Unfortunately it's not covered by mochitest.
I'll add some mochitests since it sounds like mochitest suite fails when Orca is running and as consequence Trevor can't do that.
Updated•14 years ago
|
Summary: improve nsXulTreeAccessible selectedItems() → Optimize nsXulTreeAccessible selectedItems()
Comment 9•14 years ago
|
||
Attachment #504370 -
Flags: review?(marco.zehe)
Updated•14 years ago
|
Severity: enhancement → normal
Comment 10•14 years ago
|
||
try server build containing mochitest and patch - http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/surkov.alexander@gmail.com-fe2d80aed386
Comment 11•14 years ago
|
||
Comment on attachment 504370 [details] [diff] [review]
mochitest
r=me, nicely done, thanks!
Attachment #504370 -
Flags: review?(marco.zehe) → review+
Comment 12•14 years ago
|
||
landed on 2.0
http://hg.mozilla.org/mozilla-central/rev/e227ac817df4 (mochitest)
http://hg.mozilla.org/mozilla-central/rev/66addc5c30ca (patch)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b10
Updated•14 years ago
|
Blocks: a11yperf_fx4
You need to log in
before you can comment on or make changes to this bug.
Description
•