[librsvg/librsvg-2.52: 1/19] Add test cases for display:none and visibility:hidden
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.52: 1/19] Add test cases for display:none and visibility:hidden
- Date: Thu, 17 Feb 2022 03:49:55 +0000 (UTC)
commit 239df23dc3d011c4b13cb9ef2b86d6b1b39585e6
Author: Michael Howell <michael notriddle com>
Date: Tue Dec 21 09:19:47 2021 -0700
Add test cases for display:none and visibility:hidden
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/647>
tests/fixtures/text/display-none-ref.svg | 4 ++++
tests/fixtures/text/display-none.svg | 5 +++++
tests/fixtures/text/visibility-hidden-ref.svg | 5 +++++
tests/fixtures/text/visibility-hidden-x-attr.svg | 4 ++++
tests/fixtures/text/visibility-hidden.svg | 5 +++++
tests/src/text.rs | 18 ++++++++++++++++++
6 files changed, 41 insertions(+)
---
diff --git a/tests/fixtures/text/display-none-ref.svg b/tests/fixtures/text/display-none-ref.svg
new file mode 100644
index 000000000..23e7f9b68
--- /dev/null
+++ b/tests/fixtures/text/display-none-ref.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+ <text style="font: 5px Ahem;" x="5" y="10">X</text>
+ <text style="font: 5px Ahem;" x="5" y="25">XX</text>
+</svg>
\ No newline at end of file
diff --git a/tests/fixtures/text/display-none.svg b/tests/fixtures/text/display-none.svg
new file mode 100644
index 000000000..e5e31689b
--- /dev/null
+++ b/tests/fixtures/text/display-none.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+ <text style="font: 5px Ahem;" x="5" y="10">X<a style="display:none">X</a><tspan
style="display:none">X</tspan></text>
+ <text style="font: 5px Ahem;" x="5" y="25">X<tspan><a style="display:none">X</a><tspan
style="display:none">X<tspan style="display:inline" x="40">X</tspan><tspan style="display:block"
x="45">X</tspan></tspan>X</tspan></text>
+ <text style="font: 5px Ahem; display: none" x="5" y="40">XXXXXX</text>
+</svg>
\ No newline at end of file
diff --git a/tests/fixtures/text/visibility-hidden-ref.svg b/tests/fixtures/text/visibility-hidden-ref.svg
new file mode 100644
index 000000000..162bf42e1
--- /dev/null
+++ b/tests/fixtures/text/visibility-hidden-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+ <text style="font: 5px Ahem;" x="5" y="10">X</text>
+ <text style="font: 5px Ahem;" x="5" y="25">X</text>
+ <text style="font: 5px Ahem;" x="20" y="25">X</text>
+</svg>
\ No newline at end of file
diff --git a/tests/fixtures/text/visibility-hidden-x-attr.svg
b/tests/fixtures/text/visibility-hidden-x-attr.svg
new file mode 100644
index 000000000..6007de952
--- /dev/null
+++ b/tests/fixtures/text/visibility-hidden-x-attr.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+ <text style="font: 5px Ahem;" x="5" y="10">X<tspan x="10" style="visibility:hidden">X</tspan><tspan
style="visibility:hidden"><tspan x="15">X</tspan></tspan></text>
+ <text style="font: 5px Ahem;" x="5" y="25">X<tspan><tspan x="10" y="25"
style="visibility:hidden">X</tspan><tspan x="15" style="visibility:hidden">X</tspan><tspan
x="20">X</tspan></tspan></text>
+</svg>
\ No newline at end of file
diff --git a/tests/fixtures/text/visibility-hidden.svg b/tests/fixtures/text/visibility-hidden.svg
new file mode 100644
index 000000000..b39312f5e
--- /dev/null
+++ b/tests/fixtures/text/visibility-hidden.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+ <text style="font: 5px Ahem;" x="5" y="10">X<a style="visibility:hidden">X</a><tspan
style="visibility:hidden">X</tspan></text>
+ <text style="font: 5px Ahem;" x="5" y="25">X<tspan><a style="visibility:hidden">X</a><tspan
style="visibility:hidden">X</tspan>X</tspan></text>
+ <text style="font: 5px Ahem; visibility: hidden" x="5" y="40">XXXXXX</text>
+</svg>
\ No newline at end of file
diff --git a/tests/src/text.rs b/tests/src/text.rs
index 07d77801d..4596cf716 100644
--- a/tests/src/text.rs
+++ b/tests/src/text.rs
@@ -51,3 +51,21 @@ test_svg_reference!(
"tests/fixtures/text/unicode-bidi-override.svg",
"tests/fixtures/text/unicode-bidi-override-ref.svg"
);
+
+test_svg_reference!(
+ display_none,
+ "tests/fixtures/text/display-none.svg",
+ "tests/fixtures/text/display-none-ref.svg"
+);
+
+test_svg_reference!(
+ visibility_hidden,
+ "tests/fixtures/text/visibility-hidden.svg",
+ "tests/fixtures/text/visibility-hidden-ref.svg"
+);
+
+test_svg_reference!(
+ visibility_hidden_x_attr,
+ "tests/fixtures/text/visibility-hidden-x-attr.svg",
+ "tests/fixtures/text/visibility-hidden-ref.svg"
+);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]