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/ --- ChangeLog | 1 - src/table.cc | 14 +++----------- test/html/Makefile.am | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9201152a..10b6344f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,7 +58,6 @@ dillo-3.1 [not released yet] scroll_switches_tabs to disable the behavior. - Fix OpenSSL handling of unexpected EOF without close notify alert. - Expand home tilde '~' in the file plugin. - - Ignore width attribute with relative values for td and th elements. - Enable Doxygen for C files and use Awesome Doxygen theme. - Fix DPIs extension (.dpi.exe) in Windows systems via Cygwin. - Add support for the
HTML tag. 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'); diff --git a/test/html/Makefile.am b/test/html/Makefile.am index a34da697..b4627689 100644 --- a/test/html/Makefile.am +++ b/test/html/Makefile.am @@ -40,5 +40,4 @@ XFAIL_TESTS = \ render/max-width-html.html \ render/min-width-html.html \ render/span-padding.html \ - render/table-missing-width-in-one-column.html \ render/table-td-width-percent.html -- cgit v1.2.3