Clamp the presentation time to a usable range

If the time container is seeked to a large enough value, we will end up
truncating it to SMILTime::Latest(), which is the largest value that
isn't one of the two special values ("indefinite" and "unresolved").
When trying to derive other values from this value - like if we have an
interval begin at it - we can end up in a loop since any the result of
any additions will yield the same value, leading to the element being
rescheduled at the same point in time, hanging UpdateIntervals().
This mechanism can also be used to implement the "once" animation-policy
in a slightly nicer way. This will be done as a follow-up.

Bug: 1039886
Change-Id: If13d7d7d3c44c4f586d15852eb05105879f44918
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2030885
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#737260}
1 file changed
tree: f697e12884a380141d707290cdaf32c1aca7f08a
  1. .github/
  2. .well-known/
  3. 2dcontext/
  4. accelerometer/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. audio-output/
  15. background-fetch/
  16. BackgroundSync/
  17. battery-status/
  18. beacon/
  19. bluetooth/
  20. clear-site-data/
  21. client-hints/
  22. clipboard-apis/
  23. common/
  24. compat/
  25. compression/
  26. conformance-checkers/
  27. console/
  28. contacts/
  29. content-dpr/
  30. content-security-policy/
  31. cookie-store/
  32. cookies/
  33. core-aam/
  34. cors/
  35. credential-management/
  36. css/
  37. custom-elements/
  38. device-memory/
  39. docs/
  40. document-policy/
  41. dom/
  42. domparsing/
  43. domxpath/
  44. dpub-aam/
  45. dpub-aria/
  46. editing/
  47. element-timing/
  48. encoding/
  49. encoding-detection/
  50. encrypted-media/
  51. entries-api/
  52. event-timing/
  53. eventsource/
  54. feature-policy/
  55. fetch/
  56. FileAPI/
  57. fonts/
  58. forced-colors-mode/
  59. fullscreen/
  60. gamepad/
  61. generic-sensor/
  62. geolocation-API/
  63. geolocation-sensor/
  64. graphics-aam/
  65. gyroscope/
  66. hr-time/
  67. html/
  68. html-longdesc/
  69. html-media-capture/
  70. idle-detection/
  71. imagebitmap-renderingcontext/
  72. images/
  73. import-maps/
  74. IndexedDB/
  75. inert/
  76. infrastructure/
  77. input-device-capabilities/
  78. input-events/
  79. installedapp/
  80. interfaces/
  81. intersection-observer/
  82. js/
  83. keyboard-lock/
  84. keyboard-map/
  85. kv-storage/
  86. largest-contentful-paint/
  87. layout-instability/
  88. lifecycle/
  89. loading/
  90. longtask-timing/
  91. magnetometer/
  92. mathml/
  93. measure-memory/
  94. media/
  95. media-capabilities/
  96. media-playback-quality/
  97. media-source/
  98. mediacapture-depth/
  99. mediacapture-fromelement/
  100. mediacapture-image/
  101. mediacapture-record/
  102. mediacapture-streams/
  103. mediasession/
  104. mimesniff/
  105. mixed-content/
  106. mst-content-hint/
  107. native-file-system/
  108. navigation-timing/
  109. netinfo/
  110. network-error-logging/
  111. notifications/
  112. offscreen-canvas/
  113. old-tests/
  114. orientation-event/
  115. orientation-sensor/
  116. origin-policy/
  117. page-visibility/
  118. paint-timing/
  119. payment-handler/
  120. payment-method-basic-card/
  121. payment-method-id/
  122. payment-request/
  123. performance-timeline/
  124. PeriodicBackgroundSync/
  125. permissions/
  126. picture-in-picture/
  127. pointerevents/
  128. pointerlock/
  129. portals/
  130. preload/
  131. presentation-api/
  132. printing/
  133. priority-hints/
  134. proximity/
  135. push-api/
  136. quirks/
  137. referrer-policy/
  138. remote-playback/
  139. reporting/
  140. requestidlecallback/
  141. resize-observer/
  142. resource-timing/
  143. resources/
  144. screen-capture/
  145. screen-orientation/
  146. screen_enumeration/
  147. scroll-animations/
  148. scroll-to-text-fragment/
  149. secure-contexts/
  150. selection/
  151. serial/
  152. server-timing/
  153. service-workers/
  154. shadow-dom/
  155. shape-detection/
  156. signed-exchange/
  157. sms/
  158. speech-api/
  159. std-toast/
  160. storage/
  161. storage-access-api/
  162. streams/
  163. subresource-integrity/
  164. svg/
  165. svg-aam/
  166. timing-entrytypes-registry/
  167. tools/
  168. touch-events/
  169. trusted-types/
  170. uievents/
  171. upgrade-insecure-requests/
  172. url/
  173. user-timing/
  174. vibration/
  175. video-raf/
  176. visual-viewport/
  177. wai-aria/
  178. wake-lock/
  179. wasm/
  180. web-animations/
  181. web-bundle/
  182. web-locks/
  183. web-nfc/
  184. web-share/
  185. webaudio/
  186. webauthn/
  187. WebCryptoAPI/
  188. webdriver/
  189. webgl/
  190. webgpu/
  191. WebIDL/
  192. webmessaging/
  193. webmidi/
  194. webrtc/
  195. webrtc-extensions/
  196. webrtc-identity/
  197. webrtc-quic/
  198. webrtc-stats/
  199. webrtc-svc/
  200. websockets/
  201. webstorage/
  202. webusb/
  203. webvr/
  204. webvtt/
  205. webxr/
  206. workers/
  207. worklets/
  208. x-frame-options/
  209. xhr/
  210. xslt/
  211. .azure-pipelines.yml
  212. .codecov.yml
  213. .gitattributes
  214. .gitignore
  215. .mailmap
  216. .pyup.yml
  217. .taskcluster.yml
  218. CODEOWNERS
  219. CONTRIBUTING.md
  220. LICENSE.md
  221. lint.whitelist
  222. README.md
  223. testharness_runner.html
  224. update-built-tests.sh
  225. wpt
  226. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status

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 IRC chat room named #testing on irc.w3.org; includes participants located around the world, but busiest during the European working day; all discussion is archived here
  • Mailing list: a public and low-traffic discussion list

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.

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 http://w3c-test.org/.

Pull requests are automatically mirrored except those that modify sensitive resources (such as .py). The latter require someone with merge access to comment with “LGTM” or “w3c-test:mirror” to indicate the pull request has been checked.

Branches

In the vast majority of cases the only upstream branch that you should need to care about is master. If you see other branches in the repository, you can generally safely ignore them.

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!