diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-11 21:56:57 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-11 21:56:57 +0200 |
commit | b8591b41fda0567721b024059f9b4497e3d259e4 (patch) | |
tree | 9665355768ab119bfd09504f00704cc3ade494dd /src/html.cc | |
parent | d3a9a4185e26638c7b6d512b8351d68a8c55c86e (diff) | |
parent | a6cf69ecca7f17838f551a2983e2277440ec3f0d (diff) |
merge
Diffstat (limited to 'src/html.cc')
-rw-r--r-- | src/html.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/html.cc b/src/html.cc index 778d0b6b..9b53a082 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1715,6 +1715,9 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize) Textblock *textblock; int32_t color; int tag_index_a = a_Html_tag_index ("a"); + int tag_index_body = a_Html_tag_index ("body"); + int tag_index_html = a_Html_tag_index ("html"); + style::Color *bgColor; if (!(html->InFlags & IN_BODY)) html->InFlags |= IN_BODY; @@ -1729,6 +1732,22 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize) BUG_MSG("unclosed HEAD element\n"); } + html->styleEngine->endElement(tag_index_body); + html->styleEngine->endElement(tag_index_html); + html->styleEngine->startElement(tag_index_html); + bgColor = html->styleEngine->style ()->backgroundColor; + html->styleEngine->startElement(tag_index_body); + + if ((attrbuf = Html_get_attr2(html, tag, tagsize, "id", + HTML_LeftTrim | HTML_RightTrim))) + html->styleEngine->setId(attrbuf); + if ((attrbuf = Html_get_attr2(html, tag, tagsize, "class", + HTML_LeftTrim | HTML_RightTrim))) + html->styleEngine->setClass(attrbuf); + if ((attrbuf = Html_get_attr2(html, tag, tagsize, "style", + HTML_LeftTrim | HTML_RightTrim))) + html->styleEngine->setStyle(attrbuf); + textblock = HT2TB(html); if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) { @@ -1753,6 +1772,14 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize) html->dw->setStyle (html->styleEngine->style ()); + /* Set canvas color if not already set from Html_open_html(). + */ + if (!bgColor) + bgColor = html->styleEngine->style ()->backgroundColor; + + if (bgColor) + HT2LT(html)->setBgColor(bgColor); + /* Determine a color for visited links. * This color is computed once per page and used for immediate feedback * when clicking a link. @@ -1777,6 +1804,7 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize) html->styleEngine->backgroundStyle()->backgroundColor->getColor()); } + S_TOP(html)->parse_mode = DILLO_HTML_PARSE_MODE_BODY; } |