summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-08-23 07:55:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-08-23 07:55:37 +0000
commit4f62d5af8c93e063bf0d9a9f0eaeffb3c451f56f (patch)
tree90d9b5844ca10916142a03b333d7b9a8994318f1 /src
parent758b01f92c0d8e1cdd966a5127e267efd0fe6391 (diff)
downloadlibcss-4f62d5af8c93e063bf0d9a9f0eaeffb3c451f56f.tar.gz
libcss-4f62d5af8c93e063bf0d9a9f0eaeffb3c451f56f.tar.bz2
Somewhat nasty text-align magic for the benefit of HTML tables.
svn path=/trunk/libcss/; revision=9405
Diffstat (limited to 'src')
-rw-r--r--src/select/properties.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/select/properties.c b/src/select/properties.c
index 9ca9d9f..3974f1e 100644
--- a/src/select/properties.c
+++ b/src/select/properties.c
@@ -4678,6 +4678,17 @@ css_error compose_text_align(const css_computed_style *parent,
if (type == CSS_TEXT_ALIGN_INHERIT) {
type = get_text_align(parent);
+ } else if (type == CSS_TEXT_ALIGN_INHERIT_IF_NON_MAGIC) {
+ /* This is purely for the benefit of HTML tables */
+ type = get_text_align(parent);
+
+ /* If the parent's text-align is a magical one,
+ * then reset to the default value. Otherwise,
+ * inherit as normal. */
+ if (type == CSS_TEXT_ALIGN_LIBCSS_LEFT ||
+ type == CSS_TEXT_ALIGN_LIBCSS_CENTER ||
+ type == CSS_TEXT_ALIGN_LIBCSS_RIGHT)
+ type = CSS_TEXT_ALIGN_DEFAULT;
}
return set_text_align(result, type);