Closed Bug 567968 Opened 14 years ago Closed 12 years ago

show role and name of event accessible target in event list

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — Splinter Review
      No description provided.
Attachment #447285 - Flags: superreview?(neil)
Attachment #447285 - Flags: review?(Sevenspade)
Comment on attachment 447285 [details] [diff] [review]
patch

>+  var role = "";
>+  try {
>+    role = this.mAccService.getStringRole(accessible.role);
>+  }
>+  catch (e) {
>+  }
I don't think this can throw, can it?

>+  var name = "";
>+  try {
>+    name = accessible.name;
>+  }
>+  catch (e) {
>+  }
Is this likely to throw? As far as I can tell it can throw for nodes in deleted documents, but such nodes are unlikely to receive accessible events ;-)
(In reply to comment #1)

> I don't think this can throw, can it?
> Is this likely to throw? 
> As far as I can tell it can throw for nodes in deleted
> documents, but such nodes are unlikely to receive accessible events ;-)

It shouldn't but sometimes it happens because of wrong a11y invalidation code, so that we still keep an accessible to fire an accessible event but it was shutdown by related invalidation already.
(In reply to comment #2)
> It shouldn't but sometimes it happens because of wrong a11y invalidation code,
> so that we still keep an accessible to fire an accessible event but it was
> shutdown by related invalidation already.
Ah, so if you're worried about the accessible having been shut down then you only need the one try/catch for both statements (since if the first fails then the second would anyway).

I can't apply this to any of my trees, does it depends on another patch?
(In reply to Colby Russell :crussell from comment #4)
> Bug 553364 obviates this, right?

no, bug 553364 is landed, it's time for review ;)
Comment on attachment 447285 [details] [diff] [review]
patch

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

r=me with one try…catch as in comment 3 and a comment added explaining why.
Attachment #447285 - Flags: review?(Sevenspade) → review+
Attached patch patch2 (obsolete) — Splinter Review
try/catch is not needed nowdays (I think starting from Firefox4)
Attachment #447285 - Attachment is obsolete: true
Attachment #570456 - Flags: superreview?(neil)
Attachment #447285 - Flags: superreview?(neil)
(In reply to alexander surkov from comment #7)
> try/catch is not needed nowdays (I think starting from Firefox4)

(Gecko 2 is not yet the minimum supported version required by DOM Inspector)
Keywords: access
Attached patch patch3Splinter Review
get back try/catch blocks for backward compatibility
Attachment #570456 - Attachment is obsolete: true
Attachment #595653 - Flags: superreview?(neil)
Attachment #570456 - Flags: superreview?(neil)
Comment on attachment 595653 [details] [diff] [review]
patch3

>+  var id = (node.nodeType == kElementNode) ? node.id : "";
Only HTML and XUL elements have IDs, so you can't use this test.

>+  var role = "";
>+  try {
>+    // may fail prior Gecko 2.0
>+    role = this.mAccService.getStringRole(accessible.role);
>+  } catch(e) {
>+  }
>+  var name = "";
>+  try {
>+    name = accessible.name; // may fail prior Gecko 2.0
>+  } catch(e) {
>+  }
Do you know what causes it to fail prior to Gecko 2.0? Are the causes the same for each block or different?

>+    id: id,
id: node.id || "",
perhaps?
(In reply to neil@parkwaycc.co.uk from comment #10)

> Do you know what causes it to fail prior to Gecko 2.0? Are the causes the
> same for each block or different?

I think they should be same, do you want me to put them into single try/catch?

> >+    id: id,
> id: node.id || "",
> perhaps?

yep, I will do this
(In reply to alexander surkov from comment #11)
> (In reply to comment #10)
> > Do you know what causes it to fail prior to Gecko 2.0? Are the causes the
> > same for each block or different?
> I think they should be same, do you want me to put them into single
> try/catch?
Yes please.
Comment on attachment 595653 [details] [diff] [review]
patch3

With changes as discussed.
Attachment #595653 - Flags: superreview?(neil) → superreview+
landed with Neil's comments addressed http://hg.mozilla.org/dom-inspector/rev/542c6027c9c0
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.

Attachment

General

Created:
Updated:
Size: