diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am
index 5e83d08e41..4fdc7dd3e6 100644
--- a/tests/reftests/Makefile.am
+++ b/tests/reftests/Makefile.am
@@ -29,6 +29,9 @@ EXTRA_DIST += \
box-packing.css \
box-packing.ref.ui \
box-packing.ui \
+ css-match-name.css \
+ css-match-name.ref.ui \
+ css-match-name.ui \
css-match-subtype.css \
css-match-subtype.ref.ui \
css-match-subtype.ui \
diff --git a/tests/reftests/css-match-name.css b/tests/reftests/css-match-name.css
new file mode 100644
index 0000000000..98607a0f58
--- /dev/null
+++ b/tests/reftests/css-match-name.css
@@ -0,0 +1,15 @@
+#window {
+ engine: none;
+ background-image: none;
+ background-color: green;
+ border-radius: 0;
+ border-style: none;
+}
+
+#nowindow {
+ background-color: red;
+}
+
+#window#nowindow {
+ background-color: blue;
+}
diff --git a/tests/reftests/css-match-name.ref.ui b/tests/reftests/css-match-name.ref.ui
new file mode 100644
index 0000000000..d8d31c3e93
--- /dev/null
+++ b/tests/reftests/css-match-name.ref.ui
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/tests/reftests/css-match-name.ui b/tests/reftests/css-match-name.ui
new file mode 100644
index 0000000000..ee6db3afc7
--- /dev/null
+++ b/tests/reftests/css-match-name.ui
@@ -0,0 +1,14 @@
+
+
+
+
+ 20
+ 20
+ False
+ popup
+ window
+
+
+