From 9fd638f098b36399e3ca7c90df3c283ab07ed08e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 19 Oct 2003 17:17:26 +0000 Subject: [project @ 2003-10-19 17:17:26 by jmb] Make text-decoration span child elements. Add text-decoration to css_dump() svn path=/import/netsurf/; revision=371 --- css/css.c | 1 + riscos/htmlredraw.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/css/css.c b/css/css.c index ec0084ec8..c5c5c7780 100644 --- a/css/css.c +++ b/css/css.c @@ -638,6 +638,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, "text-decoration: %s; ", css_text_decoration_name[style->text_decoration]); fprintf(stderr, "visibility: %s; ", css_visibility_name[style->visibility]); fprintf(stderr, "width: "); switch (style->width.width) { diff --git a/riscos/htmlredraw.c b/riscos/htmlredraw.c index f9569ea95..83e7b4009 100644 --- a/riscos/htmlredraw.c +++ b/riscos/htmlredraw.c @@ -283,14 +283,15 @@ void html_redraw_box(struct content *content, struct box * box, colourtrans_set_font_colours(box->font->handle, current_background_color << 8, box->style->color << 8, 14, 0, 0, 0); + if (box->style->text_decoration == CSS_TEXT_DECORATION_NONE || box->style->text_decoration == CSS_TEXT_DECORATION_BLINK) { - font_paint(box->font->handle, box->text, - font_OS_UNITS | font_GIVEN_FONT | font_KERN | font_GIVEN_LENGTH, - x, y - (int) (box->height * 1.5), - NULL, NULL, (int) box->length); + font_paint(box->font->handle, box->text, + font_OS_UNITS | font_GIVEN_FONT | font_KERN | font_GIVEN_LENGTH, + x, y - (int) (box->height * 1.5), + NULL, NULL, (int) box->length); } - if (box->style->text_decoration == CSS_TEXT_DECORATION_UNDERLINE) { + if (box->style->text_decoration == CSS_TEXT_DECORATION_UNDERLINE || (box->parent->parent->style->text_decoration == CSS_TEXT_DECORATION_UNDERLINE && box->parent->parent->type == BOX_BLOCK)) { char ulctrl[3]; char *temp = xcalloc(strlen(box->text)+4, sizeof(char)); @@ -303,7 +304,7 @@ void html_redraw_box(struct content *content, struct box * box, NULL, NULL, (int) box->length + 3); xfree(temp); } - if (box->style->text_decoration == CSS_TEXT_DECORATION_LINE_THROUGH){ + if (box->style->text_decoration == CSS_TEXT_DECORATION_LINE_THROUGH || (box->parent->parent->style->text_decoration == CSS_TEXT_DECORATION_LINE_THROUGH && box->parent->parent->type == BOX_BLOCK)) { char ulctrl[3]; char *temp = xcalloc(strlen(box->text)+4, sizeof(char)); @@ -316,7 +317,7 @@ void html_redraw_box(struct content *content, struct box * box, NULL, NULL, (int) box->length + 3); xfree(temp); } - if (box->style->text_decoration == CSS_TEXT_DECORATION_OVERLINE) { + if (box->style->text_decoration == CSS_TEXT_DECORATION_OVERLINE || (box->parent->parent->style->text_decoration == CSS_TEXT_DECORATION_OVERLINE && box->parent->parent->type == BOX_BLOCK)) { char ulctrl[3]; char *temp = xcalloc(strlen(box->text)+4, sizeof(char)); -- cgit v1.2.3