Use calculated index instead of DOM index

There seems to be a scenario when there are multiple `thead` entries in a table where some versions of Firefox (around 47) return -1 for `cell.parentNode.rowIndex`, which winds up with the whole top part being laid out wrongly.

However, I looked this over and did not see any reason why not to use the calculated `i` for the row index instead.
This commit is contained in:
ced-b 2017-07-02 16:14:58 -04:00 committed by Rob Garrison
parent 52e8c024b0
commit 6beda6a7ba

View File

@ -548,7 +548,7 @@
timer = new Date(); timer = new Date();
} }
// children tr in tfoot - see issue #196 & #547 // children tr in tfoot - see issue #196 & #547
// don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells // don't pass table.config to CColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) ); c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
// add icon if cssIcon option exists // add icon if cssIcon option exists
icon = c.cssIcon ? icon = c.cssIcon ?
@ -2240,7 +2240,7 @@
cells = $rows[ i ].cells; cells = $rows[ i ].cells;
for ( j = 0; j < cells.length; j++ ) { for ( j = 0; j < cells.length; j++ ) {
cell = cells[ j ]; cell = cells[ j ];
rowIndex = cell.parentNode.rowIndex; rowIndex = i;
rowSpan = cell.rowSpan || 1; rowSpan = cell.rowSpan || 1;
colSpan = cell.colSpan || 1; colSpan = cell.colSpan || 1;
if ( typeof matrix[ rowIndex ] === 'undefined' ) { if ( typeof matrix[ rowIndex ] === 'undefined' ) {