From 0e5d05b12544a73d4ecaa4d89d22251afef92916 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 10 Oct 2003 18:13:36 +0000 Subject: [project @ 2003-10-10 18:13:36 by jmb] CSS visibility support (not collapse) svn path=/import/netsurf/; revision=361 --- css/css.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'css/css.c') diff --git a/css/css.c b/css/css.c index 7afdee9d1..6fd1960c2 100644 --- a/css/css.c +++ b/css/css.c @@ -47,6 +47,7 @@ const struct css_style css_base_style = { { CSS_HEIGHT_AUTO, { 1, CSS_UNIT_EM } }, { CSS_LINE_HEIGHT_ABSOLUTE, { 1.3 } }, CSS_TEXT_ALIGN_LEFT, + CSS_VISIBILITY_VISIBLE, { CSS_WIDTH_AUTO, { { 1, CSS_UNIT_EM } } }, CSS_WHITE_SPACE_NORMAL }; @@ -63,6 +64,7 @@ const struct css_style css_empty_style = { { CSS_HEIGHT_INHERIT, { 1, CSS_UNIT_EM } }, { CSS_LINE_HEIGHT_INHERIT, { 1.3 } }, CSS_TEXT_ALIGN_INHERIT, + CSS_VISIBILITY_INHERIT, { CSS_WIDTH_INHERIT, { { 1, CSS_UNIT_EM } } }, CSS_WHITE_SPACE_INHERIT }; @@ -79,6 +81,7 @@ const struct css_style css_blank_style = { { CSS_HEIGHT_AUTO, { 1, CSS_UNIT_EM } }, { CSS_LINE_HEIGHT_INHERIT, { 1.3 } }, CSS_TEXT_ALIGN_INHERIT, + CSS_VISIBILITY_INHERIT, { CSS_WIDTH_AUTO, { { 1, CSS_UNIT_EM } } }, CSS_WHITE_SPACE_INHERIT }; @@ -613,6 +616,7 @@ void css_dump_style(const struct css_style * const style) } fprintf(stderr, "; "); fprintf(stderr, "text-align: %s; ", css_text_align_name[style->text_align]); + fprintf(stderr, "visibility: %s", css_visibility_name[style->visibility]); fprintf(stderr, "width: "); switch (style->width.width) { case CSS_WIDTH_AUTO: fprintf(stderr, "auto"); break; @@ -685,6 +689,8 @@ void css_cascade(struct css_style * const style, const struct css_style * const style->line_height = apply->line_height; if (apply->text_align != CSS_TEXT_ALIGN_INHERIT) style->text_align = apply->text_align; + if (apply->visibility != CSS_VISIBILITY_INHERIT) + style->visibility = apply->visibility; if (apply->width.width != CSS_WIDTH_INHERIT) style->width = apply->width; if (apply->white_space != CSS_WHITE_SPACE_INHERIT) @@ -754,6 +760,8 @@ void css_merge(struct css_style * const style, const struct css_style * const ap style->line_height = apply->line_height; if (apply->text_align != CSS_TEXT_ALIGN_INHERIT) style->text_align = apply->text_align; + if (apply->visibility != CSS_VISIBILITY_INHERIT) + style->visibility = apply->visibility; if (apply->width.width != CSS_WIDTH_INHERIT) style->width = apply->width; if (apply->white_space != CSS_WHITE_SPACE_INHERIT) -- cgit v1.2.3