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

1060 lines
28 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 620,
"ctxt": 0
},
"rules": [
{
"type": "AtRule",
"span": {
"start": 0,
"end": 82,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 1,
"end": 9,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 10,
"end": 42,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 10,
"end": 41,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 14,
"end": 40,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 42,
"end": 82,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 48,
"end": 80,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"value": "h1",
"raw": "h1"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 51,
"end": 80,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 61,
"end": 73,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 61,
"end": 66,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 68,
"end": 73,
"ctxt": 0
},
"value": "green",
"raw": "green"
}
],
"important": null
}
]
}
}
]
}
},
{
"type": "AtRule",
"span": {
"start": 84,
"end": 299,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 85,
"end": 93,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 94,
"end": 228,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 94,
"end": 119,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 98,
"end": 118,
"ctxt": 0
},
"value": "http://www.w3.org/",
"raw": "\"http://www.w3.org/\""
},
"modifiers": []
},
{
"type": "Function",
"span": {
"start": 121,
"end": 159,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 121,
"end": 131,
"ctxt": 0
},
"value": "url-prefix",
"raw": "url-prefix"
},
"value": [
{
"type": "String",
"span": {
"start": 132,
"end": 158,
"ctxt": 0
},
"value": "http://www.w3.org/Style/",
"raw": "\"http://www.w3.org/Style/\""
}
]
},
{
"type": "Function",
"span": {
"start": 161,
"end": 182,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"value": "domain",
"raw": "domain"
},
"value": [
{
"type": "String",
"span": {
"start": 168,
"end": 181,
"ctxt": 0
},
"value": "mozilla.org",
"raw": "\"mozilla.org\""
}
]
},
{
"type": "Function",
"span": {
"start": 184,
"end": 207,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 184,
"end": 198,
"ctxt": 0
},
"value": "media-document",
"raw": "media-document"
},
"value": [
{
"type": "String",
"span": {
"start": 199,
"end": 206,
"ctxt": 0
},
"value": "video",
"raw": "\"video\""
}
]
},
{
"type": "Function",
"span": {
"start": 209,
"end": 227,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 209,
"end": 215,
"ctxt": 0
},
"value": "regexp",
"raw": "regexp"
},
"value": [
{
"type": "String",
"span": {
"start": 216,
"end": 226,
"ctxt": 0
},
"value": "https:.*",
"raw": "\"https:.*\""
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 228,
"end": 299,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 234,
"end": 297,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"value": "body",
"raw": "body"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 239,
"end": 297,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 249,
"end": 262,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 249,
"end": 254,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 256,
"end": 262,
"ctxt": 0
},
"value": "purple",
"raw": "purple"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 272,
"end": 290,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 272,
"end": 282,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "Ident",
"span": {
"start": 284,
"end": 290,
"ctxt": 0
},
"value": "yellow",
"raw": "yellow"
}
],
"important": null
}
]
}
}
]
}
},
{
"type": "AtRule",
"span": {
"start": 301,
"end": 343,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 302,
"end": 310,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 311,
"end": 341,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 311,
"end": 340,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 311,
"end": 314,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 315,
"end": 339,
"ctxt": 0
},
"before": "",
"after": "",
"value": "https://www.example.com/",
"raw": "https://www.example.com/"
},
"modifiers": null
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 341,
"end": 343,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 344,
"end": 393,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 345,
"end": 358,
"ctxt": 0
},
"value": "-moz-document",
"raw": "-moz-document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 359,
"end": 391,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 359,
"end": 390,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 359,
"end": 362,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 363,
"end": 389,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 391,
"end": 393,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 394,
"end": 463,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 395,
"end": 408,
"ctxt": 0
},
"value": "-moz-document",
"raw": "-moz-document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 432,
"end": 461,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 432,
"end": 452,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 432,
"end": 435,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 436,
"end": 451,
"ctxt": 0
},
"value": "example.com/{",
"raw": "\"example.com/{\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 461,
"end": 463,
"ctxt": 0
},
"name": "{",
"value": []
}
},
{
"type": "AtRule",
"span": {
"start": 465,
"end": 619,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 466,
"end": 474,
"ctxt": 0
},
"value": "document",
"raw": "document"
},
"prelude": {
"type": "DocumentPrelude",
"span": {
"start": 475,
"end": 507,
"ctxt": 0
},
"matchingFunctions": [
{
"type": "Url",
"span": {
"start": 475,
"end": 506,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 475,
"end": 478,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "String",
"span": {
"start": 479,
"end": 505,
"ctxt": 0
},
"value": "https://www.example.com/",
"raw": "\"https://www.example.com/\""
},
"modifiers": []
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 507,
"end": 619,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "AtRule",
"span": {
"start": 513,
"end": 617,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 514,
"end": 519,
"ctxt": 0
},
"value": "media",
"raw": "media"
},
"prelude": {
"type": "MediaQueryList",
"span": {
"start": 520,
"end": 549,
"ctxt": 0
},
"queries": [
{
"type": "MediaQuery",
"span": {
"start": 520,
"end": 549,
"ctxt": 0
},
"modifier": null,
"mediaType": {
"type": "Ident",
"span": {
"start": 520,
"end": 526,
"ctxt": 0
},
"value": "screen",
"raw": "screen"
},
"keyword": {
"type": "Ident",
"span": {
"start": 527,
"end": 530,
"ctxt": 0
},
"value": "and",
"raw": "and"
},
"condition": {
"type": "MediaConditionWithoutOr",
"span": {
"start": 531,
"end": 549,
"ctxt": 0
},
"conditions": [
{
"type": "MediaFeaturePlain",
"span": {
"start": 531,
"end": 549,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 532,
"end": 541,
"ctxt": 0
},
"value": "min-width",
"raw": "min-width"
},
"value": {
"type": "Length",
"span": {
"start": 543,
"end": 548,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 543,
"end": 546,
"ctxt": 0
},
"value": 900.0,
"raw": "900"
},
"unit": {
"type": "Ident",
"span": {
"start": 546,
"end": 548,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
}
]
}
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 550,
"end": 617,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "QualifiedRule",
"span": {
"start": 560,
"end": 611,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 560,
"end": 567,
"ctxt": 0
},
"value": "article",
"raw": "article"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 568,
"end": 611,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 582,
"end": 600,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 582,
"end": 589,
"ctxt": 0
},
"value": "padding",
"raw": "padding"
},
"value": [
{
"type": "Length",
"span": {
"start": 591,
"end": 595,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 591,
"end": 592,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 592,
"end": 595,
"ctxt": 0
},
"value": "rem",
"raw": "rem"
}
},
{
"type": "Length",
"span": {
"start": 596,
"end": 600,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 596,
"end": 597,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
},
"unit": {
"type": "Ident",
"span": {
"start": 597,
"end": 600,
"ctxt": 0
},
"value": "rem",
"raw": "rem"
}
}
],
"important": null
}
]
}
}
]
}
}
]
}
}
]
}