Closed Bug 636945 Opened 12 years ago Closed 12 years ago

add downcasting for nsRootAccessible

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access)

Attachments

(1 file)

Attached patch patchSplinter Review
      No description provided.
Attachment #515290 - Flags: review?(bolterbugz)
Attachment #515290 - Flags: approval2.0?
Comment on attachment 515290 [details] [diff] [review]
patch

>-  already_AddRefed<nsRootAccessible> GetRootAccessible();
>+  nsRootAccessible* RootAccessible() const;

Are you sure you prefer the new name?

>+  inline bool IsRoot() const { return mFlags & eRootAccessible; }
>+  nsRootAccessible* AsRoot();

I'd prefer IsRootAccessible, and AsRootAccessible, do you agree it is more clear?
(In reply to comment #1)
> Comment on attachment 515290 [details] [diff] [review]
> patch
> 
> >-  already_AddRefed<nsRootAccessible> GetRootAccessible();
> >+  nsRootAccessible* RootAccessible() const;
> 
> Are you sure you prefer the new name?

in general we don't use Get prefix for getter methods. There are many examples in new code.

> >+  inline bool IsRoot() const { return mFlags & eRootAccessible; }
> >+  nsRootAccessible* AsRoot();
> 
> I'd prefer IsRootAccessible, and AsRootAccessible, do you agree it is more
> clear?

it's more clear, but other Is and As methods don't include Accessible word. I thought about RootDoc but it may confuse with nsRootAccessible class name.
Comment on attachment 515290 [details] [diff] [review]
patch

This should be low risk, but I don't see why we'd want/need to land it now.
Attachment #515290 - Flags: review?(bolterbugz) → review+
(In reply to comment #3)

> This should be low risk, but I don't see why we'd want/need to land it now.

The bug 636945 is based on top on this. I just removed bad things while it safe in terms of risk estimation. I think it's ok to take it to avoid unperf by default things introduction.
perhaps 
RootAccessible -> RootDocument
AsRoot -> AsRootDocument
IsRoot -> IsRootDocument?
Attachment #515290 - Flags: approval2.0? → approval2.0+
landed on 2.0 (fx4rc) - http://hg.mozilla.org/mozilla-central/rev/82aabe4f0c3b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.