commit | e6765d2a5bb918635334f49b355a6a72f77b8255 | [log] [tgz] |
---|---|---|
author | Andreu Botella <abotella@igalia.com> | Thu Apr 03 05:34:43 2025 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Apr 03 05:34:43 2025 |
tree | 4ce483fb6ad3ad0b70f94603f00cf73e67268dc9 | |
parent | a9d629f45789581159d456c1c9e59f904d4c5cde [diff] |
[line-clamp] Allow inserting the ellipsis inside nowrap text With the `CSSLineClampLineBreakingEllipsis` runtime feature on, the ellipsis width computation happens as part of line breaking, so that the ellipsis gets inserted at the last possible break opportunity. However, this currently does not work with `text-wrap: nowrap` text, because regular line breaking would not wrap inside that text, but there are still break opportunities in it that must be used when clamping. This patch replaces any calls to the `ComputedStyle` methods `ShouldWrapLine` and `ShouldBreakOnlyAfterWhiteSpace` with equivalent methods in `ComputedStyle` that also check whether the line is being ellipsized for line-clamp; and replaces any such calls inside `LineBreaker` to use them. This is enough to cover the spec's requirements, which explicitly ignore break opportunities created by `overflow-wrap`. This patch also fixes the removal of trailing spaces so that when an ellipsis is inserted inside `white-space: pre` text, there are no preserved spaces between the end of the word and the ellipsis (see https://github.com/w3c/csswg-drafts/issues/12008). Bug: 40336192 Change-Id: I22822d5f1d6a44e5b5c5b99a9fb698df10ffcf9c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6394977 Commit-Queue: Andreu Botella <abotella@igalia.com> Reviewed-by: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1441973}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.