[line-clamp] Don't hide block-level abspos at the `line-clamp: auto` boundary

With `line-clamp: auto`, the clamp point should be chosen such that it
is the furthermost possible clamp point where the box doesn't
overflow. Since block-level abspos boxes can have a clamp point after
them (unlike inline-level ones), and they do not increase the
intrinsic size of the container, a block-level abspos box whose static
position is exactly at the boundary should be visible. This was not
what our implementation did, however.

The reason for that is that `BlockLineClampData::ShouldHideForPaint`
(and `BlockLineClampData::IsPastClampPoint`) were always returning
true for `line-clamp: auto` when a previous box had been found that
ended exactly at the boundary. This was meant to hide lines and floats
that started exactly at the boundary, since at the time that we're
dealing with them in the block layout algorithm, we don't know the
height of the line; as well as to handle cases where a previous box
might have clamped, but the current BFC offset might still be before
the clamp boundary.

However, this reasoning does not work for block-level abspos, because
they do not take up container space, and because there is a possible
clamp point after them. Therefore, this patch adds an optional
argument for block-level abspos to provide their static BFC offset
instead.

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