Make 3D leaf render pass decision compatible with TransformInterop.

The decision about when to create a render pass at the leafward edges of
preserve-3d scenes was not compatible with the changes to preserve-3d
made in TransformInterop in a number of ways.

With TransformInterop, being the leaf of a 3D scene (where we define
leaf as the element *all* of whose descendants are flattened into it)
does not require any unusual properties on the element; it merely
requires that the parent have transform-style: preserve-3d but the
element not do so.  (Prior to TransformInterop, it required something
that created a node in the transform tree; see NeedsTransform().)

Doing this correctly post-TransformInterop requires that we make the
decision about whether an element is in this flattening position in the
effect node in the paint property tree while we're still operating on
layout objects and have accurate information about element parent/child
relationships.

This also avoids a case in the old code (which I'm not convinced was
bug-free in this respect prior to TransformInterop) where the code could
get set state on an effect node when operating on a transform node that
was a descendant of that effect node's transform node (but one that
shared the same effect node).

This continues to make the render surface associated with the closest
possible element to the 3D scene.  I considered trying to move it
further away, but this seems difficult both because it must end up with
the 3D scene's sorting context set on the quad (for the containing
render pass) that draws the render pass, and because it must contain
anything that creates render pass quads.

REVIEW: I'm hopeful that this doesn't create any z-ordering bugs
(between things in separate flattened leaf elements of the same 3D scene
that should interleave with each other), although it's possible it will.
The tests I've written appear to pass, although it's not entirely clear
why they pass.  (Conceptually what we really want is to create a single
render surface, associated with the parent of the leaves, for *all* of
its leaf children, but not including any preserve-3d children.)

Note that the existing web test
compositing/overflow-trumps-transform-style.html is the only test that
fails if this code to cause creation of a render pass is removed.

The newly-added tests preserve3d-and-flattening-00{1,2,3}.html fail
prior to this change.   001 is the one that is closest to the broken
site; it does not fail if the code to create a render pass is just
removed.  002 and 003, however, also fail if the code is removed.  (The
distinction between 002 and 003 was needed to get more complete test
coverage with multiple earlier versions of this change.)

The newly-added tests preserve3d-and-flattening-z-order-001 through -007
test aspects of z-order interleaving.  In particular, -006 and -007
showed failures with earlier versions of this patch.

All of the newly added tests pass in Firefox and Safari, although in
some cases this may be because they're testing the wrong thing because
those engines still need to make some or all of the changes that we
shipped in TransformInterop.

Note that the rebaselining of the following highdpi expectations also
rebaselines to fix existing failures prior to this change:
flag-specific/highdpi/paint/invalidation/compositing/squashing-inside-preserve-3d-element-expected.txt
flag-specific/highdpi/compositing/layer-creation/no-compositing-for-preserve-3d-expected.txt
flag-specific/highdpi/compositing/3d-cube-expected.png

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