Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thunderbird 31.6 removes doctype

I have the problem that Thunderbird version 31.6.0 seemingly removes or ignores my <doctype /> declaration.
This becomes a problem when a <td /> is rendered that has a set height and additional padding-top or padding-bottom.
Normally, you would expect that Thunderbird adds height and padding like it does in Firefox: box-sizing: content-box;
By removing the <doctype /> the <td /> the height and padding are not added anymore and instead you end up with a smaller total height than expected, almost like: box-sizing: border-box but not quite.

You can easily reproduce this by using this source code and removing the <doctype />:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <body>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tbody>
            <tr>
                <td align="right" bgcolor="#ff00ff" style="background-color:#ff00ff;padding-top:50px;padding-right:20px;padding-bottom:50px;padding-left:0px;height:100px;" height="100" valign="top">
                    Text
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>

Email on Acid says newer Thunderbird versions accept the Doctype, but their document is already 4 years old.

Does anyone know if that is a current bug with Thunderbird or how else I can solve this?

Thanks in advance.

like image 438
Horen Avatar asked May 13 '15 16:05

Horen


1 Answers

According to Mozilla's DOCTYPE sniffing, the doctype became obsolete since Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1). So, if I am right, perhaps writing W3C compliant code could be the solution?

Did you try the fixed HTML from the validator? Checks "Clean up Markup with HTML-Tidy", it will output a valid HTML conforms to your Doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <style type="text/css">
        /*<![CDATA[*/
         td.c1 {background-color: #ff00ff; height: 100px; padding-bottom: 50px; padding-left: 0px; padding-right: 20px; padding-top: 50px}
        /*]]>*/
        </style>
    </head>
    <body>
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <tbody>
                <tr>
                    <td align="right" class="c1" height="100" valign="top">Text</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

It is just an idea, I do not know if Thunderbird will show as you want.

like image 145
Tiger-222 Avatar answered Jan 02 '23 09:01

Tiger-222