Re: Should mouse events be triggered on ancestors of disabled elements?

Sorry, for the delay! It took me a bit to find the time to investigate and
reply.

On 4 January 2016 at 09:10, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 1/3/16 12:05 PM, Sebastian Zartner wrote:
>>
>> The event is dispatched on the disabled form element with the disabled
>> form element as target.
>
> OK.  So we're talking about a fundamental change to the core DOM event
> dispatch algorithm here, right?

No, it's the same as you implemented in https://bugzil.la/218093. There the
mouse movement and pointer events are also dispatched on the disabled
element with it as target, right?

>> Firefox only triggers mousemove, mouseover and mouseout events.
>
> And mouseenter, mouseleave, and the equivalent pointer events.  Further,
Firefox triggers event listeners for those on all the elements
> involved, including the disabled form control, not just on ancestors
right?

Right, except that pointer events are not enabled by default yet. (That's
one reason why my previous description was inaccurate. The second one was
that the bug summary wasn't changed to reflect the actual implementation.)

> As in, Firefox doesn't change the core DOM event dispatch algorithm; it
> simply doesn't fire some events in some cases in which one might expect
them
> to fire.

I guess that's also what the other browsers do.

>> Chrome and Opera trigger all events except mouseenter and mouseleave,
>> though not on <button>, <input type="radio"> and <input
>> type="checkbox"> elements.
>> Internet Explorer triggers all events.
>> Edge triggers no events at all. (looks like this has changed since my
last
>> mail)
>
> Given the inaccurate description of the Firefox behavior above, I'd really
> like to understand precisely what the behaviors of those browsers actually
> are...

Taking a JSFiddle[1] for testing I got the following results.
Legend:
'on ancestor' means an event listener is set on an ancestor while
interacting with the disabled form element.
'on form element' means an event listener is set on the form element itself
while interacting with the disabled form element.)


Chrome 47.0 / Opera 34.0

              on ancestor        on form element
pointerenter  not supported      not supported
pointerover   not supported      not supported
pointermove   not supported      not supported
pointerout    not supported      not supported
pointerleave  not supported      not supported
mouseenter    no (not bubbling)  no
mouseover     only text, range,
              textarea inputs
mousemove     only text inputs,  no
              time, date, color,
              range, textarea
mouseout      only text, range,  no
              textarea inputs
mouseleave    no (not bubbling)  no
mousedown     only text inputs,  no
              time, date, color,
              range, textarea
mouseup       only text inputs,  no
              time, date, color,
              range, textarea
click         only text inputs,  no
              time, date, color,
              range, textarea
dblclick      only text inputs,  no
              time, date, color,
              range, textarea
contextmenu   only text inputs,  no
              time, date, color,
              range, textarea


Firefox 44.0b6[2]

              on ancestor        on form element
pointerenter  no (not bubbling)  yes
pointerover   yes                yes
pointermove   yes                yes
pointerout    yes                yes
pointerleave  no (not bubbling)  yes
mouseenter    no (not bubbling)  yes
mouseover     yes                yes
mousemove     yes                yes
mouseout      yes                yes
mouseleave    no (not bubbling)  yes
mousedown     no                 no
mouseup       no                 no
click         no                 no
dblclick      no                 no
contextmenu   no                 no


IE 11:

              on ancestor        on form element
pointerenter  no (not bubbling)  no
pointerover   yes                no
pointermove   yes                no
pointerout    yes                no
pointerleave  no (not bubbling)  no
mouseenter    no (not bubbling)  no
mouseover     yes                no
mousemove     yes                no
mouseout      yes                no
mouseleave    no (not bubbling)  no
mousedown     yes                no
mouseup       yes                no
click         yes[3]             no
dblclick      yes                no
contextmenu   yes                no


Edge 25:

              on ancestor        on form element
pointerenter  no (not bubbling)  no
pointerover   no                 no
pointermove   no                 no
pointerout    no                 no
pointerleave  no (not bubbling)  no
mouseenter    no (not bubbling)  no
mouseover     no                 no
mousemove     no                 no
mouseout      no                 no
mouseleave    no (not bubbling)  no
mousedown     no                 no
mouseup       no                 no
click         no                 no
dblclick      no                 no
contextmenu   no                 no

Sebastian

[1] https://jsfiddle.net/6kdu1pkh/
[2] Having the preference dom.w3c_pointer_events.enabled set to true
[3] click event is only sent on input type radio and checkbox when
double-clicking

Received on Friday, 8 January 2016 18:08:39 UTC