swc/crates/swc_css_parser/tests/fixture/at-rule/document/output.json

1060 lines
28 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 1,
"end": 621,
"ctxt": 0
},
"rules": [
{
"type": "AtRule",
"span": {
"start": 1,
"end": 83,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 2,
"end": 10,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 11,
"end": 43,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 11,
"end": 42,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 14,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 15,
"end": 41,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 43,
"end": 83,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 49,
"end": 81,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"value": "h1",
"raw": "h1"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 52,
"end": 81,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 62,
"end": 74,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 62,
"end": 67,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 69,
"end": 74,
"ctxt": 0
},
"value": "green",
"raw": "green"
}
],
"important": null
}
]
}
}
]
}
},
{
"type": "AtRule",
"span": {
"start": 85,
"end": 300,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 86,
"end": 94,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 95,
"end": 229,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 95,
"end": 120,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 99,
"end": 119,
"ctxt": 0
},
"value": "http://www.w3.org/",
"raw": "\"http://www.w3.org/\""
},
"modifiers": []
},
{
"type": "Function",
"span": {
"start": 122,
"end": 160,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 122,
"end": 132,
"ctxt": 0
},
"value": "url-prefix",
"raw": "url-prefix"
},
"value": [
{
"type": "String",
"span": {
"start": 133,
"end": 159,
"ctxt": 0
},
"value": "http://www.w3.org/Style/",
"raw": "\"http://www.w3.org/Style/\""
}
]
},
{
"type": "Function",
"span": {
"start": 162,
"end": 183,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"value": "domain",
"raw": "domain"
},
"value": [
{
"type": "String",
"span": {
"start": 169,
"end": 182,
"ctxt": 0
},
"value": "mozilla.org",
"raw": "\"mozilla.org\""
}
]
},
{
"type": "Function",
"span": {
"start": 185,
"end": 208,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 185,
"end": 199,
"ctxt": 0
},
"value": "media-document",
"raw": "media-document"
},
"value": [
{
"type": "String",
"span": {
"start": 200,
"end": 207,
"ctxt": 0
},
"value": "video",
"raw": "\"video\""
}
]
},
{
"type": "Function",
"span": {
"start": 210,
"end": 228,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"value": "regexp",
"raw": "regexp"
},
"value": [
{
"type": "String",
"span": {
"start": 217,
"end": 227,
"ctxt": 0
},
"value": "https:.*",
"raw": "\"https:.*\""
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 229,
"end": 300,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 235,
"end": 298,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"value": "body",
"raw": "body"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 240,
"end": 298,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 250,
"end": 263,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 250,
"end": 255,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 257,
"end": 263,
"ctxt": 0
},
"value": "purple",
"raw": "purple"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 273,
"end": 291,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 273,
"end": 283,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "Ident",
"span": {
"start": 285,
"end": 291,
"ctxt": 0
},
"value": "yellow",
"raw": "yellow"
}
],
"important": null
}
]
}
}
]
}
},
{
"type": "AtRule",
"span": {
"start": 302,
"end": 344,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 303,
"end": 311,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 312,
"end": 342,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 312,
"end": 341,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 312,
"end": 315,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 316,
"end": 340,
"ctxt": 0
},
"before": "",
"after": "",
"value": "https://www.example.com/",
"raw": "https://www.example.com/"
},
"modifiers": null
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 342,
"end": 344,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 345,
"end": 394,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 346,
"end": 359,
"ctxt": 0
},
"value": "-moz-document",
"raw": "-moz-document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 360,
"end": 392,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 360,
"end": 391,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 364,
"end": 390,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 392,
"end": 394,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 395,
"end": 464,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 396,
"end": 409,
"ctxt": 0
},
"value": "-moz-document",
"raw": "-moz-document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 433,
"end": 462,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 433,
"end": 453,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 437,
"end": 452,
"ctxt": 0
},
"value": "example.com/{",
"raw": "\"example.com/{\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 462,
"end": 464,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 466,
"end": 620,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 467,
"end": 475,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 476,
"end": 508,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 476,
"end": 507,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 476,
"end": 479,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 480,
"end": 506,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 508,
"end": 620,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "AtRule",
"span": {
"start": 514,
"end": 618,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 515,
"end": 520,
"ctxt": 0
},
"value": "media",
"raw": "media"
},
"prelude": {
"type": "MediaQueryList",
"span": {
"start": 521,
"end": 550,
"ctxt": 0
},
"queries": [
{
"type": "MediaQuery",
"span": {
"start": 521,
"end": 550,
"ctxt": 0
},
"modifier": null,
"mediaType": {
"type": "Ident",
"span": {
"start": 521,
"end": 527,
"ctxt": 0
},
"value": "screen",
"raw": "screen"
},
"keyword": {
"type": "Ident",
"span": {
"start": 528,
"end": 531,
"ctxt": 0
},
"value": "and",
"raw": "and"
},
"condition": {
"type": "MediaConditionWithoutOr",
"span": {
"start": 532,
"end": 550,
"ctxt": 0
},
"conditions": [
{
"type": "MediaFeaturePlain",
"span": {
"start": 532,
"end": 550,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 533,
"end": 542,
"ctxt": 0
},
"value": "min-width",
"raw": "min-width"
},
"value": {
"type": "Length",
"span": {
"start": 544,
"end": 549,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 544,
"end": 547,
"ctxt": 0
},
"value": 900.0,
"raw": "900"
},
"unit": {
"type": "Ident",
"span": {
"start": 547,
"end": 549,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
}
]
}
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 551,
"end": 618,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 561,
"end": 612,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"value": "article",
"raw": "article"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 569,
"end": 612,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 583,
"end": 601,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 583,
"end": 590,
"ctxt": 0
},
"value": "padding",
"raw": "padding"
},
"value": [
{
"type": "Length",
"span": {
"start": 592,
"end": 596,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 592,
"end": 593,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 593,
"end": 596,
"ctxt": 0
},
"value": "rem",
"raw": "rem"
}
},
{
"type": "Length",
"span": {
"start": 597,
"end": 601,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 597,
"end": 598,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
},
"unit": {
"type": "Ident",
"span": {
"start": 598,
"end": 601,
"ctxt": 0
},
"value": "rem",
"raw": "rem"
}
}
],
"important": null
}
]
}
}
]
}
}
]
}
}
]
}