diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-04-20 21:23:38 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-04-28 22:37:01 +0200 |
commit | b18496029c93a601646245adeb19372d705e0aab (patch) | |
tree | 24f42595867fef128ed93a87596162f4acebae25 | |
parent | ad9b7a1bb01ac2aeed13a50991071fb2d565d7f3 (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/
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/table.cc | 14 | ||||
-rw-r--r-- | test/html/Makefile.am | 1 |
3 files changed, 3 insertions, 13 deletions
@@ -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 <main> 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("<t%c> 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 |