Fix swapped larger/smaller entries in Map.FontSizes - #194
Merged
TylerBrinks merged 1 commit intoJul 23, 2026
Merged
Conversation
Map.FontSizes mapped the keyword "larger" to FontSize.Smaller and "smaller" to FontSize.Larger. ValueExtensions.ToLength resolves FontSize.Larger to 120% and FontSize.Smaller to 80%, so the two relative font-size keywords resolved to each other's scale factor. The defect is currently latent: DictionaryValueConverter looks the identifier up with "TryGetValue(identifier, out _)" and keeps only the key, so nothing reads these values today. It becomes live the moment anything does. Tests assert the keyword-to-enum mapping and its composition with ToLength directly, plus that both keywords still parse and round-trip through font-size.
jhaygood86
marked this pull request as ready for review
July 22, 2026 21:26
jhaygood86
marked this pull request as draft
July 22, 2026 21:40
jhaygood86
marked this pull request as ready for review
July 22, 2026 21:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Map.FontSizeshas the two relative keywords crossed:ValueExtensions.ToLengthresolvesFontSize.Largerto120%andFontSize.Smallerto80%, solargerresolves to the shrink factor andsmallerto the grow factor — the opposite of CSS 2.1 §15.7 / CSS Fonts 3 §3.5.Scope
The defect is latent today.
DictionaryValueConverterlooks the identifier up withTryGetValue(identifier, out _)and keeps only the key, discarding the mappedFontSizeentirely, andMap.FontSizeshas no other consumer. So nothing currently reads these values — but the table is wrong, and it becomes live the moment anything does.Because of that, the fix is not observable through the property API. The tests therefore assert the mapping directly (the test assembly already has
InternalsVisibleTo), which is what actually pins the intent:Plus two round-trip tests confirming both keywords still parse as
font-sizevalues, so the table change doesn't disturb the converter path.2 of the 4 fail on
master. The full suite (1263 existing tests) stays green, and all seven target frameworks build with no new warnings.