If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

allow to use JS for the selected accessible in the accessibleTree view

RESOLVED FIXED

Status

Other Applications
DOM Inspector
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

({late-l10n})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

10 years ago
Created attachment 298671 [details] [diff] [review]
patch

allow to use JS for the selected accessible in the accessibleTree view
Attachment #298671 - Flags: superreview?(neil)
Attachment #298671 - Flags: review?(sdwilsh)
(Assignee)

Comment 1

10 years ago
Created attachment 298672 [details] [diff] [review]
patch2
Attachment #298671 - Attachment is obsolete: true
Attachment #298672 - Flags: superreview?(neil)
Attachment #298672 - Flags: review?(sdwilsh)
Attachment #298671 - Flags: superreview?(neil)
Attachment #298671 - Flags: review?(sdwilsh)

Comment 2

10 years ago
Is there a particular reason you're not reusing the existing JS evaluator?
(Assignee)

Comment 3

10 years ago
(In reply to comment #2)
> Is there a particular reason you're not reusing the existing JS evaluator?
> 

it has a bit different logic. JS evaluator evaluates JS expression and shows the result in new window. Here I need more than just expression. I need to evaluate JS script (several expressions). Therefore proposed evalJSDialog uses multiline textbox to  type script and has output window to write results.

Comment 4

10 years ago
Comment on attachment 298672 [details] [diff] [review]
patch2

Well, I still think I'd prefer a unified evaluator, and I also think it might be helpful to output the result by default (unless it is undefined).

>+  return node.accessible;s
Stray s?

>+function execute()
>+{
>+  if (!gAcc)
>+    return;
How can this be true?

>+  try {
>+    var f = Function("accessible", expr);
>+    var result = f(gAcc);
>+      
>+    } catch (ex) {
>+      output(ex);
>+    }
Funky indentation.

>Index: extensions/inspector/resources/locale/jar.mn
Don't forget to update ALL_LOCALES.

>+  <!ENTITY btnEvaluateJS.label "Evaluate">
>+  <!ENTITY btnEvaluateJS.accesskey "e">
>+  
>+  <!ENTITY txtInputArea.label "Input Area (use 'accessible' variable to operate with the selected accessible and 'output' function to write into 'Output Area' window): ">
>+  <!ENTITY txtInputArea.accesskey "i">
>+  <!ENTITY txtOutputArea.label "Output Area: ">
>+  <!ENTITY txtOutputArea.accesskey "o">
All accesskeys should be uppercase to match their labels.
Attachment #298672 - Flags: superreview?(neil) → superreview+
Comment on attachment 298672 [details] [diff] [review]
patch2

s/application\/x-javascript/application\/javascript/g

>+/**
>+ * Return accessible of the tree node pointed by the given
>+ * row index.
>+ *
>+ * @param aRow - row index.
nit:
@param aRow
       The row index to get the accessible from.
@returns ...

locales break the build system - so remove everything but english from the Makefile.

r=sdwilsh
Attachment #298672 - Flags: review?(sdwilsh) → review+
(Assignee)

Comment 6

10 years ago
(In reply to comment #4)
> (From update of attachment 298672 [details] [diff] [review])
> Well, I still think I'd prefer a unified evaluator, and I also think it might
> be helpful to output the result by default (unless it is undefined).

I would like to have the unique evaluator though I'm not sure how the combined one should looks. I'll file following up bug for this.
(Assignee)

Comment 7

10 years ago
Created attachment 299965 [details] [diff] [review]
patch3

with Neil's, Shawn's comments
Attachment #298672 - Attachment is obsolete: true
Attachment #299965 - Flags: approval1.9?
(Assignee)

Comment 8

10 years ago
(In reply to comment #4)

> >+function execute()
> >+{
> >+  if (!gAcc)
> >+    return;
> How can this be true?

it can't be true actually until someone another open the dialog and forget to pass argument. It's just additional protection. But if you would like to remove it then I will.
Comment on attachment 299965 [details] [diff] [review]
patch3

a1.9+=damons
Attachment #299965 - Flags: approval1.9? → approval1.9+
(Assignee)

Updated

10 years ago
Attachment #299965 - Flags: approval1.9b3?
Comment on attachment 299965 [details] [diff] [review]
patch3

not necessary for b3, can land when we reopen
Attachment #299965 - Flags: approval1.9b3? → approval1.9b3-
(Assignee)

Comment 11

10 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Assignee)

Comment 12

10 years ago
I filed bug 415879 to get unified JS evaluator.

Updated

10 years ago
Keywords: late-l10n
You need to log in before you can comment on or make changes to this bug.