changeset 24054:fdf7794be41d

hgweb: replace implicit <tbody> with explicit <thead> where appropriate Some templates in paper style use <tbody> elements inside <table> to assign a class to "body" part of that table (in this case, to make rows striped). The problem is that the <tbody> is preceded by <tr> element, which browsers understand as an implicit start of table body, so the following exlicit <tbody> will actually be "nested", which is not valid. Since that first <tr> contains table headers, wrapping it in <thead> is both semantically correct and follows the advertised XHTML 1.1 doctype.
author Anton Shestakov <engored@ya.ru>
date Fri, 06 Feb 2015 15:52:55 +0800
parents dc4fa3992414
children 7f4e6b5fce03
files mercurial/templates/paper/bookmarks.tmpl mercurial/templates/paper/branches.tmpl mercurial/templates/paper/fileannotate.tmpl mercurial/templates/paper/filelog.tmpl mercurial/templates/paper/index.tmpl mercurial/templates/paper/manifest.tmpl mercurial/templates/paper/search.tmpl mercurial/templates/paper/shortlog.tmpl mercurial/templates/paper/tags.tmpl tests/test-hgweb-commands.t tests/test-hgweb-descend-empties.t tests/test-hgweb-empty.t tests/test-hgweb-filelog.t tests/test-hgweb.t tests/test-hgwebdir.t tests/test-highlight.t
diffstat 16 files changed, 48 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/paper/bookmarks.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/bookmarks.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -41,10 +41,12 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>bookmark</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries%bookmarkentry}
 </tbody>
--- a/mercurial/templates/paper/branches.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/branches.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -41,10 +41,12 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>branch</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries % branchentry}
 </tbody>
--- a/mercurial/templates/paper/fileannotate.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/fileannotate.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -68,10 +68,12 @@
 
 <div class="overflow">
 <table class="bigtable">
+<thead>
 <tr>
  <th class="annotate">rev</th>
  <th class="line">&nbsp;&nbsp;line source</th>
 </tr>
+</thead>
 <tbody class="stripes2">
   {annotate%annotateline}
 </tbody>
--- a/mercurial/templates/paper/filelog.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/filelog.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -58,11 +58,13 @@
 | {nav%filenav}</div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries%filelogentry}
 </tbody>
--- a/mercurial/templates/paper/index.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/index.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -12,6 +12,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 
 <table class="bigtable">
+    <thead>
     <tr>
         <th><a href="?sort={sort_name}">Name</a></th>
         <th><a href="?sort={sort_description}">Description</a></th>
@@ -20,6 +21,7 @@
         <th>&nbsp;</th>
         <th>&nbsp;</th>
     </tr>
+    </thead>
     <tbody class="stripes2">
     {entries%indexentry}
     </tbody>
--- a/mercurial/templates/paper/manifest.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/manifest.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -39,11 +39,13 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
   <th class="name">name</th>
   <th class="size">size</th>
   <th class="permissions">permissions</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 <tr class="fileline">
   <td class="name"><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
--- a/mercurial/templates/paper/search.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/search.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -43,11 +43,13 @@
 </div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries}
 </tbody>
--- a/mercurial/templates/paper/shortlog.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/shortlog.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -54,11 +54,13 @@
 </div>
 
 <table class="bigtable">
+<thead>
  <tr>
   <th class="age">age</th>
   <th class="author">author</th>
   <th class="description">description</th>
  </tr>
+</thead>
 <tbody class="stripes2">
 {entries%shortlogentry}
 </tbody>
--- a/mercurial/templates/paper/tags.tmpl	Sat Jan 31 12:54:35 2015 -0500
+++ b/mercurial/templates/paper/tags.tmpl	Fri Feb 06 15:52:55 2015 +0800
@@ -41,10 +41,12 @@
 </form>
 
 <table class="bigtable">
+<thead>
 <tr>
  <th>tag</th>
  <th>node</th>
 </tr>
+</thead>
 <tbody class="stripes2">
 {entries%tagentry}
 </tbody>
--- a/tests/test-hgweb-commands.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgweb-commands.t	Fri Feb 06 15:52:55 2015 +0800
@@ -751,11 +751,13 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -1010,11 +1012,13 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
--- a/tests/test-hgweb-descend-empties.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgweb-descend-empties.t	Fri Feb 06 15:52:55 2015 +0800
@@ -81,11 +81,13 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/9087c84a0f5d/">[up]</a></td>
--- a/tests/test-hgweb-empty.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgweb-empty.t	Fri Feb 06 15:52:55 2015 +0800
@@ -73,11 +73,13 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
   
   </tbody>
@@ -182,11 +184,13 @@
   </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
   
   </tbody>
@@ -428,11 +432,13 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/000000000000/">[up]</a></td>
--- a/tests/test-hgweb-filelog.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgweb-filelog.t	Fri Feb 06 15:52:55 2015 +0800
@@ -180,11 +180,13 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -289,11 +291,13 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -398,11 +402,13 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
@@ -502,11 +508,13 @@
   | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
   
   <table class="bigtable">
+  <thead>
    <tr>
     <th class="age">age</th>
     <th class="author">author</th>
     <th class="description">description</th>
    </tr>
+  </thead>
   <tbody class="stripes2">
    <tr>
     <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
--- a/tests/test-hgweb.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgweb.t	Fri Feb 06 15:52:55 2015 +0800
@@ -272,11 +272,13 @@
   </form>
   
   <table class="bigtable">
+  <thead>
   <tr>
     <th class="name">name</th>
     <th class="size">size</th>
     <th class="permissions">permissions</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
   <tr class="fileline">
     <td class="name"><a href="/file/2ef0ac749a14/">[up]</a></td>
--- a/tests/test-hgwebdir.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-hgwebdir.t	Fri Feb 06 15:52:55 2015 +0800
@@ -201,6 +201,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -209,6 +210,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
   <tr>
@@ -699,6 +701,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/t">t</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -707,6 +710,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
   <tr>
@@ -1128,6 +1132,7 @@
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   
   <table class="bigtable">
+      <thead>
       <tr>
           <th><a href="?sort=name">Name</a></th>
           <th><a href="?sort=description">Description</a></th>
@@ -1136,6 +1141,7 @@
           <th>&nbsp;</th>
           <th>&nbsp;</th>
       </tr>
+      </thead>
       <tbody class="stripes2">
       
       </tbody>
--- a/tests/test-highlight.t	Sat Jan 31 12:54:35 2015 -0500
+++ b/tests/test-highlight.t	Fri Feb 06 15:52:55 2015 +0800
@@ -268,10 +268,12 @@
   
   <div class="overflow">
   <table class="bigtable">
+  <thead>
   <tr>
    <th class="annotate">rev</th>
    <th class="line">&nbsp;&nbsp;line source</th>
   </tr>
+  </thead>
   <tbody class="stripes2">
     
   <tr id="l1">