RE: [DOML3Events] Add success/failure boolean to add/removeEventListener?

Sending to the right list...

-----Original Message-----
From: Travis Leithead
Sent: Wednesday, April 09, 2008 1:02 PM
To: 'public-webapi-request@w3.org'; 'Doug Schepers'
Subject: [DOML3Events] Add success/failure boolean to add/removeEventListener?

<thoughts-in-random-order>
I just wanted to send this request to the list to generate some discussion. Today, addEventListener and removeEventListener return 'void' (nothing). In other words, a web-dev cannot know if one of these methods succeeded or not.

Currently the only way for a script to check to see if these succeeded, is to do validation in the EventListener itself. (Fire the event programmatically, ensure that it was fired in the callback.)

The spec does mention that repeated adding of event listeners (with all the same params) is a no-op.

Admittedly, there are fewer use-cases for testing a return value from addEventListener, than there are for removeEventListener.

IE supports a return value from its proprietary attachEvent/detachEvent APIs.

Back compat in scripts is not an issue since these API's never returned a value before--thus scripts will not be checking for return values.
</thoughts-in-random-order>

-Travis

Received on Wednesday, 16 April 2008 18:51:00 UTC