Closed
Bug 575052
Opened 14 years ago
Closed 14 years ago
cache text offsets within hypertext accessible
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
()
Details
(Keywords: access)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
davidb
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee | ||
Comment 2•14 years ago
|
||
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #454345 -
Flags: superreview?(neil)
Attachment #454345 -
Flags: review?(marco.zehe)
Attachment #454345 -
Flags: review?(bolterbugz)
Assignee | ||
Comment 3•14 years ago
|
||
I've updated perf tracking table - https://wiki.mozilla.org/Accessibility/EventCoalescing#Performance_improvements_tracking_table (tested on try server build I pointed above).
Comment 4•14 years ago
|
||
Comment on attachment 454345 [details] [diff] [review]
patch
r=me for the tests and the functionality part. Great job!
Attachment #454345 -
Flags: review?(marco.zehe) → review+
Comment 5•14 years ago
|
||
(In reply to comment #3)
> I've updated perf tracking table -
> https://wiki.mozilla.org/Accessibility/EventCoalescing#Performance_improvements_tracking_table
> (tested on try server build I pointed above).
Very nice.
Comment 6•14 years ago
|
||
Comment on attachment 454345 [details] [diff] [review]
patch
>+
>+ } else {
Nit: strange place for a blank line
>+ PRInt32 offset = mOffsets.SafeElementAt(index - 1, -1);
>+ if (offset != -1) {
>+ if (aInvalidateAfter) {
>+ PRInt32 count = mOffsets.Length() - index;
>+ if (count > 0)
>+ mOffsets.RemoveElementsAt(index, count);
>+ }
>+ return offset;
>+ }
Rather than using SafeElementAt, I'd prefer checking count >= 0 like this:
PRInt32 count = mOffsets.Length() - index;
if (count >= 0) {
if (count > 0 && aInvalidateAfter)
mOffsets.RemoveElementsAt(index, count);
return mOffsets[index - 1];
}
This also makes things minusculely easier for the optimiser ;-)
>+ PRUint32 childCount = GetChildCount();
>+ while (mOffsets.Length() < childCount && mOffsets.Length() < index) {
index is always less than mChildren.Length() [or childCount], right? So you shouldn't have to compare against childCount.
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to comment #6)
> (From update of attachment 454345 [details] [diff] [review])
> >+
> >+ } else {
> Nit: strange place for a blank line
the empty line is intended to separate visually end of if block from else block, it seems to me it's a bit more readable, I would safe this if you don't mind.
> Rather than using SafeElementAt, I'd prefer checking count >= 0 like this:
> PRInt32 count = mOffsets.Length() - index;
> if (count >= 0) {
> if (count > 0 && aInvalidateAfter)
> mOffsets.RemoveElementsAt(index, count);
> return mOffsets[index - 1];
> }
> This also makes things minusculely easier for the optimiser ;-)
>
> >+ PRUint32 childCount = GetChildCount();
> >+ while (mOffsets.Length() < childCount && mOffsets.Length() < index) {
> index is always less than mChildren.Length() [or childCount], right? So you
> shouldn't have to compare against childCount.
I like this, thank you.
Assignee | ||
Comment 8•14 years ago
|
||
Neil's comments are fixed
Attachment #454345 -
Attachment is obsolete: true
Attachment #455085 -
Flags: superreview?(neil)
Attachment #455085 -
Flags: review?(bolterbugz)
Attachment #454345 -
Flags: superreview?(neil)
Attachment #454345 -
Flags: review?(bolterbugz)
Updated•14 years ago
|
Attachment #455085 -
Flags: superreview?(neil) → superreview+
Comment 9•14 years ago
|
||
Comment on attachment 455085 [details] [diff] [review]
patch2
r=me.
>+nsHyperTextAccessible::GetChildOffset(nsAccessible* aChild,
>+ PRBool
>+ EnsureChildren();
Good.
We should probably add more tests (later).
Attachment #455085 -
Flags: review?(bolterbugz) → review+
Assignee | ||
Comment 10•14 years ago
|
||
landed on 1.9.3 (2.0) - http://hg.mozilla.org/mozilla-central/rev/7456a4bfba46
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•