No scrollend on VisualViewport-only scrolls

Currently, we fire scrollend on the document if either the visual
viewport and/or the layout viewport is scrolled which isn't the right
behavior as VisualViewport-only scrolls don't generate scroll events on
the document. The correct behavior is to only fire scrollend on the
document if the layout viewport scrolled.

This patch achieves the correct behavior by having InputHandler keep
track of whether any update on a given viewport scroll applied to the
layout viewport or not. At the end of the scroll, this bit is then
stored in CompositorCommitData which the main thread will use to
determine whether or not to fire scrollend at the document.

3 tests in wpt/dom/events/scrolling/ have been modified because they
were based on the expectation that a scroll with 0 delta on the layout
viewport would generate a scrollend event. Also, the tests were
written to use touch input which is not supported on mac. This is
probably one of the reasons the tests fail in wpt.fyi[1]. I've left
the use of touch input  but added a TODO to rewrite these tests with a
different input mechanism.

This addresses scrolls handled on the compositor which does not
currently include keyboard scrolls. A follow-up patch will be needed to
address keyboard scrolls.

[1]
https://wpt.fyi/results/dom/events/scrolling/scrollend-event-fired-to-window.html?label=experimental&label=master&aligned

Bug: 1423149
Change-Id: I4c0083a9232bacfd19e4ec17ee14f044f018080f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4362538
Commit-Queue: David Awogbemila <awogbemila@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1123623}
4 files changed
tree: d0e0a7598e0b81cdf41de07503556cda7e215bb0
  1. .github/
  2. .well-known/
  3. accelerometer/
  4. accessibility/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. attribution-reporting/
  15. audio-output/
  16. autoplay-policy-detection/
  17. avif/
  18. background-fetch/
  19. background-sync/
  20. badging/
  21. battery-status/
  22. beacon/
  23. bluetooth/
  24. browsing-topics/
  25. clear-site-data/
  26. client-hints/
  27. clipboard-apis/
  28. close-watcher/
  29. common/
  30. compat/
  31. compression/
  32. compute-pressure/
  33. conformance-checkers/
  34. console/
  35. contacts/
  36. content-dpr/
  37. content-index/
  38. content-security-policy/
  39. contenteditable/
  40. cookie-store/
  41. cookies/
  42. core-aam/
  43. cors/
  44. credential-management/
  45. css/
  46. custom-elements/
  47. custom-state-pseudo-class/
  48. delegated-ink/
  49. density-size-correction/
  50. deprecation-reporting/
  51. device-memory/
  52. direct-sockets/
  53. docs/
  54. document-picture-in-picture/
  55. document-policy/
  56. dom/
  57. domparsing/
  58. domxpath/
  59. dpub-aam/
  60. dpub-aria/
  61. ecmascript/
  62. editing/
  63. element-timing/
  64. encoding/
  65. encoding-detection/
  66. encrypted-media/
  67. entries-api/
  68. event-timing/
  69. eventsource/
  70. eyedropper/
  71. feature-policy/
  72. fetch/
  73. file-system-access/
  74. FileAPI/
  75. fledge/
  76. focus/
  77. font-access/
  78. fonts/
  79. forced-colors-mode/
  80. fs/
  81. fullscreen/
  82. gamepad/
  83. generic-sensor/
  84. geolocation-API/
  85. geolocation-sensor/
  86. graphics-aam/
  87. gyroscope/
  88. hr-time/
  89. html/
  90. html-longdesc/
  91. html-media-capture/
  92. idle-detection/
  93. imagebitmap-renderingcontext/
  94. images/
  95. import-maps/
  96. IndexedDB/
  97. inert/
  98. infrastructure/
  99. input-device-capabilities/
  100. input-events/
  101. installedapp/
  102. interfaces/
  103. intersection-observer/
  104. intervention-reporting/
  105. is-input-pending/
  106. js/
  107. js-self-profiling/
  108. keyboard-lock/
  109. keyboard-map/
  110. largest-contentful-paint/
  111. layout-instability/
  112. lifecycle/
  113. loading/
  114. long-animation-frame/
  115. longtask-timing/
  116. magnetometer/
  117. managed/
  118. mathml/
  119. measure-memory/
  120. media/
  121. media-capabilities/
  122. media-playback-quality/
  123. media-source/
  124. mediacapture-extensions/
  125. mediacapture-fromelement/
  126. mediacapture-handle/
  127. mediacapture-image/
  128. mediacapture-insertable-streams/
  129. mediacapture-record/
  130. mediacapture-region/
  131. mediacapture-streams/
  132. mediasession/
  133. merchant-validation/
  134. mimesniff/
  135. mixed-content/
  136. mst-content-hint/
  137. navigation-api/
  138. navigation-timing/
  139. netinfo/
  140. network-error-logging/
  141. notifications/
  142. old-tests/
  143. orientation-event/
  144. orientation-sensor/
  145. page-lifecycle/
  146. page-visibility/
  147. paint-timing/
  148. parakeet/
  149. payment-handler/
  150. payment-method-basic-card/
  151. payment-method-id/
  152. payment-request/
  153. pending-beacon/
  154. performance-timeline/
  155. periodic-background-sync/
  156. permissions/
  157. permissions-policy/
  158. permissions-request/
  159. permissions-revoke/
  160. picture-in-picture/
  161. png/
  162. pointerevents/
  163. pointerlock/
  164. portals/
  165. preload/
  166. presentation-api/
  167. private-click-measurement/
  168. proximity/
  169. push-api/
  170. quirks/
  171. referrer-policy/
  172. remote-playback/
  173. reporting/
  174. requestidlecallback/
  175. resize-observer/
  176. resource-timing/
  177. resources/
  178. sanitizer-api/
  179. savedata/
  180. scheduler/
  181. screen-capture/
  182. screen-details/
  183. screen-orientation/
  184. screen-wake-lock/
  185. scroll-animations/
  186. scroll-to-text-fragment/
  187. secure-contexts/
  188. secure-payment-confirmation/
  189. selection/
  190. serial/
  191. server-timing/
  192. service-workers/
  193. shadow-dom/
  194. shape-detection/
  195. shared-storage/
  196. signed-exchange/
  197. soft-navigation-heuristics/
  198. speculation-rules/
  199. speech-api/
  200. storage/
  201. storage-access-api/
  202. streams/
  203. subapps/
  204. subresource-integrity/
  205. svg/
  206. svg-aam/
  207. timing-entrytypes-registry/
  208. tools/
  209. top-level-storage-access-api/
  210. touch-events/
  211. trust-tokens/
  212. trusted-types/
  213. ua-client-hints/
  214. uievents/
  215. upgrade-insecure-requests/
  216. url/
  217. urlpattern/
  218. user-timing/
  219. vibration/
  220. video-rvfc/
  221. virtual-keyboard/
  222. visual-viewport/
  223. wai-aria/
  224. wasm/
  225. web-animations/
  226. web-bundle/
  227. web-locks/
  228. web-nfc/
  229. web-otp/
  230. web-share/
  231. webaudio/
  232. webauthn/
  233. webcodecs/
  234. WebCryptoAPI/
  235. webdriver/
  236. webgl/
  237. webgpu/
  238. webhid/
  239. webidl/
  240. webmessaging/
  241. webmidi/
  242. webnn/
  243. webrtc/
  244. webrtc-encoded-transform/
  245. webrtc-extensions/
  246. webrtc-ice/
  247. webrtc-identity/
  248. webrtc-priority/
  249. webrtc-stats/
  250. webrtc-svc/
  251. websockets/
  252. webstorage/
  253. webtransport/
  254. webusb/
  255. webvr/
  256. webvtt/
  257. webxr/
  258. window-placement/
  259. workers/
  260. worklets/
  261. x-frame-options/
  262. xhr/
  263. .azure-pipelines.yml
  264. .gitattributes
  265. .gitignore
  266. .mailmap
  267. .taskcluster.yml
  268. CODE_OF_CONDUCT.md
  269. CODEOWNERS
  270. CONTRIBUTING.md
  271. LICENSE.md
  272. lint.ignore
  273. README.md
  274. wpt
  275. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status documentation manifest Python 3

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:

  • github.com/web-platform-tests/wpt: the canonical location of the project's source code revision history and the discussion forum for changes to the code
  • web-platform-tests.org: the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more
  • wpt.live: a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice
  • wpt.fyi: an archive of test results collected from an array of web browsers on a regular basis
  • Real-time chat room: the wpt:matrix.org matrix channel; includes participants located around the world, but busiest during the European working day.
  • Mailing list: a public and low-traffic discussion list
  • RFCs: a repo for requesting comments on substantial changes that would impact other stakeholders or users; people who work on WPT infra are encouraged to watch the repo.

If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.

Setting Up the Repo

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).

Running the Tests

See the documentation website and in particular the system setup for running tests locally.

Command Line Tools

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 server
  • wpt run - For running tests in a browser
  • wpt lint - For running the lint against all tests
  • wpt manifest - For updating or generating a MANIFEST.json test manifest
  • wpt 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.

Windows Notes

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.

Publication

The master branch is automatically synced to wpt.live and w3c-test.org.

Contributing

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:

  • Fork this repository (and make sure you're still relatively in sync with it if you forked a while ago).
  • Create a branch for your changes: git checkout -b topic.
  • Make your changes.
  • Run ./wpt lint as described above.
  • Commit locally and push that to your repo.
  • Create a pull request based on the above.

Issues with web-platform-tests

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!