我最近一直在编写一个输出html页面的脚本。当从Jenkins构建并加载html页面(stage artefact)时,Firefox会从表格单元格中删除样式信息。
来源:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Build_Metrics</title>
</head>
<body>
<table><tbody>
<tr><td style="width:180px; background-color:white"><b>Build_Metrics</b></td><td style="width:180px; background-color:white"></td></tr>
<tr><td style="width:180px; background-color:#FFFFCC">Builds</td><td style="width:180px; background-color:#FFFFCC"> </td></tr>
<tr><td style="width:180px; background-color:#FFFFCC">Last Build</td><td style="width:180px; background-color:lime">SUCCESS</td></tr>
<!--extra rows removed-->
</tbody></table></body></html>
使用“Inspect Element”观察Firefox对页面的表示,每个 td 开头标记都替换为:
<td style="">
在本地保存源并在Firefox中打开html文件会导致页面呈现符合预期。 在Internet Explorer中打开任一页面(本地或Jenkins托管)都会提供一个包含样式集的页面。
源中删除的行不包含提供的代码中没有的任何内容(唯一的区别是字符串和颜色),但包含我无法在此处发布的内容。完整页面同时传递WDG HTML Validator和w3c validators,没有任何警告或错误。
可能导致样式字符串被""
替换的原因?
如果有帮助,则为Firefox ESR 38.1.0
如果是这个版本的Firefox中的错误,是否有解决方法?
<table>
<tbody>
<tr>
<td style="width:180px; background-color:white"><b>Build_Metrics</b></td>
<td style="width:180px; background-color:white"></td>
</tr>
<tr>
<td style="width:180px; background-color:#FFFFCC">Builds</td>
<td style="width:180px; background-color:#FFFFCC"> </td>
</tr>
<tr>
<td style="width:180px; background-color:#FFFFCC">Last Build</td>
<td style="width:180px; background-color:lime">SUCCESS</td>
</tr>
<!--extra rows removed-->
</tbody>
</table>