Closed
Bug 278828
Opened 20 years ago
Closed 20 years ago
".on[eventtype]" - Events don't work with designmode set to "on"
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: simon.sattes, Unassigned)
Details
Attachments
(1 file)
|
1.24 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.5) Gecko/20041108 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.5) Gecko/20041108 Firefox/1.0
If designmode is enabled for an iframe, attaching an event like
"contentWindow.onkeypress"(or any other event) to the content of this iframe
doesn't work, although it's correctly assigned, which can be checked by throwing
an alert with the event. Setting events by "AddEventListener("keypress"...)
*does* work though.
I'll add a code snippet.
Reproducible: Always
Steps to Reproduce:
1. assigning event contentWindow.onkeypress
2. setting designmode for the iframe to "on"
Actual Results:
The event is not fired although it's there.
Expected Results:
Event should be fired.| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
<script> execution and compilation of event handler attributes is disabled in HTML that is being edited, since you typically do not want scripts running as you type them in.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 3•20 years ago
|
||
If you were right, then the event assigned with "AddEventListener" shouldn't work, too (but it does as I wrote above).
Comment 4•20 years ago
|
||
reopening -- seems like window.onfoo and window.addEventListener('foo') should
act equivalently, no?Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 5•20 years ago
|
||
As I said in comment 2, what's disabled is <script> execution and compilation of event handlers. If an already-compiled listener is added (which is what addEventListener does), it will work. We want this -- eg we want to be able to add chrome listeners to document being edited. Also see next paragraph. Ian, your two examples in comment 4 add listeners compiled against different scopes and running in different security contexts. So no, they are not equivalent.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → INVALID
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•