Closed
Bug 751497
Opened 13 years ago
Closed 13 years ago
replace nsHTMLSelectOptionAccessible::GetSelectState by nice inline
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: surkov, Assigned: capella)
References
(Blocks 1 open bug)
Details
(Whiteboard: [good first bug][mentor=hub@mozilla.com][lang=c++])
Attachments
(1 file, 3 obsolete files)
3.84 KB,
patch
|
Details | Diff | Splinter Review |
You could add inline GetSelect() as
if (mParent && mParent->IsListControl()) {
nsAccessible* combobox = mParent->Parent();
return combobox->IsCombobox() ? combobox : mParent;
}
return nsnull;
and then remove GetSelectState
http://mxr.mozilla.org/mozilla-central/source/accessible/src/html/nsHTMLSelectAccessible.cpp#406
please wait until bug 751496 is fixed
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•13 years ago
|
||
Requesting feedback from the mentor for this small technical change ... builds and tests ok on WIN7 machine.
Let me know if you spot anything that needs >help< -- mark
Attachment #622909 -
Flags: feedback?(hub)
Comment 2•13 years ago
|
||
Comment on attachment 622909 [details] [diff] [review]
Patch (v1)
Review of attachment 622909 [details] [diff] [review]:
-----------------------------------------------------------------
::: accessible/src/html/nsHTMLSelectAccessible.h
@@ +138,5 @@
> + nsAccessible* GetSelect() const
> + {
> + if (mParent && mParent->IsListControl()) {
> + nsAccessible* combobox = mParent->Parent();
> + return combobox->IsCombobox() ? combobox : mParent;
I'd check for combobox to be not null as well.
Attachment #622909 -
Flags: feedback?(hub) → feedback+
Assignee | ||
Comment 3•13 years ago
|
||
I notice inline function GetCombobox() in the header file which is pretty much the exact same logic. I'll null check both of them then.
Assignee | ||
Comment 4•13 years ago
|
||
Added null guards ...
Attachment #622909 -
Attachment is obsolete: true
Attachment #622974 -
Flags: review?(surkov.alexander)
Reporter | ||
Comment 5•13 years ago
|
||
Comment on attachment 622974 [details] [diff] [review]
Patch (v2)
Review of attachment 622974 [details] [diff] [review]:
-----------------------------------------------------------------
I'd r+ that if the patch wouldn't add extra perf problems
::: accessible/src/html/nsHTMLSelectAccessible.cpp
@@ +264,5 @@
> // Upcall to nsAccessible, but skip nsHyperTextAccessible impl
> // because we don't want EDITABLE or SELECTABLE_TEXT
> PRUint64 state = nsAccessible::NativeState();
>
> + nsAccessible* selectContent = GetSelect();
don't use 'content' for accessible object name. I'd use 'select'
@@ +281,5 @@
> if (isSelected)
> state |= states::SELECTED;
> }
>
> + if (selectContent->State() & states::OFFSCREEN) {
don't get State() more than once, it's perf
::: accessible/src/html/nsHTMLSelectAccessible.h
@@ +132,5 @@
>
> private:
>
> /**
> + * Return an accessible the option belongs to if any.
"Return a select accessible" otherwise it's ambigious
Attachment #622974 -
Flags: review?(surkov.alexander)
Assignee | ||
Comment 6•13 years ago
|
||
Nits and performance issue addressed, re-built, re-tested locally.
Attachment #622974 -
Attachment is obsolete: true
Reporter | ||
Comment 7•13 years ago
|
||
Comment on attachment 623025 [details] [diff] [review]
Patch (v3)
Review of attachment 623025 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, thank you! Mark, are you going to land it? :)
::: accessible/src/html/nsHTMLSelectAccessible.cpp
@@ +266,5 @@
> PRUint64 state = nsAccessible::NativeState();
>
> + nsAccessible* select = GetSelect();
> + if (!select)
> + return state;
I'd use empty line here
Attachment #623025 -
Flags: review+
Assignee | ||
Comment 8•13 years ago
|
||
Target Milestone: --- → mozilla15
Comment 9•13 years ago
|
||
Sorry, had to back out for compilation failures:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=386fac446673
eg:
https://tbpl.mozilla.org/php/getParsedLog.php?id=11669966&tree=Mozilla-Inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/733897688bed
Target Milestone: mozilla15 → ---
Assignee | ||
Comment 10•13 years ago
|
||
New version due to fails on linux builds ...
push to try: https://tbpl.mozilla.org/?tree=Try&rev=a78ef83ea707
Attachment #623025 -
Attachment is obsolete: true
Assignee | ||
Comment 11•13 years ago
|
||
Try seemed to work for linux, Windows works for me locally ...
Pushing to inbound again...
https://hg.mozilla.org/integration/mozilla-inbound/rev/d17410f2c261
Assignee | ||
Updated•13 years ago
|
Target Milestone: --- → mozilla15
Assignee | ||
Comment 12•13 years ago
|
||
Inbound status:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=d17410f2c261
Comment 13•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•