parse: add the gap shorthand - #43
Open
metan-ucw wants to merge 1 commit into
Open
Conversation
`gap: <row-gap> <column-gap>?` was not a property at all: the parser only knew the `column-gap` longhand (from multicol), so every `gap` declaration was thrown away. Flex and grid layouts written the modern way — one `gap` on the container — got no spacing between their items. LibCSS has no row-gap property, so only the column component can reach the cascade; the row component is still parsed and consumed, or the declaration would be rejected as invalid and the column gap lost with it. A single value serves both axes, so it becomes the column gap too. The tests go beside column-gap's own in multicol.dat and pin that pair of rules — one value reaches the object model, and with two it is the second that survives. The values the shorthand takes are the longhand's: UNIT_MASK_COLUMN_GAP is UNIT_LENGTH, so `gap: 10%` is rejected exactly as `column-gap: 10%` is, and a negative length is out of range. A third component is rejected outright. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Cyril Hrubis <metan@ucw.cz>
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.
gap: <row-gap> <column-gap>?was not a property at all: the parser only knew thecolumn-gaplonghand (from multicol), so everygapdeclaration was thrown away. Flex and grid layouts written the modern way — onegapon the container — got no spacing between their items.LibCSS has no row-gap property, so only the column component can reach the cascade; the row component is still parsed and consumed, or the declaration would be rejected as invalid and the column gap lost with it. A single value serves both axes, so it becomes the column gap too.
The tests go beside column-gap's own in multicol.dat and pin that pair of rules — one value reaches the object model, and with two it is the second that survives. The values the shorthand takes are the longhand's: UNIT_MASK_COLUMN_GAP is UNIT_LENGTH, so
gap: 10%is rejected exactly ascolumn-gap: 10%is, and a negative length is out of range. A third component is rejected outright.