summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-05 01:52:49 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-05 01:52:49 +0000
commit2caf5a7505210eadd95cd35ad34600275aafcd65 (patch)
tree818e422fe4431b51e9e2ca16f3cb35e8d5143b74 /src
parent1c4fd1ca067c6a0917e891b2bfb8fc0a20b1d7eb (diff)
downloadlibcss-2caf5a7505210eadd95cd35ad34600275aafcd65.tar.gz
libcss-2caf5a7505210eadd95cd35ad34600275aafcd65.tar.bz2
z-index is a signed int, not a css_fixed value.
Compose width, word-spacing and z-index. svn path=/trunk/libcss/; revision=6709
Diffstat (limited to 'src')
-rw-r--r--src/select/properties.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/select/properties.c b/src/select/properties.c
index da432b7..91567c4 100644
--- a/src/select/properties.c
+++ b/src/select/properties.c
@@ -4347,6 +4347,22 @@ css_error initial_width(css_computed_style *style)
return set_width(style, CSS_WIDTH_AUTO, 0, CSS_UNIT_PX);
}
+css_error compose_width(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+
+ if (css_computed_width(child, &length, &unit) == CSS_WIDTH_INHERIT) {
+ uint8_t p = css_computed_width(parent, &length, &unit);
+
+ return set_width(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_word_spacing(uint32_t opv, css_style *style,
css_select_state *state)
{
@@ -4358,6 +4374,24 @@ css_error initial_word_spacing(css_computed_style *style)
return set_word_spacing(style, CSS_WORD_SPACING_NORMAL, 0, CSS_UNIT_PX);
}
+css_error compose_word_spacing(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+
+ if ((child->uncommon == NULL && parent->uncommon != NULL) ||
+ css_computed_word_spacing(child, &length, &unit) ==
+ CSS_WORD_SPACING_INHERIT) {
+ uint8_t p = css_computed_word_spacing(parent, &length, &unit);
+
+ return set_word_spacing(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_z_index(uint32_t opv, css_style *style,
css_select_state *state)
{
@@ -4390,6 +4424,21 @@ css_error initial_z_index(css_computed_style *style)
return set_z_index(style, CSS_Z_INDEX_AUTO, 0);
}
+css_error compose_z_index(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ int32_t index = 0;
+
+ if (css_computed_z_index(child, &index) == CSS_Z_INDEX_INHERIT) {
+ uint8_t p = css_computed_z_index(parent, &index);
+
+ return set_z_index(result, p, index);
+ }
+
+ return CSS_OK;
+}
+
/******************************************************************************
* Utilities below here *
******************************************************************************/