[WIP] Add a new implementation of text-size-adjust #46288
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds a new implementation of text-size-adjust,
implemented as an alternative property behind a flag. The major
difference of the new property is that it applies as a multiplier to
the font-size and line-height properties purely via computed style,
similar to zoom. The previous implementation applied this multiplier
during layout which had instability bugs due to a cyclic dependency
where the layout size both depended on the font size and changed the
font size (see: crbug.com/40225874#comment4).
Text-size-adjust should only apply on small devices. To ensure there
are no changes in which devices apply text-size-adjust, the new
implementation only applies when the textAutosizingEnabled setting is
enabled.
Additional fixes:
The new implementation contains a fix to match the spec and fully
disable text autosizing for non-auto values. This is tested with
text-size-adjust-none.html
.autosizer kicks in. Because the new implementation does not use the
text autosizer, it now matches the spec and does not depend on the
heuristics of the text autosizer. This is tested with
text-size-adjust-affects-font-size-with-narrow-page.html
.Bug: 340389272
Change-Id: Ifaa70076bda4d04e7d2a06bca73e002197295163
Reviewed-on: https://chromium-review.googlesource.com/5540222
WPT-Export-Revision: 8b5b9b3c17fac1908b1d4bf443f6963147a9e11b