summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-06-01 17:32:37 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2014-06-01 17:32:37 (GMT)
commitc6d7f24987a90bc61e408c4249a6a212276b4174 (patch)
tree75a3f5478618e0e583db6f168193e7645c012dda /test
parent89a4d061a46490d5fad3792a565a1a0114c400e0 (diff)
downloadlibcss-c6d7f24987a90bc61e408c4249a6a212276b4174.tar.gz
libcss-c6d7f24987a90bc61e408c4249a6a212276b4174.tar.bz2
Add support for CSS3 overflow-x and overflow-y properties.
Now, overflow is a shorthand property setting both overflow-x and overflow-y. The getter for the computed overflow has been removed, and replaced with two for overflow-x and overflow-y.
Diffstat (limited to 'test')
-rw-r--r--test/data/parse/properties.dat46
-rw-r--r--test/data/parse2/INDEX3
-rw-r--r--test/data/parse2/overflow.dat97
-rw-r--r--test/data/select/tests1.dat129
-rw-r--r--test/dump.h6
-rw-r--r--test/dump_computed.h39
6 files changed, 262 insertions, 58 deletions
diff --git a/test/data/parse/properties.dat b/test/data/parse/properties.dat
index d96d826..4716929 100644
--- a/test/data/parse/properties.dat
+++ b/test/data/parse/properties.dat
@@ -2447,11 +2447,11 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
#reset
##
-## 3c - overflow
+## 3c - overflow-x
##
#data
-* { overflow: visible; }
+* { overflow-x: visible; }
#errors
#expected
| 1 *
@@ -2459,7 +2459,7 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
#reset
#data
-* { overflow: hidden; }
+* { overflow-x: hidden; }
#errors
#expected
| 1 *
@@ -2467,7 +2467,7 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
#reset
#data
-* { overflow: scroll; }
+* { overflow-x: scroll; }
#errors
#expected
| 1 *
@@ -2475,7 +2475,7 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
#reset
#data
-* { overflow: auto; }
+* { overflow-x: auto; }
#errors
#expected
| 1 *
@@ -2483,6 +2483,42 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at
#reset
##
+## 70 - overflow-y
+##
+
+#data
+* { overflow-y: visible; }
+#errors
+#expected
+| 1 *
+| 0x00000070
+#reset
+
+#data
+* { overflow-y: hidden; }
+#errors
+#expected
+| 1 *
+| 0x00040070
+#reset
+
+#data
+* { overflow-y: scroll; }
+#errors
+#expected
+| 1 *
+| 0x00080070
+#reset
+
+#data
+* { overflow-y: auto; }
+#errors
+#expected
+| 1 *
+| 0x000c0070
+#reset
+
+##
## 3d - padding-top
## 3e - padding-right
## 3f - padding-bottom
diff --git a/test/data/parse2/INDEX b/test/data/parse2/INDEX
index 651a87e..1afb4da 100644
--- a/test/data/parse2/INDEX
+++ b/test/data/parse2/INDEX
@@ -17,5 +17,6 @@ font.dat Font property tests
list.dat List property tests
margin.dat Margin property tests
outline.dat Outline property tests
+overflow.dat Overflow property tests
padding.dat Padding property tests
-multicol.dat Multi-column layout property tests \ No newline at end of file
+multicol.dat Multi-column layout property tests
diff --git a/test/data/parse2/overflow.dat b/test/data/parse2/overflow.dat
new file mode 100644
index 0000000..436b455
--- a/dev/null
+++ b/test/data/parse2/overflow.dat
@@ -0,0 +1,97 @@
+#data
+* { overflow: auto; }
+#errors
+#expected
+| *
+| overflow-x: auto
+| overflow-y: auto
+#reset
+
+#data
+* { overflow: hidden; }
+#errors
+#expected
+| *
+| overflow-x: hidden
+| overflow-y: hidden
+#reset
+
+#data
+* { overflow: visible; }
+#errors
+#expected
+| *
+| overflow-x: visible
+| overflow-y: visible
+#reset
+
+#data
+* { overflow: scroll; }
+#errors
+#expected
+| *
+| overflow-x: scroll
+| overflow-y: scroll
+#reset
+
+#data
+* { overflow: inherit; }
+#errors
+#expected
+| *
+| overflow-x: inherit
+| overflow-y: inherit
+#reset
+
+#data
+* { overflow-x: inherit; }
+#errors
+#expected
+| *
+| overflow-x: inherit
+#reset
+
+#data
+* { overflow-x: scroll; }
+#errors
+#expected
+| *
+| overflow-x: scroll
+#reset
+
+#data
+* { overflow-y: visible; }
+#errors
+#expected
+| *
+| overflow-y: visible
+#reset
+
+#data
+* { overflow-y: auto; }
+#errors
+#expected
+| *
+| overflow-y: auto
+#reset
+
+#data
+* { overflow-x: visible; overflow-y: hidden; }
+#errors
+#expected
+| *
+| overflow-x: visible
+| overflow-y: hidden
+#reset
+
+#data
+* { overflow-y: auto; overflow-x: inherit; }
+#errors
+#expected
+| *
+| overflow-y: auto
+| overflow-x: inherit
+#reset
+
+
+
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 51c5426..96e57bf 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -69,7 +69,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -165,7 +166,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -261,7 +263,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -357,7 +360,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -445,7 +449,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -531,7 +536,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -618,7 +624,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -705,7 +712,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -791,7 +799,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -882,7 +891,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -973,7 +983,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1065,7 +1076,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1160,7 +1172,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1254,7 +1267,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1354,7 +1368,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1454,7 +1469,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1554,7 +1570,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1658,7 +1675,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1761,7 +1779,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1862,7 +1881,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -1962,7 +1982,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2062,7 +2083,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2162,7 +2184,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2262,7 +2285,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2362,7 +2386,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2462,7 +2487,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2562,7 +2588,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2662,7 +2689,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2762,7 +2790,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2862,7 +2891,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -2962,7 +2992,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3062,7 +3093,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3162,7 +3194,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3262,7 +3295,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3362,7 +3396,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3462,7 +3497,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3562,7 +3598,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3662,7 +3699,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3762,7 +3800,8 @@ opacity: 0.500
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3862,7 +3901,8 @@ opacity: inherit
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -3955,7 +3995,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: 2px
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -4048,7 +4089,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
@@ -4141,7 +4183,8 @@ opacity: 1.000
outline-color: invert
outline-style: none
outline-width: medium
-overflow: visible
+overflow-x: visible
+overflow-y: visible
padding-top: 0px
padding-right: 0px
padding-bottom: 0px
diff --git a/test/dump.h b/test/dump.h
index 941117c..7ffec4f 100644
--- a/test/dump.h
+++ b/test/dump.h
@@ -425,7 +425,7 @@ static const char *opcode_names[] = {
"outline-color",
"outline-style",
"outline-width",
- "overflow",
+ "overflow-x",
"padding-top",
"padding-right",
"padding-bottom",
@@ -477,6 +477,7 @@ static const char *opcode_names[] = {
"column-span",
"column-width",
"writing-mode",
+ "overflow-y",
};
static void dump_css_fixed(css_fixed f, char **ptr)
@@ -2076,7 +2077,8 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
- case CSS_PROP_OVERFLOW:
+ case CSS_PROP_OVERFLOW_X:
+ case CSS_PROP_OVERFLOW_Y:
switch (value) {
case OVERFLOW_VISIBLE:
*ptr += sprintf(*ptr, "visible");
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 451ba1a..5f83767 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -1918,23 +1918,48 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
ptr += wrote;
*len -= wrote;
- /* overflow */
- val = css_computed_overflow(style);
+ /* overflow-x */
+ val = css_computed_overflow_x(style);
switch (val) {
case CSS_OVERFLOW_INHERIT:
- wrote = snprintf(ptr, *len, "overflow: inherit\n");
+ wrote = snprintf(ptr, *len, "overflow-x: inherit\n");
break;
case CSS_OVERFLOW_VISIBLE:
- wrote = snprintf(ptr, *len, "overflow: visible\n");
+ wrote = snprintf(ptr, *len, "overflow-x: visible\n");
break;
case CSS_OVERFLOW_HIDDEN:
- wrote = snprintf(ptr, *len, "overflow: hidden\n");
+ wrote = snprintf(ptr, *len, "overflow-x: hidden\n");
break;
case CSS_OVERFLOW_SCROLL:
- wrote = snprintf(ptr, *len, "overflow: scroll\n");
+ wrote = snprintf(ptr, *len, "overflow-x: scroll\n");
break;
case CSS_OVERFLOW_AUTO:
- wrote = snprintf(ptr, *len, "overflow: auto\n");
+ wrote = snprintf(ptr, *len, "overflow-x: auto\n");
+ break;
+ default:
+ wrote = 0;
+ break;
+ }
+ ptr += wrote;
+ *len -= wrote;
+
+ /* overflow-y */
+ val = css_computed_overflow_y(style);
+ switch (val) {
+ case CSS_OVERFLOW_INHERIT:
+ wrote = snprintf(ptr, *len, "overflow-y: inherit\n");
+ break;
+ case CSS_OVERFLOW_VISIBLE:
+ wrote = snprintf(ptr, *len, "overflow-y: visible\n");
+ break;
+ case CSS_OVERFLOW_HIDDEN:
+ wrote = snprintf(ptr, *len, "overflow-y: hidden\n");
+ break;
+ case CSS_OVERFLOW_SCROLL:
+ wrote = snprintf(ptr, *len, "overflow-y: scroll\n");
+ break;
+ case CSS_OVERFLOW_AUTO:
+ wrote = snprintf(ptr, *len, "overflow-y: auto\n");
break;
default:
wrote = 0;