The default bug view has changed. See this FAQ.

remove nsIAccessible getAccessibleToRight/Left/Above/Below

RESOLVED FIXED in mozilla9

Status

()

Core
Disability Access APIs
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: surkov, Assigned: marco)

Tracking

(Blocks: 1 bug, {access})

Trunk
mozilla9
access
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 5 obsolete attachments)

(Reporter)

Description

6 years ago
They weren't ever implemented. MSAA part (NAVDIR_RIHGT and etc) relies on them but I didn't ever hear anybody needs 'em.

Jamie, do you know anything?
Created attachment 556422 [details] [diff] [review]
Patch

I think there isn't need to change the uuid, as it's already changed for bug 675870. Am I right?
Assignee: nobody → mar.castelluccio
Status: NEW → ASSIGNED
Attachment #556422 - Flags: review?(surkov.alexander)
OS: Mac OS X → All
Hardware: x86 → All

Comment 2

6 years ago
You should change the uuid whenever the vtable of an IDL interface implementer would change (such as adding/removing/modifiying functions in the interface).
Created attachment 556428 [details] [diff] [review]
Patch v2

Changed uuid.
Attachment #556422 - Attachment is obsolete: true
Attachment #556428 - Flags: review?(surkov.alexander)
Attachment #556422 - Flags: review?(surkov.alexander)
Comment on attachment 556428 [details] [diff] [review]
Patch v2

>-    case NAVDIR_DOWN:
>-      xpAccessibleStart->GetAccessibleBelow(getter_AddRefs(xpAccessibleResult));
>-      break;

you still need to handle these cases by returning E_NOTIMPl,  I'd also like to see this switch statement have a default case which should probably return E_INVALIDARG.

also, you didn't remove the implementations of the xpcom methods.
Created attachment 556434 [details] [diff] [review]
Patch v3
Attachment #556428 - Attachment is obsolete: true
Attachment #556434 - Flags: review?(trev.saunders)
Attachment #556428 - Flags: review?(surkov.alexander)
Comment on attachment 556434 [details] [diff] [review]
Patch v3


Thanks for working on this, this looks correct, but fixing this bug allows some more cleanup.

>   nsCOMPtr<nsIAccessible> xpAccessibleResult;

I don't think we need to use that anymore, you should be able to have nsAccessible* instead.  (please rename xpAccessibleResult while your here).  Doing this will also let you use nsAccessible::Next/Prev/First/Last Child() instead of the xpcom method.

>     case NAVDIR_DOWN:
>-      xpAccessibleStart->GetAccessibleBelow(getter_AddRefs(xpAccessibleResult));
>-      break;
>+      return E_NOTIMPL;

I'd suggest collecting these four cases so you can use falling through cases like this

case DOWN:
case LEFT:
  return E_NOTIMPL;

