aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/html.cc35
-rw-r--r--src/table.cc34
2 files changed, 62 insertions, 7 deletions
diff --git a/src/html.cc b/src/html.cc
index adfd818e..1f9f5e0a 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -289,6 +289,9 @@ void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize)
if ((align = a_Html_get_attr(html, tag, tagsize, "align"))) {
TextAlignType textAlignType = TEXT_ALIGN_LEFT;
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("The align attribute is obsolete in HTML5.\n");
+
if (dStrAsciiCasecmp (align, "left") == 0)
textAlignType = TEXT_ALIGN_LEFT;
else if (dStrAsciiCasecmp (align, "right") == 0)
@@ -330,6 +333,9 @@ bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
VAlignType valign;
if ((attr = a_Html_get_attr(html, tag, tagsize, "valign"))) {
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("The valign attribute is obsolete in HTML5.\n");
+
if (dStrAsciiCasecmp (attr, "top") == 0)
valign = VALIGN_TOP;
else if (dStrAsciiCasecmp (attr, "bottom") == 0)
@@ -1830,6 +1836,10 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
color = a_Html_color_parse(html, attrbuf, -1);
+
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<body> bgcolor attribute is obsolete.\n");
+
if (color != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, color);
@@ -1837,6 +1847,10 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "text"))) {
color = a_Html_color_parse(html, attrbuf, -1);
+
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<body> text attribute is obsolete.\n");
+
if (color != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_COLOR,
CSS_TYPE_COLOR, color);
@@ -1844,11 +1858,17 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->restyle ();
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "link")))
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "link"))) {
html->non_css_link_color = a_Html_color_parse(html, attrbuf, -1);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<body> link attribute is obsolete.\n");
+ }
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "vlink")))
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "vlink"))) {
html->non_css_visited_color = a_Html_color_parse(html, attrbuf, -1);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<body> vlink attribute is obsolete.\n");
+ }
html->dw->setStyle (html->styleEngine->style ());
@@ -2654,6 +2674,8 @@ static void Html_tag_open_ul(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_LIST_STYLE_TYPE,
CSS_TYPE_ENUM, list_style_type);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<ul> type attribute is obsolete.\n");
}
S_TOP(html)->list_type = HTML_LIST_UNORDERED;
@@ -2770,19 +2792,26 @@ static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
width_ptr = a_Html_get_attr_wdef(html, tag, tagsize, "width", NULL);
if (width_ptr) {
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<hr> width attribute is obsolete.\n");
html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, width_ptr));
dFree(width_ptr);
}
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "size")))
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "size"))) {
size = strtol(attrbuf, NULL, 10);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<hr> size attribute is obsolete.\n");
+ }
a_Html_tag_set_align_attr(html, tag, tagsize);
/* TODO: evaluate attribute */
if (a_Html_get_attr(html, tag, tagsize, "noshade")) {
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<hr> noshade attribute is obsolete.\n");
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_TOP_STYLE,
CSS_TYPE_ENUM, BORDER_SOLID);
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_STYLE,
diff --git a/src/table.cc b/src/table.cc
index 41f2b686..15200516 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -45,10 +45,17 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "border")))
border = isdigit(attrbuf[0]) ? strtol (attrbuf, NULL, 10) : 1;
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellspacing")))
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellspacing"))) {
cellspacing = strtol (attrbuf, NULL, 10);
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellpadding")))
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<table> cellspacing attribute is obsolete.\n");
+ }
+
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cellpadding"))) {
cellpadding = strtol (attrbuf, NULL, 10);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<table> cellpadding attribute is obsolete.\n");
+ }
if (border != -1) {
cssLength = CSS_CREATE_LENGTH (border, CSS_LENGTH_TYPE_PX);
@@ -76,10 +83,13 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
CSS_TYPE_LENGTH_PERCENTAGE, cssLength);
}
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "width")))
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "width"))) {
html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, attrbuf));
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<table> width attribute is obsolete.\n");
+ }
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "align"))) {
if (dStrAsciiCasecmp (attrbuf, "left") == 0)
@@ -91,6 +101,8 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
else if (dStrAsciiCasecmp (attrbuf, "center") == 0)
html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
CSS_TYPE_ENUM, TEXT_ALIGN_CENTER);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<table> align attribute is obsolete.\n");
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "bgcolor"))) {
@@ -98,6 +110,8 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
if (bgcolor != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<table> bgcolor attribute is obsolete.\n");
}
html->styleEngine->style (); // evaluate now, so we can build non-css hints for the cells
@@ -177,6 +191,8 @@ void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
if (bgcolor != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<tr> bgcolor attribute is obsolete.\n");
}
if (a_Html_get_attr (html, tag, tagsize, "align")) {
@@ -361,9 +377,13 @@ static void Html_tag_open_table_cell(DilloHtml *html,
html->styleEngine->setNonCssHint (CSS_PROPERTY_TEXT_ALIGN,
CSS_TYPE_ENUM, text_align);
}
- if (a_Html_get_attr(html, tag, tagsize, "nowrap"))
+ if (a_Html_get_attr(html, tag, tagsize, "nowrap")) {
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<t%c> nowrap attribute is obsolete.\n",
+ (tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
html->styleEngine->setNonCssHint(CSS_PROPERTY_WHITE_SPACE,
CSS_TYPE_ENUM, WHITE_SPACE_NOWRAP);
+ }
a_Html_tag_set_align_attr (html, tag, tagsize);
@@ -371,6 +391,9 @@ static void Html_tag_open_table_cell(DilloHtml *html,
html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
CSS_TYPE_LENGTH_PERCENTAGE,
a_Html_parse_length (html, attrbuf));
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<t%c> width attribute is obsolete.\n",
+ (tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
}
a_Html_tag_set_valign_attr (html, tag, tagsize);
@@ -380,6 +403,9 @@ static void Html_tag_open_table_cell(DilloHtml *html,
if (bgcolor != -1)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BACKGROUND_COLOR,
CSS_TYPE_COLOR, bgcolor);
+ if (html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f)
+ BUG_MSG("<t%c> bgcolor attribute is obsolete.\n",
+ (tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');
}
default: