aboutsummaryrefslogtreecommitdiff
path: root/src/table.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-04-20 21:23:38 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-04-28 22:37:01 +0200
commitb18496029c93a601646245adeb19372d705e0aab (patch)
tree24f42595867fef128ed93a87596162f4acebae25 /src/table.cc
parentad9b7a1bb01ac2aeed13a50991071fb2d565d7f3 (diff)
Allow relative width td attributes in tables
Partially reverts commit f5a0b6030c2001e5a0fcacf8139afa800643eb47. Fixes the rendering test table-missing-width-in-one-column. Fixes: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/message/H7JEBC2HYNJ6FUPQM7ILBP7I5FLU33IZ/
Diffstat (limited to 'src/table.cc')
-rw-r--r--src/table.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/table.cc b/src/table.cc
index 3a1aded4..6d144380 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -420,17 +420,9 @@ static void Html_tag_open_table_cell(DilloHtml *html,
a_Html_tag_set_align_attr (html, tag, tagsize);
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "width"))) {
- CssLength l = a_Html_parse_length (html, attrbuf);
- /* Only apply the width if the width is given in pixels,
- * otherwise the percent value is applied to the size of the
- * cell instead of to the table available width */
- if (CSS_LENGTH_TYPE(l) == CSS_LENGTH_TYPE_PX) {
- html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
- CSS_TYPE_LENGTH, l);
- } else {
- /* TODO: Support relative sizes for HTML 4.01 pages in
- * transitional mode */
- }
+ 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.",
(tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h');