Option to fire OnClick event on mouse down.

53 views
Skip to first unread message

A G Systems

unread,
Jun 21, 2024, 1:50:02 PM (12 days ago) Jun 21
to Chromium-discuss
There has recently been some debate about whether UI should operate on mouse down or mouse up, and I realised that web design was the wrong level to be thinking about the problem. For accessibility (and other) reasons we absolutely want to be keeping as much as possible in the OnClick events, and this got me thinking about when OnClick should fire.  The answer needs to handle cases that include mice, touch pads, and touch screens, before you even get into accessibility options. My conclusion was that it should fire when the user wants it to fire, and web designers should not be making any assumptions about how this happens. It should definitely be firing when the user expects it to fire, and only then, so it should be uniform across websites. This strongly points to it wanting to be a browser setting.
My quick search suggested implementing this is a bit out of my depth, as I don't even know where to start on the code base. I would guess it shouldn't be that hard to do, but no real idea. Not even sure if here is the correct place to be posting this. Any thoughts? Even pointing me in the direction of where I need to look to start thinking about creating a patch would be greatly appreciated.

PhistucK

unread,
Jun 21, 2024, 2:02:06 PM (12 days ago) Jun 21
to onelunat...@gmail.com, Chromium-discuss
I will just preface this with this - I doubt such a patch would be accepted, primarily because I think such a deviation from the familiar order of events and consequences of actions would not be compatible with the way web authors have coded their websites against for decades at this point.

With that said, source.chromium.org is a great tool for quickly searching the code base and cross-referencing most things.

I suspect there are two ways this might need to be implemented. One is probably easier than the other.
Easier - if Blink (the rendering engine) is the one which synthesises the click event, you would need to change the event triggering logic in Blink.
Harder - if Chrome is the one which synthesises the click event, you might need to change things in either a common event triggering logic there, or even harder (well, longer, maybe not harder), change things in the platform-specific event triggering logic.
(Even harder - if the operating system triggers the click event on its own, you would have to somehow change the operating system/its assumptions)

If the search tool does not help you at all, come and ask again. :)

PhistucK


On Fri, Jun 21, 2024 at 6:49 PM A G Systems <onelunat...@gmail.com> wrote:
There has recently been some debate about whether UI should operate on mouse down or mouse up, and I realised that web design was the wrong level to be thinking about the problem. For accessibility (and other) reasons we absolutely want to be keeping as much as possible in the OnClick events, and this got me thinking about when OnClick should fire.  The answer needs to handle cases that include mice, touch pads, and touch screens, before you even get into accessibility options. My conclusion was that it should fire when the user wants it to fire, and web designers should not be making any assumptions about how this happens. It should definitely be firing when the user expects it to fire, and only then, so it should be uniform across websites. This strongly points to it wanting to be a browser setting.
My quick search suggested implementing this is a bit out of my depth, as I don't even know where to start on the code base. I would guess it shouldn't be that hard to do, but no real idea. Not even sure if here is the correct place to be posting this. Any thoughts? Even pointing me in the direction of where I need to look to start thinking about creating a patch would be greatly appreciated.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Dave Tapuska

unread,
Jun 21, 2024, 2:05:33 PM (12 days ago) Jun 21
to onelunat...@gmail.com, Chromium-discuss
This is well documented in the UI Events specification. The click event is dispatched after the primary button is released. See https://www.w3.org/TR/uievents/#event-type-click

I'm not sure what you are referring to "recently been some debate whether UI should operate". Is there a specification issue that you can reference? Chromium will not deviate from the specification in this aspect.

dave.

On Fri, Jun 21, 2024 at 1:50 PM A G Systems <onelunat...@gmail.com> wrote:
There has recently been some debate about whether UI should operate on mouse down or mouse up, and I realised that web design was the wrong level to be thinking about the problem. For accessibility (and other) reasons we absolutely want to be keeping as much as possible in the OnClick events, and this got me thinking about when OnClick should fire.  The answer needs to handle cases that include mice, touch pads, and touch screens, before you even get into accessibility options. My conclusion was that it should fire when the user wants it to fire, and web designers should not be making any assumptions about how this happens. It should definitely be firing when the user expects it to fire, and only then, so it should be uniform across websites. This strongly points to it wanting to be a browser setting.
My quick search suggested implementing this is a bit out of my depth, as I don't even know where to start on the code base. I would guess it shouldn't be that hard to do, but no real idea. Not even sure if here is the correct place to be posting this. Any thoughts? Even pointing me in the direction of where I need to look to start thinking about creating a patch would be greatly appreciated.

--
Reply all
Reply to author
Forward
0 new messages