summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-05 01:08:45 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-05 01:08:45 +0000
commit2118e313c125ef2e88675e33de12b6473118b3db (patch)
treee54489e58362f64266c17cd4227ffe8c9926dfd8 /src
parent6d58c693793a4c9beb69fa9c7c381de1b755d70d (diff)
downloadlibcss-2118e313c125ef2e88675e33de12b6473118b3db.tar.gz
libcss-2118e313c125ef2e88675e33de12b6473118b3db.tar.bz2
Compose {min,max}{width,height}
svn path=/trunk/libcss/; revision=6701
Diffstat (limited to 'src')
-rw-r--r--src/select/properties.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/select/properties.c b/src/select/properties.c
index 6b557bf..b2f6ad1 100644
--- a/src/select/properties.c
+++ b/src/select/properties.c
@@ -2575,6 +2575,23 @@ css_error initial_max_height(css_computed_style *style)
return set_max_height(style, CSS_MAX_HEIGHT_NONE, 0, CSS_UNIT_PX);
}
+css_error compose_max_height(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_max_height(child, &length, &unit) ==
+ CSS_MAX_HEIGHT_INHERIT) {
+ uint8_t p = css_computed_max_height(parent, &length, &unit);
+
+ return set_max_height(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_max_width(uint32_t opv, css_style *style,
css_select_state *state)
{
@@ -2586,6 +2603,23 @@ css_error initial_max_width(css_computed_style *style)
return set_max_width(style, CSS_MAX_WIDTH_NONE, 0, CSS_UNIT_PX);
}
+css_error compose_max_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_max_width(child, &length, &unit) ==
+ CSS_MAX_WIDTH_INHERIT) {
+ uint8_t p = css_computed_max_width(parent, &length, &unit);
+
+ return set_max_width(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_min_height(uint32_t opv, css_style *style,
css_select_state *state)
{
@@ -2597,6 +2631,23 @@ css_error initial_min_height(css_computed_style *style)
return set_min_height(style, CSS_MIN_HEIGHT_SET, 0, CSS_UNIT_PX);
}
+css_error compose_min_height(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_min_height(child, &length, &unit) ==
+ CSS_MIN_HEIGHT_INHERIT) {
+ uint8_t p = css_computed_min_height(parent, &length, &unit);
+
+ return set_min_height(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_min_width(uint32_t opv, css_style *style,
css_select_state *state)
{
@@ -2608,6 +2659,23 @@ css_error initial_min_width(css_computed_style *style)
return set_min_width(style, CSS_MIN_WIDTH_SET, 0, CSS_UNIT_PX);
}
+css_error compose_min_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_min_width(child, &length, &unit) ==
+ CSS_MIN_WIDTH_INHERIT) {
+ uint8_t p = css_computed_min_width(parent, &length, &unit);
+
+ return set_min_width(result, p, length, unit);
+ }
+
+ return CSS_OK;
+}
+
css_error cascade_orphans(uint32_t opv, css_style *style,
css_select_state *state)
{