swc/css/parser/tests/fixture/rome/keyframe/output.json
Donny/강동윤 b206404d94
feat(css): Recover from invalid properties (#2312)
swc_css_ast:
 - Add `DeclBlockItem`.
 - Change `DeclBlock.properties` to `DeclBlock.items`.

swc_css_parser:
 - Add a way to recovered errors.
2021-09-28 09:58:56 +00:00

380 lines
8.4 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 253,
"ctxt": 0
},
"rules": [
{
"type": "KeyframesRule",
"span": {
"start": 0,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Text",
"span": {
"start": 11,
"end": 21,
"ctxt": 0
},
"value": "important1"
},
"blocks": [
{
"span": {
"start": 28,
"end": 77,
"ctxt": 0
},
"selector": [
{
"type": "Text",
"span": {
"start": 28,
"end": 32,
"ctxt": 0
},
"value": "from"
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 33,
"end": 77,
"ctxt": 0
},
"items": [
{
"type": "Property",
"span": {
"start": 43,
"end": 70,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 43,
"end": 53,
"ctxt": 0
},
"value": "margin-top"
},
"values": [
{
"type": "UnitValue",
"span": {
"start": 55,
"end": 59,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 55,
"end": 57,
"ctxt": 0
},
"value": 50.0
},
"unit": {
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"kind": null
}
}
],
"important": {
"start": 60,
"end": 70,
"ctxt": 0
}
}
]
}
},
{
"span": {
"start": 82,
"end": 130,
"ctxt": 0
},
"selector": [
{
"type": "Text",
"span": {
"start": 82,
"end": 84,
"ctxt": 0
},
"value": "to"
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 85,
"end": 130,
"ctxt": 0
},
"items": [
{
"type": "Property",
"span": {
"start": 95,
"end": 123,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 95,
"end": 105,
"ctxt": 0
},
"value": "margin-top"
},
"values": [
{
"type": "UnitValue",
"span": {
"start": 107,
"end": 112,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"value": 100.0
},
"unit": {
"span": {
"start": 110,
"end": 112,
"ctxt": 0
},
"kind": null
}
}
],
"important": {
"start": 113,
"end": 123,
"ctxt": 0
}
}
]
}
}
]
},
{
"type": "KeyframesRule",
"span": {
"start": 134,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Text",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"value": "foo"
},
"blocks": [
{
"span": {
"start": 155,
"end": 167,
"ctxt": 0
},
"selector": [
{
"type": "Text",
"span": {
"start": 155,
"end": 159,
"ctxt": 0
},
"value": "from"
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 160,
"end": 167,
"ctxt": 0
},
"items": []
}
},
{
"span": {
"start": 172,
"end": 182,
"ctxt": 0
},
"selector": [
{
"type": "Text",
"span": {
"start": 172,
"end": 174,
"ctxt": 0
},
"value": "to"
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 175,
"end": 182,
"ctxt": 0
},
"items": []
}
},
{
"span": {
"start": 187,
"end": 198,
"ctxt": 0
},
"selector": [
{
"type": "PercentValue",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 187,
"end": 189,
"ctxt": 0
},
"value": 15.0
}
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 191,
"end": 198,
"ctxt": 0
},
"items": []
}
},
{
"span": {
"start": 203,
"end": 213,
"ctxt": 0
},
"selector": [
{
"type": "PercentValue",
"span": {
"start": 203,
"end": 205,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"value": 0.0
}
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 206,
"end": 213,
"ctxt": 0
},
"items": []
}
},
{
"span": {
"start": 218,
"end": 230,
"ctxt": 0
},
"selector": [
{
"type": "PercentValue",
"span": {
"start": 218,
"end": 222,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 218,
"end": 221,
"ctxt": 0
},
"value": 100.0
}
}
],
"rule": {
"type": "DeclBlock",
"span": {
"start": 223,
"end": 230,
"ctxt": 0
},
"items": []
}
}
]
},
{
"type": "KeyframesRule",
"span": {
"start": 234,
"end": 252,
"ctxt": 0
},
"id": {
"type": "Text",
"span": {
"start": 245,
"end": 248,
"ctxt": 0
},
"value": "FOO"
},
"blocks": []
}
]
}