Closed Bug 413605 Opened 17 years ago Closed 16 years ago

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

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

Details

(Keywords: late-l10n)

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — Splinter Review
allow to use JS for the selected accessible in the accessibleTree view
Attachment #298671 - Flags: superreview?(neil)
Attachment #298671 - Flags: review?(sdwilsh)
Attached patch patch2 (obsolete) — Splinter Review
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)
Is there a particular reason you're not reusing the existing JS evaluator?
(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 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+
(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.
Attached patch patch3Splinter Review
with Neil's, Shawn's comments
Attachment #298672 - Attachment is obsolete: true
Attachment #299965 - Flags: approval1.9?
(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+
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-
checked in
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
I filed bug 415879 to get unified JS evaluator.
Keywords: late-l10n
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: