Closed
Bug 746111
Opened 13 years ago
Closed 13 years ago
Accessible object viewers should be available unconditionally for Accessible Tree viewer
Categories
(Other Applications :: DOM Inspector, defect)
Other Applications
DOM Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
Details
Attachments
(4 files, 3 obsolete files)
|
644 bytes,
text/html
|
Details | |
|
5.46 KB,
image/gif
|
Details | |
|
23.82 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
|
978 bytes,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
the problem, there are accessibles like html:area accessibles that can't be obtained via nsIAccessibleRetieval::getAccessibleFor(areaNode).
Attachment #615679 -
Flags: review?(neil)
Comment 1•13 years ago
|
||
Please can you attach an example document exhibiting the problem?
| Assignee | ||
Comment 2•13 years ago
|
||
try any area accessible
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•13 years ago
|
||
image for imagemap of test
Comment 4•13 years ago
|
||
Comment on attachment 615679 [details] [diff] [review]
patch
Sorry for the delay.
>+ // Retrun true unconditionally since accessibleTree view can't show
>+ // inaccessible DOM node.
>+ if (linkedViewer.uid == "accessibleTree")
>+ return true;
I had a look at this and it appears that it only works because every time you select a DOM node in the accessible tree you update its " accessible " property so that the accessible object viewer can find the accessible object.
So that people know what's going on, I suggest you either modify the code to look for the property directly or modify your comment to indicate that this is how the viewer manages to find the correct accessible object.
While you're modifying your comment, you misspelled "Return" ;-)
| Assignee | ||
Comment 5•13 years ago
|
||
I don't recall if every view sets up " accessible " property, maybe comment would be ok
Comment 6•13 years ago
|
||
(In reply to alexander surkov from comment #5)
> I don't recall if every view sets up " accessible " property, maybe comment
> would be ok
I didn't say that every view did, I was just pointing out that it's not obvious that that's how it works in this case at least.
| Assignee | ||
Comment 7•13 years ago
|
||
apparently [" accessible "] approach doesn't work anymore.
Attachment #615679 -
Attachment is obsolete: true
Attachment #615679 -
Flags: review?(neil)
Attachment #629099 -
Flags: review?(neil)
Comment 8•13 years ago
|
||
(In reply to alexander :surkov from comment #7)
> apparently [" accessible "] approach doesn't work anymore.
Might have been broken by compartment-per-global, perhaps. (Other stuff was.)
Comment 9•13 years ago
|
||
Comment on attachment 629099 [details] [diff] [review]
patch2
>+ return object instanceof Components.interfaces.nsIDOMElement ||
>+ "@mozilla.org/accessibleRetrieval;1" in Components.classes &&
>+ object instanceof Components.interfaces.nsIAccessible &&
>+ object.DOMNode instanceof Components.interfaces.nsIDOMElement;
I wonder whether it's possible to tweak ViewerRegistry so we don't have to repeat this all the time; when you first added accessibility support you added a linkedViewer variable to the filter, you could add another variable, although I'm not sure what would work best. For instance, if you added an accessibleNode variable, then the above would become return (accessibleNode || object) instanceof Components.interfaces.nsIDOMElement;
>+ getBindingURLs(object || object.DOMNode);
This won't work because "object" is always a truthy-value, whether it's an element or an accessible object. (And of course at this point we've forgotten whether accessibility is enabled.)
>+ var accObject = (aObject instanceof nsIAccessible) ?
>+ aObject : accService.getAccessibleFor(aObject);
Nit: ()s not required around instanceof here.
>+ return accessNode || accessNode.DOMNode;
Not sure what this is trying to achieve, see above.
>+ return node ? QIAccessNode(node.accessible) : null;
return node && QIAccessNode(node.accessible);
>+ this.mSubject = aObject instanceof Node ? aObject : aObject.DOMNode;
Mostly we use Components.interfaces.nsIDOMNode in DOM Inspector.
| Assignee | ||
Comment 10•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #9)
> Comment on attachment 629099 [details] [diff] [review]
> patch2
>
> >+ return object instanceof Components.interfaces.nsIDOMElement ||
> >+ "@mozilla.org/accessibleRetrieval;1" in Components.classes &&
> >+ object instanceof Components.interfaces.nsIAccessible &&
> >+ object.DOMNode instanceof Components.interfaces.nsIDOMElement;
> I wonder whether it's possible to tweak ViewerRegistry so we don't have to
> repeat this all the time; when you first added accessibility support you
> added a linkedViewer variable to the filter, you could add another variable,
> although I'm not sure what would work best. For instance, if you added an
> accessibleNode variable, then the above would become return (accessibleNode
> || object) instanceof Components.interfaces.nsIDOMElement;
it's be really nice but it makes the accessible object away from being an object, i.e. we have an object and an accessible object (theoretically not null accessible object may be used with null object), thus we can't say the accessible object is for the object.
| Assignee | ||
Comment 11•13 years ago
|
||
Attachment #629099 -
Attachment is obsolete: true
Attachment #629099 -
Flags: review?(neil)
Attachment #629137 -
Flags: review?(neil)
Comment 12•13 years ago
|
||
Comment on attachment 629137 [details] [diff] [review]
patch3
This works great, except for one minor issue, and that is when you have an accessible panel open on the left, then the JavaScript Object and Accessible Object viewers both display the same thing. (I don't know what's right here.)
>+ var node =
>+ object instanceof Components.interfaces.nsIDOMElement && object ||
>+ "@mozilla.org/accessibleRetrieval;1" in Components.classes &&
>+ object instanceof Components.interfaces.nsIAccessible &&
>+ object.DOMNode instanceof Components.interfaces.nsIDOMElement &&
>+ object.DOMNode;
This might be more readable the other way around i.e.
var node = "@mozilla.org/accessibleRetrieval;1" in Components.classes &&
object instanceof Components.interfaces.nsIAccessible ?
object.DOMNode : object;
if (node instanceof Components.interfaces.nsIDOMElement) {
...
}
Attachment #629137 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 13•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #12)
> Comment on attachment 629137 [details] [diff] [review]
> patch3
>
> This works great, except for one minor issue, and that is when you have an
> accessible panel open on the left, then the JavaScript Object and Accessible
> Object viewers both display the same thing. (I don't know what's right here.)
previously JS object shown DOM node, Accessible Object shown accessible object. After this patch I think we can get rid Accessible Object viewer at all.
Comment 14•13 years ago
|
||
How would you show the accessible object if you were viewing a DOM Node?
| Assignee | ||
Comment 15•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #14)
> How would you show the accessible object if you were viewing a DOM Node?
good point but personally I didn't use js object view for accessible object (except the beginning of times when it was unique available thing :) ). Maybe it's not important after all. Keeping them both when viewing accessible tree is a dupe. So we could keep acc obj viewer for DOM tree viewers.
| Assignee | ||
Comment 16•13 years ago
|
||
make accobj view working
Attachment #629137 -
Attachment is obsolete: true
Attachment #629147 -
Flags: review?(neil)
Comment 17•13 years ago
|
||
Comment on attachment 629147 [details] [diff] [review]
patch4
> setSubject: function JSOVr_SetSubject(aObject)
> {
>- aObject = this.unwrapObject(aObject);
>- this.mSubject = aObject;
>- this.mView = new JSObjectView(aObject);
>+ this.mSubject = this.unwrapObject(aObject);
>+ this.mView = new JSObjectView(this.mSubject);
> this.mTree.view = this.mView;
>
>- this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
>+ this.mObsMan.dispatchEvent("subjectChange", { subject: this.mSubject });
[Not sure what the point of this change is.]
Attachment #629147 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 18•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #17)
> >- this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
> >+ this.mObsMan.dispatchEvent("subjectChange", { subject: this.mSubject });
> [Not sure what the point of this change is.]
just to be consistent with other viewers.
| Assignee | ||
Comment 19•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 20•13 years ago
|
||
I don't like this. It complicates the panel and viewer interfaces.
| Assignee | ||
Comment 21•13 years ago
|
||
(In reply to Colby Russell :crussell from comment #20)
> I don't like this. It complicates the panel and viewer interfaces.
please open a new bug?
Comment 22•13 years ago
|
||
Comment on attachment 629147 [details] [diff] [review]
patch4
>+ <rdf:li>
>+ <rdf:Description
>+ ins:uid="styleRules"
>+ ins:panels="bxObjectPanel bxObjPanel"
>+ ins:description="&styleRules.label;">
>+ <ins:filter><![CDATA[
>+ return object instanceof Components.interfaces.nsIDOMElement ||
>+ object instanceof Components.interfaces.nsIDOMCSSStyleSheet ||
>+ "@mozilla.org/accessibleRetrieval;1" in Components.classes &&
>+ object instanceof Components.interfaces.nsIAccessible &&
>+ object.DOMNode instanceof Components.interfaces.nsIDOMElement;
>+ ]]></ins:filter>
>+ </rdf:Description>
Oops, styleRules accepts nsIDOMCSSStyleSheet...
>diff --git a/resources/content/viewers/styleRules/styleRules.js b/resources/content/viewers/styleRules/styleRules.js
>--- a/resources/content/viewers/styleRules/styleRules.js
>+++ b/resources/content/viewers/styleRules/styleRules.js
>@@ -83,27 +83,28 @@ StyleRulesViewer.prototype =
>
> get subject()
> {
> return this.mSubject
> },
>
> set subject(aObject)
> {
>- this.mSubject = aObject;
>+ this.mSubject = aObject instanceof Components.interfaces.nsIDOMNode ?
>+ aObject : aObject.DOMNode;
...but we fail to check for that here :-(
Updated•13 years ago
|
Blocks: DOMi2.0.13
| Assignee | ||
Comment 23•13 years ago
|
||
Attachment #657757 -
Flags: review?(neil)
Updated•13 years ago
|
Attachment #657757 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 24•13 years ago
|
||
Updated•12 years ago
|
Blocks: DOMi2.0.14
You need to log in
before you can comment on or make changes to this bug.
Description
•