[Webkit-unassigned] [Bug 34465] New: DOM events that capture should register to elements that contain a disabled form element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 1 22:22:44 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34465

           Summary: DOM events that capture should register to elements
                    that contain a disabled form element
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: fgasper at freeshell.org


(Copied from Firefox bug report:
https://bugzilla.mozilla.org/show_bug.cgi?id=541110)

If I click on a disabled <input> element, and the "click" listener is
registered on a containing element (say, a <div>) and set to capture, the
containing element should receive the click.

The spec only says that disabled form elements do not receive DOM events; it
doesn’t say that containing elements can’t receive those events on capture. It
seems both counterintuitive and counter-productive for Moz to behave this way;
for the many cases where we *would* want a disabled <input> to receive a click
(e.g. to re-enable the control), a simple solution would be to wrap the <input>
inside a <span>.

It makes sense for *bubble* events to fail in this way, but not for capture.

Reproducible: Always

Steps to Reproduce:
Load this code:

<html>
<body>
<div id="capture_div" style="background-color: lightgreen">
<br />
<br />
<input type="text" value="disabled" disabled="disabled" />
<br />
<br />
</div>
<script type="text/javascript">
document.getElementById('capture_div').addEventListener(
    'click',
    function(e) {
        alert("clicked");
    },
    true
);
</script>
</body>
</html>

-----------
Then, click in the green-colored div, anyplace but over the <input>.
Actual Results:  
After clicking anyplace in the <div> not over the <input>, an alert box
appears. But if you click over the <input>, even though you are still within
the <div> and the event is set to capture (i.e. to go to container elements
first) and registered to the <div>, no alert happens.

Expected Results:  
The alert should pop up after clicking anyplace in the <div>.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list