diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-20 10:11:06 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-20 10:11:06 +0100 |
commit | 25e1cd690f1f9c939060294d092313481d5d06cd (patch) | |
tree | d5fe0ea31ba69e96765570e84e2a2d01d1195611 | |
parent | ac94d1d81ba943da442572f2f6ac2e9be055190d (diff) |
a little <style> code (by corvid)
-rw-r--r-- | src/html.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc index b8775d18..431a7a94 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1641,11 +1641,27 @@ static void Html_tag_close_script(DilloHtml *html, int TagIdx) /* * Handle open STYLE - * store the contents to the stash where (in the future) the style - * sheet interpreter can get it. + * Store contents in the stash where the style sheet interpreter can get it. */ static void Html_tag_open_style(DilloHtml *html, const char *tag, int tagsize) { + const char *attrbuf; + + if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "type"))) { + BUG_MSG("type attribute is required for <style>\n"); + } else if (dStrcasecmp(attrbuf, "text/css")) { + MSG("Shouldn't be applying <style type=\"%s\">\n", attrbuf); + /* We need to inform close_style() */ + } + if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "media")) && + dStrcasecmp(attrbuf, "all") && !dStristr(attrbuf, "screen")) { + /* HTML 4.01 sec. 6.13 says that media descriptors are case-sensitive, + * but sec. 14.2.3 says that the attribute is case-insensitive. + * TODO can be a comma-separated list. + * TODO handheld. + */ + MSG("Shouldn't be applying <style media=\"%s\">\n", attrbuf); + } a_Html_stash_init(html); S_TOP(html)->parse_mode = DILLO_HTML_PARSE_MODE_VERBATIM; } |