diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-22 09:33:04 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-22 09:33:04 +0000 |
commit | 758b01f92c0d8e1cdd966a5127e267efd0fe6391 (patch) | |
tree | adcb0d6e0a09c2745630ac2520416da513d1eb03 /test | |
parent | 64ffb54faffc493ff1cd35943a89d62d08183317 (diff) | |
download | libcss-758b01f92c0d8e1cdd966a5127e267efd0fe6391.tar.gz libcss-758b01f92c0d8e1cdd966a5127e267efd0fe6391.tar.bz2 |
It turns out that using magic values for text-align is simpler than having an entirely new property for html alignment.
svn path=/trunk/libcss/; revision=9387
Diffstat (limited to 'test')
-rw-r--r-- | test/data/parse/properties.dat | 60 | ||||
-rw-r--r-- | test/data/parse2/illegal-values.dat | 69 | ||||
-rw-r--r-- | test/data/select/tests1.dat | 3 | ||||
-rw-r--r-- | test/dump.h | 16 | ||||
-rw-r--r-- | test/dump_computed.h | 35 |
5 files changed, 42 insertions, 141 deletions
diff --git a/test/data/parse/properties.dat b/test/data/parse/properties.dat index 3e872d9..2240a38 100644 --- a/test/data/parse/properties.dat +++ b/test/data/parse/properties.dat @@ -3167,6 +3167,30 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at | 0x000c0054 #reset +#data +* { text-align: -libcss-left; } +#errors +#expected +| 1 * +| 0x00100054 +#reset + +#data +* { text-align: -libcss-center; } +#errors +#expected +| 1 * +| 0x00140054 +#reset + +#data +* { text-align: -libcss-right; } +#errors +#expected +| 1 * +| 0x00180054 +#reset + ## ## 55 - text-decoration ## @@ -3744,39 +3768,3 @@ p:before { content: open-quote url('http://picodrive.acornarcade.com/') " : " at | 0x02000062 0xfffffc00 #reset -## -## 63 - -libcss-align -## - -#data -* { -libcss-align: left; } -#errors -#expected -| 1 * -| 0x00000063 -#reset - -#data -* { -libcss-align: right; } -#errors -#expected -| 1 * -| 0x00040063 -#reset - -#data -* { -libcss-align: center; } -#errors -#expected -| 1 * -| 0x00080063 -#reset - -#data -* { -libcss-align: justify; } -#errors -#expected -| 1 * -| 0x000c0063 -#reset - diff --git a/test/data/parse2/illegal-values.dat b/test/data/parse2/illegal-values.dat index 5518ca6..b882328 100644 --- a/test/data/parse2/illegal-values.dat +++ b/test/data/parse2/illegal-values.dat @@ -4524,73 +4524,4 @@ max-height: 30%; min-height: 2em; } | * #reset -#data -* { -libcss-align: none 0; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: 0pt; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: -0pt; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: fixed inherit; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: left right; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: left, right; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: left | right; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: justified; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: center 50%; } -#errors -#expected -| * -#reset - -#data -* { -libcss-align: 50%; } -#errors -#expected -| * -#reset diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat index 35b5e61..163e611 100644 --- a/test/data/select/tests1.dat +++ b/test/data/select/tests1.dat @@ -303,7 +303,6 @@ white-space: normal width: auto word-spacing: normal z-index: auto --libcss-align: default #reset #tree all @@ -389,7 +388,6 @@ white-space: normal width: auto word-spacing: normal z-index: auto --libcss-align: default #reset #tree @@ -539,6 +537,5 @@ white-space: normal width: auto word-spacing: normal z-index: auto --libcss-align: default #reset diff --git a/test/dump.h b/test/dump.h index 5352ce3..0422b18 100644 --- a/test/dump.h +++ b/test/dump.h @@ -1952,13 +1952,6 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth) } break; case CSS_PROP_TEXT_ALIGN: - case CSS_PROP_LIBCSS_ALIGN: - assert(LIBCSS_ALIGN_LEFT == TEXT_ALIGN_LEFT); - assert(LIBCSS_ALIGN_RIGHT == TEXT_ALIGN_RIGHT); - assert(LIBCSS_ALIGN_CENTER == - TEXT_ALIGN_CENTER); - assert(LIBCSS_ALIGN_JUSTIFY == - TEXT_ALIGN_JUSTIFY); switch (value) { case TEXT_ALIGN_LEFT: *ptr += sprintf(*ptr, "left"); @@ -1972,6 +1965,15 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth) case TEXT_ALIGN_JUSTIFY: *ptr += sprintf(*ptr, "justify"); break; + case TEXT_ALIGN_LIBCSS_LEFT: + *ptr += sprintf(*ptr, "-libcss-left"); + break; + case TEXT_ALIGN_LIBCSS_CENTER: + *ptr += sprintf(*ptr, "-libcss-center"); + break; + case TEXT_ALIGN_LIBCSS_RIGHT: + *ptr += sprintf(*ptr, "-libcss-right"); + break; } break; case CSS_PROP_TEXT_DECORATION: diff --git a/test/dump_computed.h b/test/dump_computed.h index 551830a..d6a45ba 100644 --- a/test/dump_computed.h +++ b/test/dump_computed.h @@ -1965,6 +1965,15 @@ static void dump_computed_style(const css_computed_style *style, char *buf, case CSS_TEXT_ALIGN_DEFAULT: wrote = snprintf(ptr, *len, "text-align: default\n"); break; + case CSS_TEXT_ALIGN_LIBCSS_LEFT: + wrote = snprintf(ptr, *len, "text-align: -libcss-left\n"); + break; + case CSS_TEXT_ALIGN_LIBCSS_CENTER: + wrote = snprintf(ptr, *len, "text-align: -libcss-center\n"); + break; + case CSS_TEXT_ALIGN_LIBCSS_RIGHT: + wrote = snprintf(ptr, *len, "text-align: -libcss-right\n"); + break; default: wrote = 0; break; @@ -2247,31 +2256,5 @@ static void dump_computed_style(const css_computed_style *style, char *buf, } ptr += wrote; *len -= wrote; - - /* -libcss-align */ - val = css_computed_libcss_align(style); - switch (val) { - case CSS_LIBCSS_ALIGN_LEFT: - wrote = snprintf(ptr, *len, "-libcss-align: left\n"); - break; - case CSS_LIBCSS_ALIGN_RIGHT: - wrote = snprintf(ptr, *len, "-libcss-align: right\n"); - break; - case CSS_LIBCSS_ALIGN_CENTER: - wrote = snprintf(ptr, *len, "-libcss-align: center\n"); - break; - case CSS_LIBCSS_ALIGN_JUSTIFY: - wrote = snprintf(ptr, *len, "-libcss-align: justify\n"); - break; - case CSS_LIBCSS_ALIGN_DEFAULT: - wrote = snprintf(ptr, *len, "-libcss-align: default\n"); - break; - default: - wrote = 0; - break; - } - ptr += wrote; - *len -= wrote; - } |