Repository navigation
Conversation
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.
Any
remlength resolved to 0, e.g.html { font-size: 10px } p { margin-left: 2rem }gave no margin at all,height: 2remwas ignored andfont-size: 2remfell back tomedium. The length parsing on the box side only knew the two letter units and looked at the last two characters, so2rembecame anemlength with the number2r. Insidecalc()it didn't drop to 0, but used the element's own font size instead of the root's.remis now a unit of its own and resolves against the font size of thehtmlelement (or the topmost box for a fragment without one), as defined in CSS Values 4 §6.1.1:CssValueParser.ParseLengthandIsValidLengthrecognizerem, andcalc()gets the root font size as rem factorCssLengthhas aRemsunitfont-sizeresolvesremright away likeem, so children don't compound it, and on the root element itself it refers to the initial font sizeRegexParserUtils.CssLengthincludesrem, whichfont-size,word-spacing,border-radiusandborder-spacinggo throughHow to test this PR?
CI should succeed.
LengthTests.Rem_ResolvesAgainstTheRootFontSize,Rem_InFontSize_ResolvesAgainstTheRootFontSizeandRem_InTheRootFontSize_IsTheInitialFontSizecover margin, padding,calc(),text-indent, height, border width andfont-size, and fail on master.