Closed Bug 12602 Opened 25 years ago Closed 25 years ago

CRASH! onLoad() DOM events being cast to GUI events

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: alecf, Assigned: joki)

Details

(Keywords: crash)

I have an onLoad handler, and I was trying to spit out all the members of the
DOM event...and I've found that accessing many of these make it crash or do
wierd stuff:
screenX/screenY/pageX/pageY/clientX/clientY - tries to cast mEvent to a
nsGUIEvent, which it is not => crash
rangeParent, rangeOffset - causes the current javascript function to exit
silently.

to reproduce, just make any XUL with an onload="onLoad(event);" handler, and do
the usual
function onLoad(event) {
  for (var i in event)
    dump("event." + i + " = " + event[i] + "\n");
}
by the way, some of the attributes are completely bogus, like layerX is 0 and
layerY is 71787075... and when I print out the object itself, I get [object
UIEvent] when I think it's really just an [object Event]
Severity: normal → critical
Priority: P3 → P1
Target Milestone: M11
Crashes are all M11/P1/critical.
More event gifts from Vidur and I.
Status: NEW → ASSIGNED
Okay, this is a case of bad bounds checking when querying event attrs which
are not pertinent to the current event.  I'll see if I can lock it down.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Okay, I have the fix for this.  It will be checked in later this evening but
I'm marking this fixed now to get it out of the way.
Adding crash keyword
Keywords: crash
Mass update of qa contact
QA Contact: gerardok → janc
this isn't crashing for me anymore
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.