Last modified: 2011-11-12 17:53:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34047, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32047 - jquery.tablesorter.js: thead is before caption
jquery.tablesorter.js: thead is before caption
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: 1.18.0 release
Assigned To: Nobody - You can work on this!
https://forum.jquery.com/topic/in-tab...
: need-unittest, patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-30 08:33 UTC by Fomafix
Modified: 2011-11-12 17:53 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch for jquery.tablesorter.js (393 bytes, patch)
2011-11-07 13:16 UTC, Fomafix
Details

Description Fomafix 2011-10-30 08:33:08 UTC
The caption element must be the first element of a table element: http://www.w3.org/TR/html5/tabular-data.html#the-caption-element

{| class="wikitable sortable"
|+ CAPTION
|-
! THEAD
|-
| A
|-
| B
|- class="sortbottom"
| TFOOT
|}

is converted to

<table class="wikitable sortable jquery-tablesorter">
<thead>
<tr>
<th class="headerSort" title="Aufsteigend sortieren">THEAD</th>
</tr>
</thead>
<caption>CAPTION</caption>
<tbody>
<tr>
<td>A</td>
</tr>
<tr>
<td>B</td>
</tr>
<tr class="sortbottom">
<td>TFOOT</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>

expected result:

<table class="wikitable sortable jquery-tablesorter">
<caption>CAPTION</caption>
<thead>
<tr>
<th class="headerSort" title="Aufsteigend sortieren">THEAD</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
</tr>
<tr>
<td>B</td>
</tr>
</tbody>
<tfoot>
<tr class="sortbottom">
<td>TFOOT</td>
</tr>
</tfoot>
</table>
Comment 1 Antoine "hashar" Musso (WMF) 2011-10-30 17:16:29 UTC
Looks like a bug in JQuery tablesorter , specially the emulateTHeadAndFoot() method.
Comment 2 Roan Kattouw 2011-10-30 20:40:18 UTC
(In reply to comment #1)
> Looks like a bug in JQuery tablesorter , specially the emulateTHeadAndFoot()
> method.
Yes. It adds the emulated <thead> as the first element, but it should add it after any <caption> instead.
Comment 3 Mark A. Hershberger 2011-11-03 20:46:16 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Looks like a bug in JQuery tablesorter , specially the emulateTHeadAndFoot()
> > method.
> Yes. It adds the emulated <thead> as the first element, but it should add it
> after any <caption> instead.

Is there an upstream bug report for this?

(In reply to comment #0)
> The caption element must be the first element of a table element

Do you have a patch that we could use?
Comment 4 Fomafix 2011-11-07 13:16:05 UTC
Created attachment 9371 [details]
Patch for jquery.tablesorter.js
Comment 5 Sumana Harihareswara 2011-11-07 13:18:48 UTC
Thanks for the patch!  I'll ask someone to review it as soon as possible.  Adding the "patch" and "need-review" keywords to signal that this bug now includes a patch that needs review.
Comment 6 Mark A. Hershberger 2011-11-07 17:36:07 UTC
r102301 — also reported upstream
Comment 7 Antoine "hashar" Musso (WMF) 2011-11-07 17:49:11 UTC
r102303 - QUnit javascript tests.
Comment 8 Fomafix 2011-11-12 17:53:39 UTC
r102301 should included in 1.18 like Bug 32049.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links