On Wed, 21 Aug 2013 16:21:25 +0200, Brian Chirls <[email protected]> wrote:

Okay, that is much more clear. Thank you.

Yes, I think adding information to the click event is a great approach.
Event objects often have additional information, like mouse coordinates or key code, so it wouldn't feel like an unusual or special case. The previous approach removes information, where this one adds it. Let's not forget that
the same information should apply to touch and hover events as well.

Although, how would you handle the case where a user clicks the mouse down
on the play button, drags it off the play button and then on to, say, the
fullscreen button before letting go?

What happens when you do that? If nothing happens, it seems like controlsTarget should return null.

What about an enum-esque integer constant instead of a string? Like
HTMLMediaElement.PLAY_BUTTON, etc.

Integer constants are usually avoided for new stuff.

It's worth thinking about whether this can/should be generalized to all
elements that have sub-controls. For example, a number input has those
little up and down buttons.

Let's start from use cases instead of feature creeping a solution for one thing to all other things that have similar shape. I'd rather simplify controlsTarget to be a boolean since that also addresses the problem at hand.

--
Simon Pieters
Opera Software

Reply via email to