Open Bug 246720 Opened 16 years ago Updated Last year

xul oncommand attribute isn't parsed when accessed through DOM

Categories

(Core :: DOM: Events, defect, P5)

x86
Windows XP
defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

In bug 246719, I'm trying to make middle-clicking on more elements work, using
code like:
   oncommand="var url = ...; openUILink(url, event);"
   onclick="if(event.button==1) this.oncommand(event);"

If I middle-click an element with this before left-clicking it, I get
"this.oncommand is not a function" and openUILink is not called.  If I
left-click first, it works fine when I middle-click.
Workaround: use eval.  eval(this.getAttribute('oncommand'))

I don't like this workaround because using eval in chrome JS can be dangerous,
and because it's more code than this.oncommand(event).
No longer blocks: 246719
bugzilla-mozilla@dorando.at had the same problem in bug 230401.  Once this is
fixed, the code from bug 230401 and bug 246719 should be changed to not use eval().
*** Bug 284250 has been marked as a duplicate of this bug. ***
Blocks: 88314
Note that we do have a .doCommand but it doesn't take an existing event.
Blocks: 461376
Blocks: 461578
Assignee: events → nobody
QA Contact: ian → events
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.