swc/css/parser/tests/fixture/function/url/output.json
Alexander Akait 6863d9624e
fix(css/parser): Fix parsing of funxtion named url (#2350)
swc_css_parser:
 - Make `url` function calls to not contain space in arguments.
2021-10-06 04:39:54 +09:00

791 lines
20 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 783,
"ctxt": 0
},
"rules": [
{
"type": "StyleRule",
"span": {
"start": 0,
"end": 783,
"ctxt": 0
},
"selectors": [
{
"type": "ComplexSelector",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"selectors": [
{
"type": "CompoundSelector",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"hasNestPrefix": false,
"combinator": null,
"typeSelector": {
"type": "NamespacedName",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"prefix": null,
"name": {
"type": "Text",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"value": "a"
}
},
"subclassSelectors": []
}
]
}
],
"block": {
"type": "DeclBlock",
"span": {
"start": 2,
"end": 783,
"ctxt": 0
},
"items": [
{
"type": "Property",
"span": {
"start": 8,
"end": 109,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 8,
"end": 24,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "UrlValue",
"span": {
"start": 26,
"end": 109,
"ctxt": 0
},
"url": "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 115,
"end": 155,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 115,
"end": 131,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 133,
"end": 155,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 133,
"end": 136,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 137,
"end": 154,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 161,
"end": 201,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 161,
"end": 177,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 179,
"end": 201,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 179,
"end": 182,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 183,
"end": 200,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 207,
"end": 247,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 207,
"end": 223,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 225,
"end": 247,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 225,
"end": 228,
"ctxt": 0
},
"value": "URL"
},
"args": [
{
"type": "String",
"span": {
"start": 229,
"end": 246,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 253,
"end": 296,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 253,
"end": 269,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 271,
"end": 296,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 278,
"end": 295,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 302,
"end": 345,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 302,
"end": 318,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 320,
"end": 345,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 320,
"end": 323,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 324,
"end": 341,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 351,
"end": 397,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 351,
"end": 367,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 369,
"end": 397,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 369,
"end": 372,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 376,
"end": 393,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 403,
"end": 459,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 403,
"end": 419,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 421,
"end": 459,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 433,
"end": 450,
"ctxt": 0
},
"value": "./image (1).jpg"
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 465,
"end": 488,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 465,
"end": 481,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "UrlValue",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"url": ""
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 494,
"end": 520,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 494,
"end": 510,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "UrlValue",
"span": {
"start": 512,
"end": 520,
"ctxt": 0
},
"url": ""
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 526,
"end": 551,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 526,
"end": 542,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 544,
"end": 551,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 544,
"end": 547,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 548,
"end": 550,
"ctxt": 0
},
"value": ""
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 557,
"end": 588,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 557,
"end": 573,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 575,
"end": 588,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 575,
"end": 578,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 582,
"end": 584,
"ctxt": 0
},
"value": ""
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 594,
"end": 619,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 594,
"end": 610,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 612,
"end": 619,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 612,
"end": 615,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 616,
"end": 618,
"ctxt": 0
},
"value": ""
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 625,
"end": 656,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 625,
"end": 641,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 643,
"end": 656,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 643,
"end": 646,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 650,
"end": 652,
"ctxt": 0
},
"value": ""
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 662,
"end": 694,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 662,
"end": 678,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 680,
"end": 694,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 680,
"end": 683,
"ctxt": 0
},
"value": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 687,
"end": 690,
"ctxt": 0
},
"value": " "
}
]
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 700,
"end": 734,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 700,
"end": 716,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "UrlValue",
"span": {
"start": 718,
"end": 734,
"ctxt": 0
},
"url": "./image.png"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 740,
"end": 780,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 740,
"end": 756,
"ctxt": 0
},
"value": "background-image"
},
"values": [
{
"type": "UrlValue",
"span": {
"start": 758,
"end": 780,
"ctxt": 0
},
"url": "./image.png"
}
],
"important": null
}
]
}
}
]
}