test(pdf): R3 O4 corpus edge cases (Number() values, namespaces, BOM, refused subtrees); roxmltree dependency

This commit is contained in:
bchanot committed 2026-10-14 23:34:34 +02:00
1 parent 5f53aaa222
commit e3168215f7
11 files changed
+206 -1

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ ts = ["dep:ts-rs"]
serde.workspace = true
serde_json.workspace = true
url.workspace = true
roxmltree.workspace = true
ts-rs = { workspace = true, optional = true }
[lints]
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg"><g id="osteo-halo"/><path d="M0 0h1"/></svg>

After

Width:  |  Height:  |  Size: 84 B

@@ -0,0 +1 @@
<s:svg xmlns:s="http://www.w3.org/2000/svg"><s:path d="M0 0h1"/></s:svg>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg"><metadata><rdf>x</rdf></metadata><text><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan><tspan>x</tspan></text><path d="M0 0h1"/></svg>

After

Width:  |  Height:  |  Size: 590 B

@@ -0,0 +1 @@
<svg><path d="M0 0h1"/></svg>

After

Width:  |  Height:  |  Size: 29 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg"><filter id="f"><feGaussianBlur stdDeviation="500 3"/><feGaussianBlur stdDeviation="NaN"/><feGaussianBlur stdDeviation="2.5"/></filter></svg>
<svg xmlns="http://www.w3.org/2000/svg"><filter id="f"><feGaussianBlur stdDeviation="500 3"/><feGaussianBlur stdDeviation="NaN"/><feGaussianBlur stdDeviation="2.5"/><feGaussianBlur stdDeviation="0x10 5"/><feGaussianBlur stdDeviation="Infinity"/><feGaussianBlur stdDeviation="+5,1e3"/><feGaussianBlur stdDeviation=""/><feGaussianBlur stdDeviation=" 200 , 1_0"/><feGaussianBlur stdDeviation="1e-7 150.5"/></filter></svg>

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 418 B

@@ -0,0 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg"><title>a b
c</title><path d="M0 0h1" id="t&#9;x" class="a&#10;b"/></svg>

After

Width:  |  Height:  |  Size: 112 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:x="http://www.w3.org/1999/xlink"><linearGradient id="a"/><linearGradient id="b" x:href="#a"/></svg>

After

Width:  |  Height:  |  Size: 145 B

+183
View File
@@ -496,6 +496,80 @@
"not-svg.svg": {
"rejected": "not_svg"
},
"osteo-halo-id.svg": {
"removed": [],
"tree": {
"ns": "http://www.w3.org/2000/svg",
"name": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"ns": "http://www.w3.org/2000/svg",
"name": "g",
"attrs": {
"id": "osteo-halo"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "path",
"attrs": {
"d": "M0 0h1"
},
"children": []
}
]
}
},
"prefixed-root.svg": {
"rejected": "not_svg"
},
"refused-subtrees.svg": {
"removed": [
"metadata",
"text"
],
"tree": {
"ns": "http://www.w3.org/2000/svg",
"name": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"ns": "http://www.w3.org/2000/svg",
"name": "path",
"attrs": {
"d": "M0 0h1"
},
"children": []
}
]
}
},
"root-without-namespace.svg": {
"removed": [],
"tree": {
"ns": "http://www.w3.org/2000/svg",
"name": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"ns": "http://www.w3.org/2000/svg",
"name": "path",
"attrs": {
"d": "M0 0h1"
},
"children": []
}
]
}
},
"script-urls.svg": {
"removed": [
"a",
@@ -589,6 +663,52 @@
"stdDeviation": "2.5"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {
"stdDeviation": "0x10 5"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {
"stdDeviation": "100"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {
"stdDeviation": "5 100"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {
"stdDeviation": ""
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "feGaussianBlur",
"attrs": {
"stdDeviation": "1e-7 100"
},
"children": []
}
]
}
@@ -718,8 +838,71 @@
]
}
},
"whitespace-references.svg": {
"removed": [],
"tree": {
"ns": "http://www.w3.org/2000/svg",
"name": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"ns": "http://www.w3.org/2000/svg",
"name": "title",
"attrs": {},
"children": [
{
"text": "a\tb\nc"
}
]
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "path",
"attrs": {
"class": "a\nb",
"d": "M0 0h1",
"id": "t\tx"
},
"children": []
}
]
}
},
"wrong-root-namespace.svg": {
"rejected": "not_svg"
},
"xlink-other-prefix.svg": {
"removed": [
"svg@xmlns:x",
"linearGradient@x:href"
],
"tree": {
"ns": "http://www.w3.org/2000/svg",
"name": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"ns": "http://www.w3.org/2000/svg",
"name": "linearGradient",
"attrs": {
"id": "a"
},
"children": []
},
{
"ns": "http://www.w3.org/2000/svg",
"name": "linearGradient",
"attrs": {
"id": "b"
},
"children": []
}
]
}
}
},
"specs": [