Fix a DCHECK with easy selector matching in case-sensitivity corner cases.

There's a small performance hit from this fix, but we do get to check
slightly more elements in the easy selector checker, so it's not too
bad in most cases.

Style perftest (Zen 2, LTO but no PGO):

Initial style (µs)     Before     After    Perf      95% CI (BCa)
=================== ========= ========= ======= =================
ECommerce                9884      9883   +0.0%  [ -0.1%,  +0.1%]
Encyclopedia           106558    106312   +0.2%  [ +0.1%,  +0.3%]
Extension              131017    130938   +0.1%  [ -0.0%,  +0.2%]
News                    40452     40549   -0.2%  [ -0.4%,  -0.1%]
Search                   2584      2589   -0.2%  [ -0.3%,  -0.0%]
Social1                 22265     22259   +0.0%  [ -0.1%,  +0.1%]
Social2                  1028      1032   -0.5%  [ -0.6%,  -0.2%]
Sports                  41938     41990   -0.1%  [ -0.2%,  -0.0%]
Video                   40186     40311   -0.3%  [ -0.4%,  -0.2%]
Geometric mean                            -0.1%  [ -0.2%,  -0.0%]

Recalc style (µs)      Before     After    Perf      95% CI (BCa)
=================== ========= ========= ======= =================
ECommerce               11151     11228   -0.7%  [ -0.9%,  -0.5%]
Encyclopedia            83864     84208   -0.4%  [ -0.5%,  -0.3%]
Extension              118404    119177   -0.6%  [ -0.8%,  -0.5%]
News                    29341     29482   -0.5%  [ -0.7%,  -0.3%]
Search                    236       238   -0.9%  [ -1.7%,  -0.4%]
Social1                 16021     16088   -0.4%  [ -0.6%,  -0.3%]
Social2                   577       579   -0.4%  [ -0.7%,  -0.2%]
Sports                  22037     22277   -1.1%  [ -1.2%,  -0.9%]
Video                   24092     24376   -1.2%  [ -1.3%,  -1.0%]
Geometric mean                            -0.7%  [ -0.8%,  -0.6%]

Fixed: 1418575
Change-Id: I82b28b7cdebeb9ffc24e54a86a0993443d566278
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4286739
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110864}
2 files changed
tree: 6a648f6975e102f0e4fdae84cedc78c54160eb08
  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. focus/
  76. font-access/
  77. fonts/
  78. forced-colors-mode/
  79. fs/
  80. fullscreen/
  81. gamepad/
  82. generic-sensor/
  83. geolocation-API/
  84. geolocation-sensor/
  85. graphics-aam/
  86. gyroscope/
  87. hr-time/
  88. html/
  89. html-longdesc/
  90. html-media-capture/
  91. idle-detection/
  92. imagebitmap-renderingcontext/
  93. images/
  94. import-maps/
  95. IndexedDB/
  96. inert/
  97. infrastructure/
  98. input-device-capabilities/
  99. input-events/
  100. installedapp/
  101. interfaces/
  102. intersection-observer/
  103. intervention-reporting/
  104. is-input-pending/
  105. js/
  106. js-self-profiling/
  107. keyboard-lock/
  108. keyboard-map/
  109. largest-contentful-paint/
  110. layout-instability/
  111. lifecycle/
  112. loading/
  113. longtask-timing/
  114. magnetometer/
  115. managed/
  116. mathml/
  117. measure-memory/
  118. media/
  119. media-capabilities/
  120. media-playback-quality/
  121. media-source/
  122. mediacapture-extensions/
  123. mediacapture-fromelement/
  124. mediacapture-handle/
  125. mediacapture-image/
  126. mediacapture-insertable-streams/
  127. mediacapture-record/
  128. mediacapture-region/
  129. mediacapture-streams/
  130. mediasession/
  131. merchant-validation/
  132. mimesniff/
  133. mixed-content/
  134. mst-content-hint/
  135. navigation-api/
  136. navigation-timing/
  137. netinfo/
  138. network-error-logging/
  139. notifications/
  140. old-tests/
  141. orientation-event/
  142. orientation-sensor/
  143. page-lifecycle/
  144. page-visibility/
  145. paint-timing/
  146. parakeet/
  147. payment-handler/
  148. payment-method-basic-card/
  149. payment-method-id/
  150. payment-request/
  151. pending-beacon/
  152. performance-timeline/
  153. periodic-background-sync/
  154. permissions/
  155. permissions-policy/
  156. permissions-request/
  157. permissions-revoke/
  158. picture-in-picture/
  159. pointerevents/
  160. pointerlock/
  161. portals/
  162. preload/
  163. presentation-api/
  164. private-click-measurement/
  165. proximity/
  166. push-api/
  167. quirks/
  168. referrer-policy/
  169. remote-playback/
  170. reporting/
  171. requestidlecallback/
  172. resize-observer/
  173. resource-timing/
  174. resources/
  175. sanitizer-api/
  176. savedata/
  177. scheduler/
  178. screen-capture/
  179. screen-details/
  180. screen-orientation/
  181. screen-wake-lock/
  182. scroll-animations/
  183. scroll-to-text-fragment/
  184. secure-contexts/
  185. secure-payment-confirmation/
  186. selection/
  187. serial/
  188. server-timing/
  189. service-workers/
  190. shadow-dom/
  191. shape-detection/
  192. shared-storage/
  193. signed-exchange/
  194. soft-navigation-heuristics/
  195. speculation-rules/
  196. speech-api/
  197. storage/
  198. storage-access-api/
  199. streams/
  200. subapps/
  201. subresource-integrity/
  202. svg/
  203. svg-aam/
  204. timing-entrytypes-registry/
  205. tools/
  206. top-level-storage-access-api/
  207. touch-events/
  208. trust-tokens/
  209. trusted-types/
  210. ua-client-hints/
  211. uievents/
  212. upgrade-insecure-requests/
  213. url/
  214. urlpattern/
  215. user-timing/
  216. vibration/
  217. video-rvfc/
  218. virtual-keyboard/
  219. visual-viewport/
  220. wai-aria/
  221. wasm/
  222. web-animations/
  223. web-bundle/
  224. web-locks/
  225. web-nfc/
  226. web-otp/
  227. web-share/
  228. webaudio/
  229. webauthn/
  230. webcodecs/
  231. WebCryptoAPI/
  232. webdriver/
  233. webgl/
  234. webgpu/
  235. webhid/
  236. webidl/
  237. webmessaging/
  238. webmidi/
  239. webnn/
  240. webrtc/
  241. webrtc-encoded-transform/
  242. webrtc-extensions/
  243. webrtc-ice/
  244. webrtc-identity/
  245. webrtc-priority/
  246. webrtc-stats/
  247. webrtc-svc/
  248. websockets/
  249. webstorage/
  250. webtransport/
  251. webusb/
  252. webvr/
  253. webvtt/
  254. webxr/
  255. window-placement/
  256. workers/
  257. worklets/
  258. x-frame-options/
  259. xhr/
  260. .azure-pipelines.yml
  261. .gitattributes
  262. .gitignore
  263. .mailmap
  264. .taskcluster.yml
  265. CODE_OF_CONDUCT.md
  266. CODEOWNERS
  267. CONTRIBUTING.md
  268. LICENSE.md
  269. lint.ignore
  270. README.md
  271. wpt
  272. 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!