Remove nsIAccessibilityService::GetAccessible()

RESOLVED FIXED in mozilla16

Status

()

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

People

(Reporter: hub, Assigned: capella)

Tracking

(Blocks: 1 bug)

Trunk
mozilla16
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][mentor=hub@mozilla.com][lang=c++])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
Remove nsIAccessibilityService::GetAccessible() and from nsAccessibiltiyService(). We can do everything with the nsDocAccessible::GetAccessible()

See https://bugzilla.mozilla.org/show_bug.cgi?id=721947#c8
(Reporter)

Updated

5 years ago
Blocks: 389800
I haven't checked how much we use it after the mWeakShell -> mDoc refactor but we seem to use this a bit, so a inline function might be nice.  It might make sense to make it a11y::GetAccessible() or something instead of the service thing.

Updated

5 years ago
Depends on: 726005

Comment 2

5 years ago
we need to check out how many cases we have when we need to do a guess about presshell (document), in some cases we can use normal nsDocAccessible::GetAccessible() like bug 726005.

Updated

5 years ago
Depends on: 726069

Updated

5 years ago
Depends on: 726071

Updated

5 years ago
Depends on: 726072

Updated

5 years ago
Depends on: 726507

Updated

5 years ago
Depends on: 739190

Updated

5 years ago
Depends on: 739193

Updated

5 years ago
Depends on: 739198

Comment 3

5 years ago
after all blockers are fixed we can turn this bug into good first bug

Updated

5 years ago
Whiteboard: [good first bug][mentor=hub@mozilla.com][lang=c++]
(Assignee)

Comment 4

5 years ago
Created attachment 630328 [details] [diff] [review]
Patch (v1)

All prior req's finished, so I thought we could finish this off ... asking for feedback ...
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Attachment #630328 - Flags: feedback?(hub)
(Reporter)

Comment 5

5 years ago
Comment on attachment 630328 [details] [diff] [review]
Patch (v1)

Review of attachment 630328 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/public/nsIAccessibilityService.h
@@ -36,5 @@
> -   * @param  aNode      [in] the DOM node to get an accessible for
> -   * @param  aPresShell [in] the presentation shell which contains layout info
> -   *                         for the DOM node
> -   */
> -  virtual Accessible* GetAccessible(nsINode* aNode,

I think you have to change the implementation ID if you change the implementation.
(I'm not very familiar with the gory details of XPCOM, Trevor knows more)

::: accessible/src/base/nsAccessibilityService.cpp
@@ +649,5 @@
>    if (!node)
>      return NS_ERROR_INVALID_ARG;
>  
> +  DocAccessible* document = GetDocAccessible(node->OwnerDoc());
> +  NS_IF_ADDREF(*aAccessible = document->GetAccessible(node));

document could be nsnull as per the code you remove.
Attachment #630328 - Flags: feedback?(hub) → feedback-
(Assignee)

Comment 6

5 years ago
Created attachment 630371 [details] [diff] [review]
Patch (v2)

I changed the CID ... I think it's safe to always change it, but from what I (don't) understand there are times when it's not strictly required ...

For the null doc situation, I've got the attached patch returning NS_OK vs NS_ERROR_INVALID_ARG ... I think that's correct, but let me know if otherwise ...
Attachment #630328 - Attachment is obsolete: true
(Reporter)

Comment 7

5 years ago
Comment on attachment 630371 [details] [diff] [review]
Patch (v2)

Review of attachment 630371 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/src/base/nsAccessibilityService.cpp
@@ +650,5 @@
>      return NS_ERROR_INVALID_ARG;
>  
> +  DocAccessible* document = GetDocAccessible(node->OwnerDoc());
> +  if (document)
> +    NS_IF_ADDREF(*aAccessible = document->GetAccessible(node));

'nit: add an empty line

also I'm wondering if we shouldn't return an error here if it is NULL.
(Assignee)

Comment 8

5 years ago
Comment on attachment 630371 [details] [diff] [review]
Patch (v2)

Ok - got the nit ... I'll flag surkov and wait for comment re:nsnull and return code...
Attachment #630371 - Flags: review?(surkov.alexander)

Comment 9

5 years ago
(In reply to Hub Figuiere [:hub] from comment #7)

> also I'm wondering if we shouldn't return an error here if it is NULL.

just no accessible, it's ok.

Comment 10

5 years ago
Comment on attachment 630371 [details] [diff] [review]
Patch (v2)

Review of attachment 630371 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
you need f+ since previous patch has f-
Attachment #630371 - Flags: review?(surkov.alexander)
Attachment #630371 - Flags: review+
Attachment #630371 - Flags: feedback?(hub)
(Reporter)

Updated

5 years ago
Attachment #630371 - Flags: feedback?(hub) → feedback+
(Assignee)

Comment 11

5 years ago
Push to TRY:
https://tbpl.mozilla.org/?tree=Try&rev=d517cabab75a
(Assignee)

Comment 12

5 years ago
Push to Inbound
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=35ec6e3cc949
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/35ec6e3cc949
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.