JS event object properties are wrong for <titledbutton> onclick handler

VERIFIED FIXED in M13

Status

()

P3
normal
VERIFIED FIXED
19 years ago
10 years ago

People

(Reporter: law, Assigned: joki)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
If I examine the event object inside a <titledbutton> onclick handler, its
properties do not seem to have the correct values.  Here is what I get when
clicking on the browser reload button with no keys pressed:

event.charCode=0
event.keyCode=0
event.altKey=false
event.ctrlKey=true
event.shiftKey=true
event.metaKey=true
event.screenX=142
event.screenY=158
event.clientX=117
event.clientY=61
event.button=1
event.clickCount=1
event.relatedNode=null
event.view=?
event.detail=?
event.layerX=117
event.layerY=61
event.pageX=117
event.pageY=61
event.which=1
event.rangeParent=[object XULElement]
event.rangeOffset=2
event.cancelBubble=false
event.isChar=false
event.type=click
event.target=[object XULElement]
event.currentNode=null
event.eventPhase=0
event.bubbles=?
event.cancelable=?

Here's the output when the shift key is held down while clicking.  Note that
event.altKey has changed from false to true (so maybe it's just a simple error
mapping from some mask bits to properties, except for the fact that the
ctrl/meta key flags are true and probably should be false):

event.charCode=0
event.keyCode=0
event.altKey=true
event.ctrlKey=true
event.shiftKey=true
event.metaKey=true
event.screenX=140
event.screenY=158
event.clientX=115
event.clientY=61
event.button=1
event.clickCount=1
event.relatedNode=null
event.view=?
event.detail=?
event.layerX=115
event.layerY=61
event.pageX=115
event.pageY=61
event.which=1
event.rangeParent=[object XULElement]
event.rangeOffset=2
event.cancelBubble=false
event.isChar=false
event.type=click
event.target=[object XULElement]
event.currentNode=null
event.eventPhase=0
event.bubbles=?
This output was produced by applying this patch in
mozilla/xpfe/browser/resources/content:

Index: navigator.js
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.js,v
retrieving revision 1.79
diff -w -r1.79 navigator.js
782c782,791
<   function BrowserReallyReload(reloadType) {
---
>   function BrowserReallyReload(reloadType,event) {
> for ( prop in event ) {
>     var value;
>     try {
>         value = event[ prop ];
>     } catch (e) {
>         value = "?"
>     }
>     dump( "event."+prop+"="+value+"\n" );
> }
Index: navigator.xul
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.xul,v
retrieving revision 1.118
diff -w -r1.118 navigator.xul
333c333
<       <titledbutton id="reload-button" class="button32" crop="right" align="to
p" observes="canReload"/>
---
>       <titledbutton id="reload-button" class="button32" crop="right" align="to
p" onclick="BrowserReallyReload(0,event);"/>
(Reporter)

Updated

19 years ago
Blocks: 21137
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
Target Milestone: M13
(Assignee)

Comment 1

19 years ago
Yes, unfortunately this seems to be true.  The flags are correct on the
mousedown/up but are not being correctly passed through to the click event.
It'll take 3 seconds to fix but unfortunately will probably wait until M13 to
go in.
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

19 years ago
Checked in fix.

Updated

19 years ago
Keywords: verifyme

Comment 3

18 years ago
Mass update:  changing qacontact to ckritzer@netscape.com
QA Contact: janc → ckritzer

Comment 4

18 years ago
Updating QA Contact.
QA Contact: ckritzer → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok

Comment 6

17 years ago
QA contact updated
QA Contact: gerardok → madhur

Comment 7

17 years ago
verified on build 2001-08-06-trunk
Status: RESOLVED → VERIFIED

Updated

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