diff options
author | Dodji Seketeli <dodji@src.gnome.org> | 2003-06-03 22:00:26 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@src.gnome.org> | 2003-06-03 22:00:26 +0000 |
commit | 0da04c7e6bca421ffe3c812ac13eb3763f0b3922 (patch) | |
tree | aeae28fbfb9244a44acc3b124d0a1cc241b155e0 /src/seleng/cr-style.c | |
parent | f12f414671794440d4f6caf3ff7b7b394af8db24 (diff) | |
download | libcroco-0da04c7e6bca421ffe3c812ac13eb3763f0b3922.tar.gz |
created a new xml/css document to bring the test to a broader extend. It
* tests/test7-main.c: created a new xml/css document to bring the test to
a broader extend. It appeared that libcroco's layout code is
damned bugged... I am debugging it...
* src/seleng/cr-style.c:changed the default element display property
to "block" and not "inline" anymore.
Also made the set_prop_background_color () function support
hex strings (e.g.: #ffffff or #ee)
* src/parser/cr-rgb.[ch]: added cr_rgb_set_from_hex_str ()
to support hash (hex) strings (#ffffff or #eee).
* src/parser/cr-num.c:support of fixed/variable length numbers.
* src/layeng/cr-lay-eng.c: a lot of layout fixes.
Dodji.
Diffstat (limited to 'src/seleng/cr-style.c')
-rw-r--r-- | src/seleng/cr-style.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/seleng/cr-style.c b/src/seleng/cr-style.c index 3d8bd83..5901834 100644 --- a/src/seleng/cr-style.c +++ b/src/seleng/cr-style.c @@ -350,7 +350,7 @@ cr_style_set_props_to_defaults (CRStyle *a_this) a_this->border_style_props[i] = BORDER_STYLE_NONE ; } - a_this->display = DISPLAY_INLINE ; + a_this->display = DISPLAY_BLOCK ; a_this->position = POSITION_STATIC ; a_this->float_type = FLOAT_NONE ; a_this->parent_style = NULL ; @@ -1110,8 +1110,9 @@ set_prop_background_color (CRStyle *a_style, CRTerm *a_value) g_return_val_if_fail (a_style && a_value, CR_BAD_PARAM_ERROR) ; - if (a_value->type == TERM_RGB) + switch (a_value->type) { + case TERM_RGB: if (a_value->content.rgb) { status = cr_rgb_set_from_rgb @@ -1119,16 +1120,23 @@ set_prop_background_color (CRStyle *a_style, CRTerm *a_value) rgb_props[RGB_PROP_BACKGROUND_COLOR].sv, a_value->content.rgb) ; } - } - else if (a_value->type == TERM_IDENT) - { - status = cr_rgb_set_from_name (&a_style-> - rgb_props[RGB_PROP_BACKGROUND_COLOR].sv, - a_value->content.str->str) ; - } - else - { - return CR_UNKNOWN_TYPE_ERROR ; + break ; + + case TERM_IDENT: + status = cr_rgb_set_from_name + (&a_style->rgb_props[RGB_PROP_BACKGROUND_COLOR].sv, + a_value->content.str->str) ; + break ; + + case TERM_HASH: + status = cr_rgb_set_from_hex_str + (&a_style->rgb_props[RGB_PROP_BACKGROUND_COLOR].sv, + a_value->content.str->str) ; + break ; + + default: + status = CR_UNKNOWN_TYPE_ERROR ; + break ; } return status ; |