Bug 27176
Summary: | input event should not bubble per spec | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ojan Vafai <ojan> |
Component: | DOM | Assignee: | Erik Arvidsson <arv> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | arv, ian, shadow2531 |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 |
Ojan Vafai
See https://bugs.webkit.org/show_bug.cgi?id=22135#c9.
We'd have to get both Gecko and WebKit (and Opera?) to change here.
I prefer the spec behavior (i.e. not bubbling) as it makes input events cheaper. I don't see great use cases for bubbling oninput. I guess you could have a form that you validate on every input and you could have one input handler for the entire form.
The real question is whether there are sites that currently depend on this behavior.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Erik Arvidsson
Taking
Michael A. Puls II
FWIW, I suggest to make HTML5 match browsers instead.
Also, with <http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events-EventTypes-complete>, most of the value-changing events do bubble.
If 'input' doesn't bubble, then there's no sense in having 'oninput' as a global attribute.
Now, I also don't see much use in 'input' bubbling, but I think it should for consistency and to match current browser behavior. I don't know of any pages that depend on it though (for 'input' at least, maybe 'change').
Also, if one doesn't want the event to bubble, they can just listen at the desired stop point and use stopPropagation().
Would be interesting to fix this and see if it breaks anything though.
Erik Arvidsson
I'm with Michael here. If we change input events to not bubble we should not
have oninput as a global attribute until/if we have input events for
contenteditable.
I think the spec needs to change either way and even though I prefer to have
input not bubble I think it might be more reasonable to make the spec match
what browser actually do and change it to say that input should bubble.
Ian 'Hixie' Hickson
The spec says input and change bubble now.
However, whether they bubble or not, HTML5 makes the event handler attributes uniformly the same on all elements. The idea is to make it far easier to do event handler attributes in implementations -- you only need to put them on the base element (and then handle <body> and <frameset> as special cases) rather than having each element have its own set of event handler attributes.
Ojan Vafai
The spec now matches WebKit. :)