Commit 76bc24f1 authored by Jérome Perrin's avatar Jérome Perrin

Fix tables border in html viewer gadget

See merge request nexedi/erp5!1705
parents deba110c ac0ad881
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>testWebPageSaveAndViewXHTMLStyle-reference-snapshot-1.png</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>273</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>testWebPageSaveAndViewXHTMLStyle-reference-snapshot-1.png</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>1115</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testWebPageSaveAndViewXHTMLStyle</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Web Page Save and View with erp5_xhtml_style</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_and_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr>
<td rowspan="1" colspan="3" tal:content="template/title_and_id"></td>
</tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_erp5_web_common/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_page_module/WebPageModule_createTestWebPage?id=test_web_page&amp;reference=test_web_page
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/test_web_page/WebPage_viewEditor?editable_mode:int=1</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="editor"]//iframe</td>
<td></td>
</tr>
<tr>
<!-- gadget iframe -->
<td>selectFrame</td>
<td>//div[@data-gadget-scope="editor"]//iframe</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//iframe</td>
<td></td>
</tr>
<tr>
<!-- CKEditor iframe -->
<td>selectFrame</td>
<td>//iframe</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//body</td>
<td></td>
</tr>
<tr>
<td>assertEval</td>
<td>
(function (){
selenium.browserbot.getCurrentWindow().document.body.innerHTML = `
&lt;h1&gt;Some Example content&lt;/h1&gt;
&lt;h2&gt;Tables&lt;/h2&gt;
&lt;table border="1"&gt;
&lt;caption&gt;A table with border=1&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;First&lt;/th&gt;
&lt;th&gt;Second&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One&lt;/td&gt;
&lt;td&gt;Two&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;caption&gt;A table without border=1&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Third&lt;/th&gt;
&lt;th&gt;Forth&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Three&lt;/td&gt;
&lt;td&gt;Four&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
`;
return 'OK';
})()
<td>OK</td>
</tr>
<tr>
<td>selectFrame</td>
<td>relative=top</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@name="Base_edit:method"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=View</td>
<td></td>
</tr>
<tr>
<td>waitForText</td>
<td>//div[contains(@data-gadget-url, "gadget_html_viewer.html")]/h1</td>
<td>Some Example content</td>
</tr>
<tr>
<td>verifyImageMatchSnapshot</td>
<td>//div[contains(@data-gadget-url, "gadget_html_viewer.html")]</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -125,7 +125,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] listing {
div[data-gadget-url$="gadget_html_viewer.html"] table {
display: table;
border-spacing: 2px;
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] thead {
display: table-header-group;
......@@ -151,7 +150,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] colgroup {
div[data-gadget-url$="gadget_html_viewer.html"] tr {
display: table-row;
vertical-align: middle;
border: 1px solid #1F1F1F;
padding: 0 6pt;
}
div[data-gadget-url$="gadget_html_viewer.html"] td,
......@@ -159,11 +157,16 @@ div[data-gadget-url$="gadget_html_viewer.html"] th {
display: table-cell;
vertical-align: inherit;
padding: 0 6pt;
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] th {
font-weight: bold;
}
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"],
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] tr,
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] th,
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] td {
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] caption {
display: table-caption;
text-align: -webkit-center;
......
......@@ -140,7 +140,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] {
table {
display: table;
border-spacing: 2px;
border: 1px solid @colorforeground;
}
thead {
display: table-header-group;
......@@ -167,7 +166,6 @@ colgroup {
tr {
display: table-row;
vertical-align: middle;
border: 1px solid @colorforeground;
padding: 0 @margin-size;
}
......@@ -175,11 +173,18 @@ td, th {
display: table-cell;
vertical-align: inherit;
padding: 0 @margin-size;
border: 1px solid @colorforeground;
}
th {
font-weight: bold;
}
table[border="1"],
table[border="1"] tr,
table[border="1"] th,
table[border="1"] td {
border: 1px solid @colorforeground;
}
caption {
display: table-caption;
text-align: -webkit-center;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment