[white-space] Turn `white-space` to a shorthand
This patch turns the `white-space` property to a shorthand under a runtime switch `CSSWhiteSpaceShorthand`. The parser and serializer in this CL supports the spec change committed on 1st March, 2023[1], which addressed the multi-value syntax request[2]. This patch also adds: * The `white-space-collapse` property. * The `nowrap` value to the `text-wrap` property. to map all the existing `white-space` values. The switch is currently off, because enabling it causes several test failures in DOM, editing, copy/paste, accessibility, and more, but when it's turned on, CSS parsing tests added in this CL should pass. The plan is to fix these failures in following CLs. When all tests and additional tests for editing/etc. are all fixed, we can turn the switch on. The `EWhiteSpace` enum is changed to bit-flags of the longhands (`white-space-collapse` and `text-wrap`.) See `white_spae.h`. Regarding the storage in the `ComputedStyleBase`, having both storage (for when the flag is on and off) is a waste, both from memory and from read/write code performance point of view, so the longhands storage is used even when the flag is off by customized `ComputedStyle` functions; i.e., the storage for the longhand version of the `white-space` is no longer used. But this CL still preserves 1 bit for the `white-space` to avoid changing the generator only for this transition period. [1] https://github.com/w3c/csswg-drafts/pull/8274 [2] https://github.com/w3c/csswg-drafts/issues/5382 Bug: 1417543 Change-Id: I47080d0f10a4a5f366e3d855acfa5e584c029595 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4232738 Reviewed-by:Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1123192}
Loading
Please register or sign in to comment