About events in WebCore
Hi, I've been working to add support for the checkValidity() method on (#27452); in order to complete that check I need to understand whether or not a specific event (invalid), previously fired from an element, has been canceled. Now, is there any generic/trivial way to accompish such checks? I don't like the idea to reinvent the wheel if there already is something.:) Thank you. -- Bye, Michelangelo
On Aug 18, 2009, at 5:46 PM, Michelangelo De Simone wrote:
Hi,
I've been working to add support for the checkValidity() method on (#27452); in order to complete that check I need to understand whether or not a specific event (invalid), previously fired from an element, has been canceled.
Now, is there any generic/trivial way to accompish such checks? I don't like the idea to reinvent the wheel if there already is something.:)
If by canceled you mean "preventDefault" has been called on the event, then you can tell by the return value from dispatchEvent(). dispatchEvent will return false if any of the event listeners called preventDefault() on the event in the course of dispatch. Regards, Maciej
If by canceled you mean "preventDefault" has been called on the event, then you can tell by the return value from dispatchEvent(). dispatchEvent will return false if any of the event listeners called preventDefault() on the event in the course of dispatch.
That's exactly what I was looking for. Thank you. -- Bye, Michelangelo
participants (2)
-
Maciej Stachowiak
-
Michelangelo De Simone