[LayoutNG] Truncate block-end child margins at fragmentainer boundaries.

This was almost working correctly even without this fix, because we
currently just brutally break inside a block that overflows if there are
no breaks inside, losing any trailing margins. The only problem
currently, is that such a break still produces a break token, so that
the broken block would resume in the next fragmentainer (even if there's
nothing left to lay out), producing no content there, but an empty
fragment would create a break opportunity that shouldn't really be
there. This was a problem both for regular block containers and
fieldsets. This CL fixes that. It's also a problem for column spanners
if they participate in an outer fragmentainer context, but we have some
underlying issues there, so I just added a TODO.

The -001.html test wouldn't even fail without this CL, but as I'm
working on fixing the aforementioned brutal breaking, I felt we need
slightly better test coverage.

The new function AdjustedMarginAfterFinalChildFragment() is extremely
simple, and the amount of code duplication it prevents is negligible (or
even non-existent). Still, it seems reasonable to provide this function,
for the sake of visibility, as this is something that all algorithms
need to implement, if they want to get block fragmentation right.

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