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

__defineGetter__ on Event fails in 1.0.3

VERIFIED DUPLICATE of bug 290777

Status

()

Core
DOM
VERIFIED DUPLICATE of bug 290777
13 years ago
5 years ago

People

(Reporter: Charles Eubanks, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0
Build Identifier: 1.0.3

I have IE compatibility code that uses __defineGetter__ on Event this code is 
broken in 1.0.3. I have quite bit of this sort of code (on things other than 
Event as well) so I am looking to understand: 
A) Was this intentionally changed? (I couldn't see anything explicit in the rel 
notes and from my reading of the related bugs (289074 & 289083?) it doesn't seem 
like they should disable this)
B) And if this is really correct then what is the complete nature of the 
nerfing?  I am trying to figure out what exactly I need to change in my code to 
fix this. 

On 1.0.3 the following example shows Error: uncaught exception: [Exception... 
"Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c 
(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: http://localhost:8080/
test/ffbugs/bug1.html :: anonymous :: line 5" data: no] in the console 

<html> 
<head> 
<script type="text/javascript"> 
Event.prototype.__defineGetter__("srcElement", function () { 
return this.target; 
}); 

function doOnCtxt(event){ 
window.alert(event.srcElement.tagName); 
} 
</script> 
</head> 
<body> 
<div style="height:500px;width:500px;position:relative;background-color:blue;
color:red" oncontextmenu="doOnCtxt(event);return false;"> 
right click me! 
</div> 
</body> 
</html>

Reproducible: Always

Steps to Reproduce:
1. run the attached html 
2. right click.


Actual Results:  
nothing.

Expected Results:  
alert should pop up
(Reporter)

Comment 1

13 years ago
Created attachment 182404 [details]
testcase

Updated

13 years ago
Keywords: testcase
Also see
http://groups-beta.google.com/group/netscape.public.mozilla.dom/browse_thread/thread/94fe1dd931b2ac4e

*** This bug has been marked as a duplicate of 290777 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.