Bug 192621
Summary: | messed up scope in eventHandler | ||
---|---|---|---|
Product: | WebKit | Reporter: | g. papa <etasho> |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Major | CC: | ap, cdumez |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
g. papa
On Chrome 71 (not on any Chrome before), if an element (select, button) has an inline onclick event with the id (of the element) specified as a parameter of the called function AND this element has children elements, the scope gets messed up and it tries to take the id of the child element.
<select id="myselect" onclick="jsDoSomething(id)"><option>1</option><option>2</option></select>
function jsDoSomething(id) {
alert(id);
}
Stackoverflow report: https://stackoverflow.com/questions/53740067/chrome-71-does-not-detect-id-in-an-onclick-event-unless-its-this-id/53740954?noredirect=1#comment94335519_53740954
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Chrome has forked WebKit many years ago, so new bugs that appear there are Google's own.
WebKit doesn't appear to even send a click event for selects, as I don't get any alert even after adding <script> around the code.