(I'm not a peer so passing review request to Alex)
Attachment #556434 - Flags: review?(trev.saunders) → review?(surkov.alexander)
(Reporter)

Comment 7

6 years ago
(In reply to Trevor Saunders (:tbsaunde) from comment #6)

> >   nsCOMPtr<nsIAccessible> xpAccessibleResult;
> 
> I don't think we need to use that anymore, you should be able to have
> nsAccessible* instead.  (please rename xpAccessibleResult while your here). 
> Doing this will also let you use nsAccessible::Next/Prev/First/Last Child()
> instead of the xpcom method.

true, code snippet:

nsAccessible* navAccessible = nsnull;
switch (navDir) {
  case NAVDIR_FIRSTCHILD:
    navAccessible = xpAccessibleStart->FirstChild();
    break;
}

if you rename 'xpAccessibleResult' to 'navAccessible' then it makes sense to rename 'xpAccessibleStart' to 'accessible' as well.

> I'd suggest collecting these four cases so you can use falling through cases
> like this
> 
> case DOWN:
> case LEFT:
>   return E_NOTIMPL;

correct, oleacc.h defines these variables the following way:

#define NAVDIR_DOWN 2
#define NAVDIR_FIRSTCHILD 7
#define NAVDIR_LASTCHILD 8
#define NAVDIR_LEFT 3
#define NAVDIR_NEXT 5
#define NAVDIR_PREVIOUS 6
#define NAVDIR_RIGHT 4
#define NAVDIR_UP 1

so you should keep them together to make sure switch is optimized.

> (I'm not a peer so passing review request to Alex)

It's totally ok if you do review for this patch. Thank you for doing this, Trevor.
(Reporter)

Updated

6 years ago
Attachment #556434 - Flags: review?(surkov.alexander) → review?(trev.saunders)
Created attachment 557724 [details] [diff] [review]
Patch v4

Made the needed changes, I couldn't try to compile because of a problem, but it should work.
Attachment #556434 - Attachment is obsolete: true
Attachment #557724 - Flags: review?(trev.saunders)
Attachment #556434 - Flags: review?(trev.saunders)
Comment on attachment 557724 [details] [diff] [review]
Patch v4

nit, 
>+  nsAccessible *accessible = GetXPAccessibleFor(varStart);

nit, I'd just assume you didn't change that, but I suspect Alex will kill me or something if I don't tell you to do nsAccessible *accessible -> nsAccessible* accessible ;)

>+  if (!accessible || IsDefunct())

oops, looks like I didn't fix bug 678189 quiet right, that should be accessible->IsDefunct() not  just IsDefunct()

>       break;
>+
>+    default:

nit, I'm not sure I'd put a blank line there, but whatever.

>   if (xpRelation) {
>     Relation rel = RelationByType(xpRelation);
>-    xpAccessibleResult = rel.Next();
>+    navAccessible = rel.Next();

we don't really need that local var for anything do we Alex?   I think we could just do RelationByType(type).Next() here.

r=me with the IsDefunct() thing fixed
Attachment #557724 - Flags: review?(trev.saunders) → review+
(Reporter)

Comment 10

6 years ago
(In reply to Trevor Saunders (:tbsaunde) from comment #9)
> Comment on attachment 557724 [details] [diff] [review]
> Patch v4
> 
> nit, 
> >+  nsAccessible *accessible = GetXPAccessibleFor(varStart);
> 
> nit, I'd just assume you didn't change that, but I suspect Alex will kill me
> or something if I don't tell you to do nsAccessible *accessible ->
> nsAccessible* accessible ;)

after you promised that they will be fixed automatically during architecture reorgs I'm resistant to keep nits like this :)

> >   if (xpRelation) {
> >     Relation rel = RelationByType(xpRelation);
> >-    xpAccessibleResult = rel.Next();
> >+    navAccessible = rel.Next();
> 
> we don't really need that local var for anything do we Alex?   I think we
> could just do RelationByType(type).Next() here.

maybe we need it because I assume casting magic wouldn't happen and non const Next() is called on const object.
Created attachment 557792 [details] [diff] [review]
Patch v5

Fixed the IsDefunct() call.
Attachment #557724 - Attachment is obsolete: true
Attachment #557792 - Flags: review?(trev.saunders)
Comment on attachment 557792 [details] [diff] [review]
Patch v5

tHANKS FOR CLEANING ALL THIS UP!
Attachment #557792 - Flags: review?(trev.saunders) → review+
Keywords: checkin-needed
In my queue :-)
https://tbpl.mozilla.org/?usebuildbot=1&tree=Try&rev=feaf94ae787f
Flags: in-testsuite-
Keywords: checkin-needed
Version: unspecified → Trunk
Failed try:
https://tbpl.mozilla.org/php/getParsedLog.php?id=6275374

{
e:/builds/moz2_slave/try-w32/build/accessible/src/msaa/nsAccessibleWrap.cpp(835) : error C2039: 'PreviousSibling' : is not a member of 'nsAccessible'
        e:\builds\moz2_slave\try-w32\build\accessible\src\base\nsAccessible.h(98) : see declaration of 'nsAccessible'
}
(Reporter)

Comment 15

6 years ago
(In reply to Ed Morley [:edmorley] from comment #14)

> e:/builds/moz2_slave/try-w32/build/accessible/src/msaa/nsAccessibleWrap.
> cpp(835) : error C2039: 'PreviousSibling' : is not a member of 'nsAccessible'

should be PrevSibling()
Created attachment 558260 [details] [diff] [review]
Patch v6

Corrected PreviousSibling in PrevSibling.
Attachment #557792 - Attachment is obsolete: true
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=b696a6f86a9b

:-)
http://hg.mozilla.org/integration/mozilla-inbound/rev/b38795f5d13b
Target Milestone: --- → mozilla9
http://hg.mozilla.org/mozilla-central/rev/b38795f5d13b
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.