aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/html.cc b/src/html.cc
index 3f39095a..9649b42e 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -1569,10 +1569,16 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_tag_open_html(DilloHtml *html, const char *tag, int tagsize)
{
+ Style *style;
+
if (!(html->InFlags & IN_HTML))
html->InFlags |= IN_HTML;
++html->Num_HTML;
+ style = html->styleEngine->style ();
+ if (style->backgroundColor)
+ HT2LT(html)->setBgColor(style->backgroundColor);
+
if (html->Num_HTML > 1) {
BUG_MSG("HTML element was already open\n");
}
@@ -1761,7 +1767,11 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHints (&props);
html->dw->setStyle (html->styleEngine->style ());
- HT2LT(html)->setBgColor(html->styleEngine->style ()->backgroundColor);
+
+ /* Set canvas color if not already set from Html_open_html().
+ */
+ if (! HT2LT(html)->getBgColor())
+ HT2LT(html)->setBgColor(html->styleEngine->style ()->backgroundColor);
/* Determine a color for visited links.
* This color is computed once per page and used for immediate feedback