This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] Separate the height ruler from the other rulers #22964
Merged
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.
Description
The new rich text implementation needs DOM rulers only for height measurements. This PR refactors out a height ruler so that it can be used by rich text without needing to go through all the legacy ruler stuff.
The new height ruler is also better cacheable since it uses only a subset of styles that affect the height, instead of using the entire
ParagraphGeometricStyleas a cache key.Tests
There are already many tests that verify height measurements are correct.
I added several checks for
alphabeticBaselinebecause I noticed they weren't covered by existing tests.