[librsvg: 4/8] Test for 100% width/height with no viewBox




commit 2e5febf8d867034bc833961739d360ac10dbd3bb
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 30 17:33:24 2021 -0500

    Test for 100% width/height with no viewBox
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/595>

 tests/src/legacy_sizing.rs | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/tests/src/legacy_sizing.rs b/tests/src/legacy_sizing.rs
index 02588496..f36cccff 100644
--- a/tests/src/legacy_sizing.rs
+++ b/tests/src/legacy_sizing.rs
@@ -83,3 +83,31 @@ fn hundred_percent_width_height_uses_viewbox() {
          })
     );
 }
+
+#[test]
+fn hundred_percent_width_height_no_viewbox_uses_element_geometries() {
+    let svg = load_svg(
+        br#"<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="100%" height="100%">
+  <rect x="10" y="20" width="30" height="40" fill="black"/>
+</svg>
+"#,
+    )
+        .unwrap();
+
+    assert_eq!(
+        CairoRenderer::new(&svg).legacy_layer_geometry(None).unwrap(),
+        (cairo::Rectangle {
+            x: 10.0,
+            y: 20.0,
+            width: 30.0,
+            height: 40.0,
+        },
+         cairo::Rectangle {
+             x: 10.0,
+             y: 20.0,
+             width: 30.0,
+             height: 40.0,
+         })
+    );
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]