[webkit-dev] how to remove an event listener when the element attribute is removed

Cary Clark caryclark at google.com
Wed Jan 14 08:40:37 PST 2009

When a web page removes the click handler from an element, webkit
leaves the event listener on the event target node. In practice, this
works fine, because the click can't dispatched -- there's no click
handler anymore.

On Android's browser, we draw a focus ring (like the ring Safari draws
when tabbing) around everything that's clickable. If there's no touch
/ mouse interface, it's possible to interact with the whole web page
with directional arrows and a center button.

The clickability of an element is determined by looking for event
listeners -- but in the case described above, the event listener
remains after the onClick() attribute is gone.

Here's a bug that includes a demonstration page, and a proof-of-concept fix:

What's the right way to fix this bug?


More information about the webkit-dev mailing list