commit | 785113a0d0ebb423cfa7d7041e5a1452e07e6b5c | [log] [tgz] |
---|---|---|
author | Masayuki Nakano <masayuki@d-toybox.com> | Wed Jan 24 11:25:17 2024 |
committer | moz-wptsync-bot <wptsync@mozilla.com> | Wed Jan 24 23:02:04 2024 |
tree | 1d1d768caf2a2f3174a46ca0802c41907d4f70e5 | |
parent | 0a8ff7c96ca38b3f7f7846aa777eef1fd6fd12b8 [diff] |
Make `PresShell` flush pending synthetic `mousemove` before dispatching `mousedown` or `mouseup `inert-iframe-hittest.html` expects that `:hover` state should be updated immediately after a pointer down. The state is updated by `EventStateManager::NotifyMouseOver` [1] when we received a real or synthetic `eMouseMove`. Therefore, the hover state may have not set yet if no refresh occurs between the pointer down and checking the result. Additionally, some WPT for UI Events and Pointer Events expect that `mouseover` or `mouseout` should be fired before `mouseup`/`pointerup` if a preceding `mousedown` or `pointerdown` event listener removes the target. So, this patch may fix intermittent failures of them if there are. Therefore, we should flush pending synthetic `mousemove` event for keeping the event order as same as they happen. However, simply flushing it causes unexpected pointer capture state change because `PointerEventHandler::ProcessPointerCaptureForMouse` handles synthetic `mousemove` but it should not cause pointer boundary events at the moment (the pointer boundary events should be fired when the pointer is actually moved, note that this is different rule from the rules of mouse boundary events). Therefore, this patch changes `PointerEventHandler::ShouldGeneratePointerEventFromMouse`. However, this blocks `lostpointercatpure` event when the capturing content has already been removed from the DOM tree. The path is, `EventHandler::HandleEventWithPointerCapturingContentWithoutItsFrame` stops dispatching `pointerup` nor `pointercancel` in this case, but `EventStateManager::PostHandleEvent` is the only handler of implicit pointer capture release. Therefore, we need to make it dispatch lostpointercatpure` event if the canceling event caused `ePointerUp` or `ePointerCancel`. Finally, this patch fixes a bug of `browser_ext_browserAction_popup_preload.js`. It tests the pre-loading which starts when `mouseover` before `mousedown` on a widget. However, it does not correctly emulate the user input. * Synthesizing only `mouseover` does not update the internal pointer info and does not cause dispatching related events. * Synthesizing `mousedown` without `mousemove` cause `mouseover` before `mouseup` because at dispatching `mousedown`, `PresShell` stores the cursor [2] and the mouse boundary events will be dispatched before `mouseup`. `ext-browserAction.js` assumes the events are fired as this order, `mouseover` -> `mousedown` -> `mouseup`, but this would not work if the preceding `mousemove` of `mousedown` is not correctly fired. I'm not sure whether `mousemove` is always fired before `mousedown` on any environments, but it should be rare and it affects only this kind of tricky code. For now, fixing this in the test side must be enough. 1. https://searchfox.org/mozilla-central/rev/9a5bf21ea2dd04946734658f67f83f62ca76b0fa/dom/events/EventStateManager.cpp#4874,4913-4914 2. https://searchfox.org/mozilla-central/rev/9a5bf21ea2dd04946734658f67f83f62ca76b0fa/layout/base/PresShell.cpp#6756 Differential Revision: https://phabricator.services.mozilla.com/D193870 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1864654 gecko-commit: 5e411c1e0424f542714c947b1c82020e13e211a9 gecko-reviewers: smaug, dom-core, extension-reviewers, edgar, robwu
The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.
The most important sources of information and activity are:
wpt:matrix.org
matrix channel; includes participants located around the world, but busiest during the European working day.If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.
Clone or otherwise get https://github.com/web-platform-tests/wpt.
Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune
(or git fetch -p && git merge
).
See the documentation website and in particular the system setup for running tests locally.
The wpt
command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:
wpt serve
- For starting the wpt http serverwpt run
- For running tests in a browserwpt lint
- For running the lint against all testswpt manifest
- For updating or generating a MANIFEST.json
test manifestwpt install
- For installing the latest release of a browser or webdriver server on the local machine.wpt serve-wave
- For starting the wpt http server and the WAVE test runner. For more details on how to use the WAVE test runner see the documentation.On Windows wpt
commands must be prefixed with python
or the path to the python binary (if python
is not in your %PATH%
).
python wpt [command]
Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt
commands.
Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false
in your working tree.
The master branch is automatically synced to wpt.live and w3c-test.org.
Save the Web, Write Some Tests!
Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.
The way to contribute is just as usual:
git checkout -b topic
../wpt lint
as described above.If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!