diff --git a/css/parser/tests/fixture/bom/input.css b/css/parser/tests/fixture/bom/input.css new file mode 100644 index 000000000000..3050dc54d847 --- /dev/null +++ b/css/parser/tests/fixture/bom/input.css @@ -0,0 +1,3 @@ +a { + color: red; +} \ No newline at end of file diff --git a/css/parser/tests/fixture/bom/output.json b/css/parser/tests/fixture/bom/output.json new file mode 100644 index 000000000000..de01089991a0 --- /dev/null +++ b/css/parser/tests/fixture/bom/output.json @@ -0,0 +1,108 @@ +{ + "type": "Stylesheet", + "span": { + "start": 0, + "end": 21, + "ctxt": 0 + }, + "rules": [ + { + "type": "StyleRule", + "span": { + "start": 0, + "end": 21, + "ctxt": 0 + }, + "selectors": { + "type": "SelectorList", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": { + "type": "TypeSelector", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "prefix": null, + "name": { + "type": "Text", + "span": { + "start": 0, + "end": 1, + "ctxt": 0 + }, + "value": "a", + "raw": "a" + } + }, + "subclassSelectors": [] + } + ] + } + ] + }, + "block": { + "type": "Block", + "span": { + "start": 2, + "end": 21, + "ctxt": 0 + }, + "items": [ + { + "type": "Declaration", + "span": { + "start": 8, + "end": 18, + "ctxt": 0 + }, + "property": { + "type": "Text", + "span": { + "start": 8, + "end": 13, + "ctxt": 0 + }, + "value": "color", + "raw": "color" + }, + "value": [ + { + "type": "Text", + "span": { + "start": 15, + "end": 18, + "ctxt": 0 + }, + "value": "red", + "raw": "red" + } + ], + "important": null + } + ] + } + } + ] +} diff --git a/css/parser/tests/fixture/bom/span.rust-debug b/css/parser/tests/fixture/bom/span.rust-debug new file mode 100644 index 000000000000..71823b4c13d3 --- /dev/null +++ b/css/parser/tests/fixture/bom/span.rust-debug @@ -0,0 +1,87 @@ +error: Stylesheet + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | / a { +2 | | color: red; +3 | | } + | |_^ + +error: Rule + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | / a { +2 | | color: red; +3 | | } + | |_^ + +error: StyleRule + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | / a { +2 | | color: red; +3 | | } + | |_^ + +error: SelectorList + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: ComplexSelector + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: CompoundSelector + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: TypeSelector + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: Text + --> $DIR/tests/fixture/bom/input.css:1:1 + | +1 | a { + | ^ + +error: Block + --> $DIR/tests/fixture/bom/input.css:1:3 + | +1 | a { + | ___^ +2 | | color: red; +3 | | } + | |_^ + +error: Declaration + --> $DIR/tests/fixture/bom/input.css:2:5 + | +2 | color: red; + | ^^^^^^^^^^ + +error: Text + --> $DIR/tests/fixture/bom/input.css:2:5 + | +2 | color: red; + | ^^^^^ + +error: Value + --> $DIR/tests/fixture/bom/input.css:2:12 + | +2 | color: red; + | ^^^ + +error: Text + --> $DIR/tests/fixture/bom/input.css:2:12 + | +2 | color: red; + | ^^^ +