changeset 24042:bf661a03fddc

hgweb: use css margin instead of empty <p> before diffstat table The <p> elements were used to create an empty space between the diffstat link and the diffstat table, but they don't have any semantic meaning, so it is better to use css instead. Default margins for <p> elements can differ depending on the browser, but usually the margin is 1em (exceptions are IE 6 and 7 with 14pt, which is comparable). The css rule sets top margin to 1em. This change is a "better version" of 70cfa7e1611b, where <p> elements were simply properly closed.
author Anton Shestakov <engored@ya.ru>
date Thu, 05 Feb 2015 20:34:30 +0800
parents 9756f943634f
children 1fdb1d909c79
files mercurial/templates/paper/changeset.tmpl mercurial/templates/static/style-paper.css tests/test-hgweb-commands.t tests/test-hgweb-diffs.t tests/test-hgweb-removed.t
diffstat 5 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/paper/changeset.tmpl	Thu Feb 05 19:24:35 2015 +0800
+++ b/mercurial/templates/paper/changeset.tmpl	Thu Feb 05 20:34:30 2015 +0800
@@ -68,8 +68,7 @@
     <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
     <div id="diffstatdetails" style="display:none;">
       <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
-      <p></p>
-      <table class="stripes2">{diffstat}</table>
+      <table class="diffstat-table stripes2">{diffstat}</table>
     </div>
   </td>
 </tr>
--- a/mercurial/templates/static/style-paper.css	Thu Feb 05 19:24:35 2015 +0800
+++ b/mercurial/templates/static/style-paper.css	Thu Feb 05 20:34:30 2015 +0800
@@ -108,6 +108,9 @@
 .minusline { color: #dc143c; } /* crimson */
 .atline { color: purple; }
 
+.diffstat-table {
+  margin-top: 1em;
+}
 .diffstat-file {
   white-space: nowrap;
   font-size: 90%;
--- a/tests/test-hgweb-commands.t	Thu Feb 05 19:24:35 2015 +0800
+++ b/tests/test-hgweb-commands.t	Thu Feb 05 20:34:30 2015 +0800
@@ -893,8 +893,7 @@
       <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
       <div id="diffstatdetails" style="display:none;">
         <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
-        <p></p>
-        <table class="stripes2">  <tr>
+        <table class="diffstat-table stripes2">  <tr>
       <td class="diffstat-file"><a href="#l1.1">da/foo</a></td>
       <td class="diffstat-total" align="right">1</td>
       <td class="diffstat-graph">
--- a/tests/test-hgweb-diffs.t	Thu Feb 05 19:24:35 2015 +0800
+++ b/tests/test-hgweb-diffs.t	Thu Feb 05 20:34:30 2015 +0800
@@ -118,8 +118,7 @@
       <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
       <div id="diffstatdetails" style="display:none;">
         <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
-        <p></p>
-        <table class="stripes2">  <tr>
+        <table class="diffstat-table stripes2">  <tr>
       <td class="diffstat-file"><a href="#l1.1">a</a></td>
       <td class="diffstat-total" align="right">1</td>
       <td class="diffstat-graph">
@@ -390,8 +389,7 @@
       <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
       <div id="diffstatdetails" style="display:none;">
         <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
-        <p></p>
-        <table class="stripes2">  <tr>
+        <table class="diffstat-table stripes2">  <tr>
       <td class="diffstat-file"><a href="#l1.1">a</a></td>
       <td class="diffstat-total" align="right">1</td>
       <td class="diffstat-graph">
--- a/tests/test-hgweb-removed.t	Thu Feb 05 19:24:35 2015 +0800
+++ b/tests/test-hgweb-removed.t	Thu Feb 05 20:34:30 2015 +0800
@@ -99,8 +99,7 @@
       <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
       <div id="diffstatdetails" style="display:none;">
         <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
-        <p></p>
-        <table class="stripes2">  <tr>
+        <table class="diffstat-table stripes2">  <tr>
       <td class="diffstat-file"><a href="#l1.1">a</a></td>
       <td class="diffstat-total" align="right">1</td>
       <td class="diffstat-graph">