testsuite/gsk: add explicit dimensions to <svg> elements

Without an explicit width, height, and viewBox, there is no single
correct way to render an SVG. In the absense of said information,
librsvg is capable of making a guess by rendering the SVG to a Cairo
surface and then analyzing that surface; however, this process is
merely heuristic.

There are three GTK tests for SVG images that are missing dimensions.
While this is not a violation of the SVG specification, it does
implicitly couple the test to the librsvg rendering heuristic. In this
commit we add that dimension information so that the expected result
is unambiguous.
This commit is contained in:
Michael Orlitzky
2023-08-28 15:27:46 -04:00
committed by Matthias Clasen
parent 6171070153
commit 2eb6194604
3 changed files with 6 additions and 6 deletions

View File

@@ -3,6 +3,6 @@ clip {
child: texture-scale {
bounds: 0 0 19991 19991;
filter: nearest;
texture: url('data:,<svg><rect width="10" height="10" style="fill:red" /></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red" /></svg>');
}
}

View File

@@ -7,5 +7,5 @@ color {
texture {
bounds: 10 10 30 30;
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red"/></svg>');
}

View File

@@ -1,22 +1,22 @@
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: linear;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: nearest;
}
texture-scale {
texture: url('data:,<svg><rect width="10" height="10" style="fill:red"/></svg>');
texture: url('data:,<svg width="10" height="10" viewBox="0 0 10 10"><rect width="10" height="10" style="fill:red"/></svg>');
bounds: 0 0 50 50;
filter: trilinear;
}