Closed Bug 1844723 Opened 2 years ago Closed 2 years ago

Don't copy `.button` and `.buttons` from `(mouse|pointer)(down|up)` to `(mouse|pointer)(over|enter|out|leave)`

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

CreateMouseOrPointerWidgetEvent() is designed to create mouseenter, mouseover, mouseout, mouseleave, pointerenter, pointerover, pointerout and pointerleave from a source event. They are not button state change events, but the source event may be so. Therefore, if the source event has not been dispatched into the DOM yet, copying button and buttons is wrong. button should be 0 (if mouse events) or -1 (if pointer events), and buttons should be computed with the button.

Component: DOM: UI Events & Focus Handling → DOM: Events

CreateMouseOrPointerWidgetEvent() is designed to create mouseenter,
mouseover, mouseout, mouseleave, pointerenter, pointerover,
pointerout and pointerleave from a source event.

They are not button state change events, but the source event may be so.

According to the WPTs ([1], [2]) and the fact that the other browsers pass the
tests, the button state of pointer events of synthesizing events should be
synchronized with what the web apps notified (i.e., previous state of the
source event) if and only if the input source supports hover state and the
source event which changes a button state has not been dispatched into the DOM
yet.

  1. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_hoverable_pointers.html#44,51,60,63
  2. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_nohover_pointers.html#17,45,47,51

The WPT which was added by the previous patch (D187644) fails if it runs
after mousemove_prevent_default_action.tentative.html because it synthesize
dragstart with synthesizing multiple mouse events, however, mouseup
does not ends the drag session and the following test starts with the session.

The TestDriver finally runs EventUtils. Therefore, we can make it manage
the drag session with XPCOM API.

Note that we should synthesize dragover for mousemove, and drop if
the drop is accepted. However, it requires more work, so we should do it
in a separate bug.

Depends on D187644

After applying the previous patch, inert-pseudo-element-hittest.html starts
failing due to error: Action action_sequence failed if all tests in the
folder runs (i.e., only running the test passes).

If I comment out the last test of insert-iframe-hittest.html, it starts
passing again. It seems that the clean up in the test does not work well
and adding the explicit clean up works.

Depends on D188934

Attachment #9354501 - Attachment is obsolete: true
Attachment #9354500 - Attachment description: Bug 1844723 - Synthesizing `mouseup` during a drag session should end the session r=Edgar!,#dom-core → WIP: Bug 1844723 - Synthesizing `mouseup` during a drag session should end the session r=Edgar!,#dom-core
Attachment #9354500 - Attachment description: WIP: Bug 1844723 - Synthesizing `mouseup` during a drag session should end the session r=Edgar!,#dom-core → Bug 1844723 - Synthesizing `mouseup` during a drag session should end the session r=Edgar!,#dom-core
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/361aedbce3f0 Make `CreateMouseOrPointerWidgetEvent()` set `mButton` to "not pressed" value and compute `mButtons` if the source event has not been dispatched yet r=edgar,dom-core https://hg.mozilla.org/integration/autoland/rev/cebcb0ade13f Synthesizing `mouseup` during a drag session should end the session r=edgar,dom-core,webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42446 for changes under testing/web-platform/tests
Regressions: 1858082
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1858561
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: