Closed Bug 254403 Opened 20 years ago Closed 19 years ago

In designMode, event listeners doesn't fire events on some form elements (checkbox,radio,select ...)

Categories

(Core :: DOM: Editor, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED EXPIRED

People

(Reporter: heikki, Assigned: mozeditor)

Details

(Whiteboard: midas)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707

When designMode is on, document's eventListeners cannot fire events for
checkboxes,radiobuttons,dropdown and selects. If designMode is not defined to
on, eventListener work fine. Below is example, where clicking of element should
fire an alert of element's nodename:
<HEAD>
<script>
function load() {
     document.designMode="on";
     document.addEventListener("click", l_func,true);
 
  }

function l_func(e){
alert(e.target.nodeName);
}
</script>
</HEAD>
<BODY onload="load();">
<form>
<input type=text value="" name=test>
<span id="testit">aa bb</span>
<INPUT ID="testradio" TYPE="radio" VALUE="1">
<span id=oTarget2>
<INPUT name="testbox" TYPE="checkbox" VALUE="2">
</span>
<select id="oTarget3">
<option value=jep>jep</option>
<option value=jap>jap</option>
</select>
<textarea name="testarea"></textarea>
</form>
</BODY>

Reproducible: Always
Steps to Reproduce:
1. Copy example code on your computer, save as test.html
2. Open test.html to your browser
3. Click elements in page.

Actual Results:  
When element is clicked, alert is fired for ordinary input field, textarea,
document and spans, but not for checkbox and radiobutton.

Expected Results:  
Alert should be fired for all elements in page, when clicked
(In reply to comment #0)
When testing example code, please notice that there is another bug when
refreshing page where designMode=on. Design mode doesn't go to off and no events
work at all. To reproduce how code works with designMode=off, the browser window
must be closed and then reopened with changed code. 
Editor probably suppresses these so you won't toggle the checkboxes and radios
and such...  but it should be preventing the default action, not eating the
event altogether.
Assignee: events → mozeditor
Component: DOM: Events → Editor: Core
QA Contact: ian → bugzilla
(In reply to comment #2)
Yeah. And there is some inconsistency in preventing default action, too:
for example, even if designMode=on, if there is file field in editable area,
file field's 'browse' button opens file browser window when clicked. And
sometimes you can write to textboxes and textareas. Sometimes cursor cannot be
put in these fields. Sometimes arrow keys or home or end keys move the cursor
into textboxes or texareas, sometimes not.
(In reply to comment #3)
By the way, I tried to edit example html (above) with Composer, too, and found
that Composer doesn't open Form Fields Properties for checkboxes, radiobuttons,
selectionlists either. 

Whiteboard: midas
Attachment #155667 - Attachment description: testcase → testcase (open in new window, if you don't want your browser to treat every page editable afterwards)
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: