Skip to content

Commit

Permalink
fix <position> syntax (fixes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Sep 13, 2016
1 parent 0b9667c commit 3a532d6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/patch.json
Expand Up @@ -752,8 +752,8 @@
"syntax": "path( <string> )"
},
"position": {
"comment": "missed spaces between brackets, remove redundant top level group, move first group to the end since less collecting",
"syntax": "[ left | center | right | &lt;length-percentage&gt; ] [ top | center | bottom | &lt;length-percentage&gt; ] | [ center | [ left | right ] &lt;length-percentage&gt;? ] && [ center | [ top | bottom ] &lt;length-percentage&gt;? ] | [ left | center | right | top | bottom | &lt;length-percentage&gt; ]"
"comment": "rewrite syntax (TODO: make match work with original syntax)",
"syntax": "[ center && [ left | right | top | bottom ] &lt;length-percentage&gt;? ] | [ [ left | right ] &lt;length-percentage&gt;? ] && [ [ top | bottom ] &lt;length-percentage&gt;? ] | [ [ left | center | right | &lt;length-percentage&gt; ] || [ top | center | bottom | &lt;length-percentage&gt; ] ]"
},
"right": {
"comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
Expand Down
63 changes: 63 additions & 0 deletions test/fixture/syntax/default.json
Expand Up @@ -41,5 +41,68 @@
"1, 2, 3",
"1 2, 3, 4 5"
]
},
"background-position": {
"property": "background-position",
"valid": [
"left",
"right",
"top",
"bottom",
"center",
"10px",
"10%",
"left top",
"left center",
"left bottom",
"left 10px",
"left 10%",
"right top",
"right center",
"right bottom",
"right 10px",
"right 10%",
"bottom left",
"bottom center",
"bottom right",
"top left",
"top center",
"top right",
"center left",
"center center",
"center right",
"center bottom",
"center top",
"10px top",
"10% top",
"10px 10px",
"10% 10%",
"10% center",
"left 10px bottom",
"top 10px center",
"left 10px bottom 10px",
"top 10px right 10px",
"left, top"
],
"invalid:Mismatch": [
"",
"10",
"10 20"
],
"invalid:Uncomplete match": [
"left right",
"right left",
"top bottom",
"bottom top",
"10px left",
"10px right",
"10px 10px 10px",
"left 10px 10px",
"left 10px right 10px",
"left 10px center 10px",
"top 10px center 10px",
"top 10px bottom 10px",
"center center center"
]
}
}

0 comments on commit 3a532d6

Please sign in to comment.