Handle clipping of characters in CHTML better and avoid vertical scroll bars for overflow="scroll" #1171
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 PR introduces clipping paths for the CHTML characters so that when selected, they highlight region will match the character bounding box (rather than having excessive depth, for example). It also clips the spaces used for in-line breaking so that they don't show selection, just as the spacing for non-breakpoints doesn't show.
This clipping makes the focus outline match the bounding box better, particularly for the explorer on in-line expressions (the outline used to be excessively below the expression). This necessitated some changes to the CSS for inline breaking, and requires one more rule to be in the font-specific CSS, so I had to rebuild all the fonts. You will need to use the woff2 version of the lab to test this (as this is build on top of the woff2 branch).
I also normalized the size of the explorer outline so that the HTML and SVG versions are more consistent (so slightly smaller outline in CHTML and slightly larger in SVG). I always thought the CHTML outline was too heavy anyway.
I also moved some CSS that was common to both CHTML and SVG to the
common.ts
file, for easier maintenance.Finally, when
overflow
is eitherscroll
ortruncate
, theoverflow-y
CSS is set to clip, to avoid unwanted vertical scroll bars.