summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2021-10-22 16:35:41 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2021-10-22 16:35:41 +0000
commit2b2fd23815739c099bee061d3478750801fde73f (patch)
tree50dc91840ebdc9feae5a3793c9eabbb0225cc8c6 /testsuite
parent82c0654f769b678cbeea77d3fb0fa1a102141a77 (diff)
parent2113a18a18a81e4df2e92138ee44cad8e5a3c330 (diff)
downloadgtk+-2b2fd23815739c099bee061d3478750801fde73f.tar.gz
Merge branch 'wip/otte/center-center-center' into 'master'
Add a bunch of reftests and fix their failures Closes #4285 See merge request GNOME/gtk!4085
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-100x200.css15
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-100x200.ref.ui9
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-100x200.ui24
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-200x100.css15
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-200x100.ref.ui9
-rw-r--r--testsuite/reftests/center-center-100x100-picture-in-200x100.ui24
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-100x200.css15
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-100x200.ref.ui9
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-100x200.ui24
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-200x100.css15
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-200x100.ref.ui9
-rw-r--r--testsuite/reftests/center-center-150x150-picture-in-200x100.ui24
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-100x200.css15
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-100x200.ref.ui9
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-100x200.ui24
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-200x100.css15
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-200x100.ref.ui9
-rw-r--r--testsuite/reftests/center-center-200x200-picture-in-200x100.ui24
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-100x200.css15
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-100x200.ref.ui9
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-100x200.ui24
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-200x100.css15
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-200x100.ref.ui9
-rw-r--r--testsuite/reftests/center-center-20x20-picture-in-200x100.ui24
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-100x200.css15
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-100x200.ref.ui9
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-100x200.ui24
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-200x100.css15
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-200x100.ref.ui9
-rw-r--r--testsuite/reftests/center-center-300x300-picture-in-200x100.ui24
-rw-r--r--testsuite/reftests/green-100x100.pngbin0 -> 215 bytes
-rw-r--r--testsuite/reftests/green-150x150.pngbin0 -> 296 bytes
-rw-r--r--testsuite/reftests/green-200x200.pngbin0 -> 427 bytes
-rw-r--r--testsuite/reftests/green-300x300.pngbin0 -> 687 bytes
-rw-r--r--testsuite/reftests/gtk-reftest.c5
-rw-r--r--testsuite/reftests/meson.build30
36 files changed, 514 insertions, 1 deletions
diff --git a/testsuite/reftests/center-center-100x100-picture-in-100x200.css b/testsuite/reftests/center-center-100x100-picture-in-100x200.css
new file mode 100644
index 0000000000..e496fc2d82
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-100x200.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 100px 100px;
+}
diff --git a/testsuite/reftests/center-center-100x100-picture-in-100x200.ref.ui b/testsuite/reftests/center-center-100x100-picture-in-100x200.ref.ui
new file mode 100644
index 0000000000..9521d560cb
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-100x200.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-100x100-picture-in-100x200.ui b/testsuite/reftests/center-center-100x100-picture-in-100x200.ui
new file mode 100644
index 0000000000..5826455256
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-100x200.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-100x100.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-100x100-picture-in-200x100.css b/testsuite/reftests/center-center-100x100-picture-in-200x100.css
new file mode 100644
index 0000000000..e496fc2d82
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-200x100.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 100px 100px;
+}
diff --git a/testsuite/reftests/center-center-100x100-picture-in-200x100.ref.ui b/testsuite/reftests/center-center-100x100-picture-in-200x100.ref.ui
new file mode 100644
index 0000000000..e06f2b02dd
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-200x100.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-100x100-picture-in-200x100.ui b/testsuite/reftests/center-center-100x100-picture-in-200x100.ui
new file mode 100644
index 0000000000..06a17662a3
--- /dev/null
+++ b/testsuite/reftests/center-center-100x100-picture-in-200x100.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-100x100.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-150x150-picture-in-100x200.css b/testsuite/reftests/center-center-150x150-picture-in-100x200.css
new file mode 100644
index 0000000000..adbc2cbedc
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-100x200.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 150px 150px;
+}
diff --git a/testsuite/reftests/center-center-150x150-picture-in-100x200.ref.ui b/testsuite/reftests/center-center-150x150-picture-in-100x200.ref.ui
new file mode 100644
index 0000000000..9521d560cb
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-100x200.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-150x150-picture-in-100x200.ui b/testsuite/reftests/center-center-150x150-picture-in-100x200.ui
new file mode 100644
index 0000000000..9f02233bbd
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-100x200.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-150x150.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-150x150-picture-in-200x100.css b/testsuite/reftests/center-center-150x150-picture-in-200x100.css
new file mode 100644
index 0000000000..adbc2cbedc
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-200x100.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 150px 150px;
+}
diff --git a/testsuite/reftests/center-center-150x150-picture-in-200x100.ref.ui b/testsuite/reftests/center-center-150x150-picture-in-200x100.ref.ui
new file mode 100644
index 0000000000..e06f2b02dd
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-200x100.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-150x150-picture-in-200x100.ui b/testsuite/reftests/center-center-150x150-picture-in-200x100.ui
new file mode 100644
index 0000000000..1213e9249e
--- /dev/null
+++ b/testsuite/reftests/center-center-150x150-picture-in-200x100.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-150x150.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-200x200-picture-in-100x200.css b/testsuite/reftests/center-center-200x200-picture-in-100x200.css
new file mode 100644
index 0000000000..cb3b17ba09
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-100x200.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 200px 200px;
+}
diff --git a/testsuite/reftests/center-center-200x200-picture-in-100x200.ref.ui b/testsuite/reftests/center-center-200x200-picture-in-100x200.ref.ui
new file mode 100644
index 0000000000..9521d560cb
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-100x200.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-200x200-picture-in-100x200.ui b/testsuite/reftests/center-center-200x200-picture-in-100x200.ui
new file mode 100644
index 0000000000..f15b48b5d5
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-100x200.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-200x200.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-200x200-picture-in-200x100.css b/testsuite/reftests/center-center-200x200-picture-in-200x100.css
new file mode 100644
index 0000000000..cb3b17ba09
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-200x100.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 200px 200px;
+}
diff --git a/testsuite/reftests/center-center-200x200-picture-in-200x100.ref.ui b/testsuite/reftests/center-center-200x200-picture-in-200x100.ref.ui
new file mode 100644
index 0000000000..e06f2b02dd
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-200x100.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-200x200-picture-in-200x100.ui b/testsuite/reftests/center-center-200x200-picture-in-200x100.ui
new file mode 100644
index 0000000000..6e787008fa
--- /dev/null
+++ b/testsuite/reftests/center-center-200x200-picture-in-200x100.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-200x200.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-20x20-picture-in-100x200.css b/testsuite/reftests/center-center-20x20-picture-in-100x200.css
new file mode 100644
index 0000000000..2756ae7d64
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-100x200.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 20px 20px;
+}
diff --git a/testsuite/reftests/center-center-20x20-picture-in-100x200.ref.ui b/testsuite/reftests/center-center-20x20-picture-in-100x200.ref.ui
new file mode 100644
index 0000000000..9521d560cb
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-100x200.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-20x20-picture-in-100x200.ui b/testsuite/reftests/center-center-20x20-picture-in-100x200.ui
new file mode 100644
index 0000000000..55177f2749
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-100x200.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-20x20.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-20x20-picture-in-200x100.css b/testsuite/reftests/center-center-20x20-picture-in-200x100.css
new file mode 100644
index 0000000000..2756ae7d64
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-200x100.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 20px 20px;
+}
diff --git a/testsuite/reftests/center-center-20x20-picture-in-200x100.ref.ui b/testsuite/reftests/center-center-20x20-picture-in-200x100.ref.ui
new file mode 100644
index 0000000000..e06f2b02dd
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-200x100.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-20x20-picture-in-200x100.ui b/testsuite/reftests/center-center-20x20-picture-in-200x100.ui
new file mode 100644
index 0000000000..e5835423fb
--- /dev/null
+++ b/testsuite/reftests/center-center-20x20-picture-in-200x100.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-20x20.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-300x300-picture-in-100x200.css b/testsuite/reftests/center-center-300x300-picture-in-100x200.css
new file mode 100644
index 0000000000..5b067dd562
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-100x200.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 300px 300px;
+}
diff --git a/testsuite/reftests/center-center-300x300-picture-in-100x200.ref.ui b/testsuite/reftests/center-center-300x300-picture-in-100x200.ref.ui
new file mode 100644
index 0000000000..9521d560cb
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-100x200.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-300x300-picture-in-100x200.ui b/testsuite/reftests/center-center-300x300-picture-in-100x200.ui
new file mode 100644
index 0000000000..2fff2c91d3
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-100x200.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-300x300.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-300x300-picture-in-200x100.css b/testsuite/reftests/center-center-300x300-picture-in-200x100.css
new file mode 100644
index 0000000000..5b067dd562
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-200x100.css
@@ -0,0 +1,15 @@
+* {
+ all: unset;
+ background-color: mintcream;
+}
+
+picture {
+ background-color: firebrick;
+}
+
+#reference {
+ background-image: image(lime);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 300px 300px;
+}
diff --git a/testsuite/reftests/center-center-300x300-picture-in-200x100.ref.ui b/testsuite/reftests/center-center-300x300-picture-in-200x100.ref.ui
new file mode 100644
index 0000000000..e06f2b02dd
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-200x100.ref.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="name">reference</property>
+ <property name="decorated">0</property>
+ </object>
+</interface>
diff --git a/testsuite/reftests/center-center-300x300-picture-in-200x100.ui b/testsuite/reftests/center-center-300x300-picture-in-200x100.ui
new file mode 100644
index 0000000000..5c2e1735e6
--- /dev/null
+++ b/testsuite/reftests/center-center-300x300-picture-in-200x100.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="width_request">200</property>
+ <property name="height_request">100</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkOverlay">
+ <child type="overlay">
+ <object class="GtkPicture">
+ <property name="paintable">green-300x300.png</property>
+ <property name="keep-aspect-ratio">0</property>
+ <property name="can-shrink">1</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <layout>
+ <property name="measure">0</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/green-100x100.png b/testsuite/reftests/green-100x100.png
new file mode 100644
index 0000000000..b23bbba154
--- /dev/null
+++ b/testsuite/reftests/green-100x100.png
Binary files differ
diff --git a/testsuite/reftests/green-150x150.png b/testsuite/reftests/green-150x150.png
new file mode 100644
index 0000000000..c2139e0219
--- /dev/null
+++ b/testsuite/reftests/green-150x150.png
Binary files differ
diff --git a/testsuite/reftests/green-200x200.png b/testsuite/reftests/green-200x200.png
new file mode 100644
index 0000000000..34baf2abe6
--- /dev/null
+++ b/testsuite/reftests/green-200x200.png
Binary files differ
diff --git a/testsuite/reftests/green-300x300.png b/testsuite/reftests/green-300x300.png
new file mode 100644
index 0000000000..2151a0b0e7
--- /dev/null
+++ b/testsuite/reftests/green-300x300.png
Binary files differ
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 2bf3fcc5f8..b3f9774c73 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -311,7 +311,10 @@ save_node (GskRenderNode *node,
}
g_test_message ("Storing test result node at %s", filename);
- bytes = gsk_render_node_serialize (node);
+ if (node)
+ bytes = gsk_render_node_serialize (node);
+ else
+ bytes = g_bytes_new ("", 0);
ret = g_file_set_contents (filename,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes),
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 4a84e1de72..8e1b8bd501 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -170,6 +170,36 @@ testdata = [
'box-shadow-with-blend-mode.ui',
'button-wrapping.ui',
'button-wrapping.ref.ui',
+ 'center-center-100x100-picture-in-100x200.css',
+ 'center-center-100x100-picture-in-100x200.ref.ui',
+ 'center-center-100x100-picture-in-100x200.ui',
+ 'center-center-100x100-picture-in-200x100.css',
+ 'center-center-100x100-picture-in-200x100.ref.ui',
+ 'center-center-100x100-picture-in-200x100.ui',
+ 'center-center-150x150-picture-in-100x200.css',
+ 'center-center-150x150-picture-in-100x200.ref.ui',
+ 'center-center-150x150-picture-in-100x200.ui',
+ 'center-center-150x150-picture-in-200x100.css',
+ 'center-center-150x150-picture-in-200x100.ref.ui',
+ 'center-center-150x150-picture-in-200x100.ui',
+ 'center-center-200x200-picture-in-100x200.css',
+ 'center-center-200x200-picture-in-100x200.ref.ui',
+ 'center-center-200x200-picture-in-100x200.ui',
+ 'center-center-200x200-picture-in-200x100.css',
+ 'center-center-200x200-picture-in-200x100.ref.ui',
+ 'center-center-200x200-picture-in-200x100.ui',
+ 'center-center-20x20-picture-in-100x200.css',
+ 'center-center-20x20-picture-in-100x200.ref.ui',
+ 'center-center-20x20-picture-in-100x200.ui',
+ 'center-center-20x20-picture-in-200x100.css',
+ 'center-center-20x20-picture-in-200x100.ref.ui',
+ 'center-center-20x20-picture-in-200x100.ui',
+ 'center-center-300x300-picture-in-100x200.css',
+ 'center-center-300x300-picture-in-100x200.ref.ui',
+ 'center-center-300x300-picture-in-100x200.ui',
+ 'center-center-300x300-picture-in-200x100.css',
+ 'center-center-300x300-picture-in-200x100.ref.ui',
+ 'center-center-300x300-picture-in-200x100.ui',
'centerlayout-invisible-child.css',
'centerlayout-invisible-child.ref.ui',
'centerlayout-invisible-child.ui',