From b18496029c93a601646245adeb19372d705e0aab Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sat, 20 Apr 2024 21:23:38 +0200 Subject: 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/ --- src/table.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') 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(" width attribute is obsolete.", (tagsize >=3 && (D_ASCII_TOLOWER(tag[2]) == 'd')) ? 'd' : 'h'); -- cgit v1.2.3