From 94fd9303f373eaf35b0dc07c042b4bb1c0343884 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 9 Jan 2006 01:24:54 +0100 Subject: [PATCH] Introduce html_bottom; similar to html_top --- src/document/html/internal.h | 1 + src/document/html/parser/general.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/document/html/internal.h b/src/document/html/internal.h index b85a87273..c299e730d 100644 --- a/src/document/html/internal.h +++ b/src/document/html/internal.h @@ -115,6 +115,7 @@ struct html_context { }; #define html_top ((struct html_element *) html_context->stack.next) +#define html_bottom ((struct html_element *) html_context->stack.prev) #define format (html_top->attr) #define par_format (html_top->parattr) diff --git a/src/document/html/parser/general.c b/src/document/html/parser/general.c index 622e5d1fe..4c7c43648 100644 --- a/src/document/html/parser/general.c +++ b/src/document/html/parser/general.c @@ -148,7 +148,7 @@ html_apply_canvas_bgcolor(struct html_context *html_context) if (par_format.bgcolor != format.style.bg) { /* Modify the root HTML element - format_html_part() will take * this from there. */ - struct html_element *e = html_context->stack.prev; + struct html_element *e = html_bottom; html_context->was_body_background = 1; e->parattr.bgcolor = e->attr.style.bg = par_format.bgcolor = format.style.bg; @@ -364,7 +364,7 @@ html_html(struct html_context *html_context, unsigned char *a, /* Modify the root HTML element - format_html_part() will take * this from there. */ - struct html_element *e = html_context->stack.prev; + struct html_element *e = html_bottom; if (par_format.bgcolor != format.style.bg) e->parattr.bgcolor = e->attr.style.bg = par_format.bgcolor = format.style.bg;