declaration: read the whole shape-outside grammar - #299
Open
samoht wants to merge 2 commits into
Open
Conversation
samoht
force-pushed
the
declaration-reader-gaps
branch
from
August 3, 2026 23:32
5124f49 to
5d055ea
Compare
read_shape_outside inspects only the first component and knows three arms of the grammar, so most valid values are rejected.
samoht
force-pushed
the
declaration-reader-gaps
branch
from
August 4, 2026 04:27
5d055ea to
7db2f20
Compare
This was referenced Aug 4, 2026
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.
Stacked on #298 (chain: #295 → #297 → #298 → #299). Review the last two commits; the rest is the base.
read_shape_outsidelooked at the first component only and knew three arms of the grammar —none,circle()and a non-emptyinset(), plus the CSS-wide keywords. Everything else was rejected and the declaration dropped:CSS Shapes 1 §2 defines it as
none | [<basic-shape> || <shape-box>] | <image>. The reader now takes that whole grammar, reusingread_clip_pathfor the<basic-shape> || <box>pair andread_background_imagefor<image>, with the two points where Shapes 1 differs fromclip-pathchecked explicitly:<shape-box>(§2.2), so the three SVG boxes<geometry-box>adds —fill-box,stroke-box,view-box— are not valid here;<basic-shape>is an alternative to the pair, not a member of it.The value stays raw text (
Shape_outside : string property); typing it would mean a sum of theclip_pathshapes plus the wholebackground_imagetype, so the reader validates the grammar and hands the source back verbatim. Onetest_optimizenormalization pair moved fromshape-outsidetoclip-pathfor that reason — a raw-text value is never normalized, so it could not demonstrate what that test asserts.The vendor-prefixed reader gap filed alongside this one is not included; its pin lives on
declaration-vendor-readersand is still failing.