[gtk+] reftests: Add a test for inset box-shadow



commit a1d19be950ea756f115319e3fecc139926477ef5
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jun 11 08:42:05 2011 +0200

    reftests: Add a test for inset box-shadow
    
    This test is copied from the CSS spec. The reference is very sensitive
    to the rendering algorithm in use, because the rounded corners have
    semi-transparent pixels. It might be necessary to update them in the
    future.

 tests/reftests/Makefile.am                  |    3 +
 tests/reftests/box-shadow-spec-inset.css    |   65 ++++++
 tests/reftests/box-shadow-spec-inset.ref.ui |  330 +++++++++++++++++++++++++++
 tests/reftests/box-shadow-spec-inset.ui     |  124 ++++++++++
 4 files changed, 522 insertions(+), 0 deletions(-)
---
diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am
index 2dccc4f..e0b6a0b 100644
--- a/tests/reftests/Makefile.am
+++ b/tests/reftests/Makefile.am
@@ -54,6 +54,9 @@ EXTRA_DIST += \
 	box-pseudo-classes.css \
 	box-pseudo-classes.ref.ui \
 	box-pseudo-classes.ui \
+	box-shadow-spec-inset.css \
+	box-shadow-spec-inset.ref.ui \
+	box-shadow-spec-inset.ui \
 	css-match-class.css \
 	css-match-class.ref.ui \
 	css-match-class.ui \
diff --git a/tests/reftests/box-shadow-spec-inset.css b/tests/reftests/box-shadow-spec-inset.css
new file mode 100644
index 0000000..6d63148
--- /dev/null
+++ b/tests/reftests/box-shadow-spec-inset.css
@@ -0,0 +1,65 @@
+GtkButton {
+  engine: none;
+  border-radius: 0;
+  background-image: none;
+  border-image: none;
+  border-style: none;
+  background-color: rgba(0, 0, 0, 0);
+}
+
+.row1, .row2, .row3 {
+  /*border:5px solid blue;*/
+  border-width: 5;
+  border-style: solid;
+  border-color: blue;
+  background-color:orange;
+}
+
+.column1 {
+  border-radius: 20/*px*/;
+}
+
+.column2 {
+  border-radius: 0;
+}
+
+.row2 {
+  box-shadow:
+    rgba(0,0,0,1)
+    15/*px*/ 15/*px*/
+    inset
+}
+
+.row3 {
+  box-shadow:
+    rgba(0,0,0,1)
+    15/*px*/ 15/*px*/ 0
+    10/*px*/ /*spread*/
+    inset
+}
+
+.reference-border {
+  border-width: 5;
+  border-style: solid;
+  border-color: blue;
+}
+
+.reference-background {
+  background-color: orange;
+}
+
+.reference-shadow {
+  background-color: rgba(0,0,0,1);
+}
+
+.reference-padding-radius {
+  border-radius: 15
+}
+
+.reference-radii1 {
+  border-radius: 15 0 10;
+}
+
+.reference-radii2 {
+  border-radius: 5 0 10;
+}
diff --git a/tests/reftests/box-shadow-spec-inset.ref.ui b/tests/reftests/box-shadow-spec-inset.ref.ui
new file mode 100644
index 0000000..5b67f29
--- /dev/null
+++ b/tests/reftests/box-shadow-spec-inset.ref.ui
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="row_spacing">20</property>
+        <property name="column_spacing">20</property>
+        <child>
+          <object class="GtkButton" id="widget-1-1">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="reference-border" />
+              <class name="reference-background" />
+              <class name="column1" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-1-2">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="reference-border" />
+              <class name="reference-background" />
+              <class name="column2" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFixed" id="widget-2-1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="widget-2-1-1">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-2-1-2">
+                <property name="width_request">134</property>
+                <property name="height_request">134</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-shadow" />
+                  <class name="reference-padding-radius" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">5</property>
+                <property name="y">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-2-1-3">
+                <property name="width_request">119</property>
+                <property name="height_request">119</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="reference-radii1" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">20</property>
+                <property name="y">20</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-2-1-4">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-border" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFixed" id="widget-2-2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="widget-2-2-1">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-border" />
+                  <class name="reference-background" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-2-2-2">
+                <property name="width_request">134</property>
+                <property name="height_request">134</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-shadow" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">5</property>
+                <property name="y">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-2-2-3">
+                <property name="width_request">119</property>
+                <property name="height_request">119</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">20</property>
+                <property name="y">20</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFixed" id="widget-3-1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="widget-3-1-1">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-3-1-2">
+                <property name="width_request">134</property>
+                <property name="height_request">134</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-shadow" />
+                  <class name="reference-padding-radius" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">5</property>
+                <property name="y">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-3-1-3">
+                <property name="width_request">109</property>
+                <property name="height_request">109</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="reference-radii2" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">30</property>
+                <property name="y">30</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-3-1-4">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-border" />
+                  <class name="column1" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFixed" id="widget-3-2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="widget-3-2-1">
+                <property name="width_request">144</property>
+                <property name="height_request">144</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-border" />
+                  <class name="reference-background" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">0</property>
+                <property name="y">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-3-2-2">
+                <property name="width_request">134</property>
+                <property name="height_request">134</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-shadow" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">5</property>
+                <property name="y">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="widget-3-2-3">
+                <property name="width_request">109</property>
+                <property name="height_request">109</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="reference-background" />
+                  <class name="column2" />
+                </style>
+              </object>
+              <packing>
+                <property name="x">30</property>
+                <property name="y">30</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/tests/reftests/box-shadow-spec-inset.ui b/tests/reftests/box-shadow-spec-inset.ui
new file mode 100644
index 0000000..87eedde
--- /dev/null
+++ b/tests/reftests/box-shadow-spec-inset.ui
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="row_spacing">20</property>
+        <property name="column_spacing">20</property>
+        <child>
+          <object class="GtkButton" id="widget-1-1">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column1" />
+              <class name="row1" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-1-2">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column1" />
+              <class name="row2" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-1-3">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column1" />
+              <class name="row3" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">3</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-2-1">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column2" />
+              <class name="row1" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-2-2">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column2" />
+              <class name="row2" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="widget-2-3">
+            <property name="width_request">144</property>
+            <property name="height_request">144</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <style>
+              <class name="column2" />
+              <class name="row3" />
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">3</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>



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