Change information
Commit message:
[M140] Revert "[line-clamp] Support clamping by lines and a height at the same time"
Original change's description:
> Revert "[line-clamp] Support clamping by lines and a height at the same time"
>
> This reverts commit 042edf71969098eaaedcfd003de4f01a2b448a64.
>
> Reason for revert: This CL unintentionally enabled clamping by lines
> and a height at the same time even without the `CSSLineClamp` runtime
> enabled feature set, causing it to apply to `-webkit-line-clamp`. This
> new behavior seems to have broken at least some sites.
>
> Original change's description:
> > [line-clamp] Support clamping by lines and a height at the same time
> >
> > Until now, in our implementation of `line-clamp`, we allowed clamping
> > by a number of lines (e.g. `line-clamp: 3`), and clamping by a block
> > size (e.g. `line-clamp: auto`, with a block size constraint given by
> > `max-height`, for example); but we did not support clamping by both.
> > If `line-clamp: 3` was set on a container with a height that did not
> > fully fit the third line, that line would overflow, but the clamp
> > point would not be moved earlier.
> >
> > However, in the April CSSWG F2F, it was discussed that clamping by
> > both lines and a block size should be possible. This was not resolved
> > at that point, since this was tangential to the issue that was being
> > discussed, but the working group seemed to lean in that direction.
> >
> > We implement this by adding a new value to the `LineClampData::State`
> > enum, `kClampByLinesWithBfcOffset`. This state will both act as if
> > clamping by a number of lines, while at the same time checking if we
> > ever go past the BFC offset before the clamp point, in which case we
> > relayout using regular `kClampByLines`.
> >
> > Bug: 40336192
> > Change-Id: I2519c9f84b3ca41aa9418c435bea978bfe1fec73
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6757119
> > Reviewed-by: Ian Kilpatrick <ikilp...@chromium.org>
> > Commit-Queue: Andreu Botella <abot...@igalia.com>
> > Cr-Commit-Position: refs/heads/main@{#1491158}
>
> Bug: 40336192, 436345865
> Change-Id: Ib6afb94bb4efd6b4deca166213ab2266aa123565
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6836376
> Reviewed-by: Ian Kilpatrick <ikilp...@chromium.org>
> Commit-Queue: Andreu Botella <abot...@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#1499689}
Bug: 439952376,40336192,436345865
Change-Id: Ib6afb94bb4efd6b4deca166213ab2266aa123565
Cr-Commit-Position: refs/branch-heads/7339@{#973}
Cr-Branched-From: 27be8b77710f4405fdfeb4ee946fcabb0f6c92b2-refs/heads/main@{#1496484}
Files:
- M third_party/blink/renderer/core/layout/block_layout_algorithm.cc
- M third_party/blink/renderer/core/layout/block_layout_algorithm.h
- M third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc
- M third_party/blink/renderer/core/layout/line_clamp_data.cc
- M third_party/blink/renderer/core/layout/line_clamp_data.h
- M third_party/blink/renderer/core/style/computed_style.h
- M third_party/blink/web_tests/TestExpectations
- M third_party/blink/web_tests/external/wpt/css/css-inline/text-box-trim/text-box-trim-line-clamp-001-ref.html
- M third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/line-clamp-010.html
- M third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/line-clamp-011.tentative.html
- D third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/line-clamp-035.tentative.html
- M third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/reference/line-clamp-011-ref.html
Change size: L
Delta: 12 files changed, 175 insertions(+), 209 deletions(-)
Branch: refs/branch-heads/7339
Submit Requirements:
Code-Review: Bot-Commit+1 by Rubber Stamper