Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HtmlTable.selectNone fails with empty table #1081
HtmlTable.selectNone is failing when my table is empty. This appears to be due to the fact that HtmlTable.selectRange doesn't do very good bounds checking. It bounds properly bounds endRow, but doesn't deal with startRow < 0. Here's the relevant section of code:
Here's my suggested fix:
I dug into this a bit more, and it appears that there are already tests in the Specs directory which tickle this problem.
Without my change:
Whereas with my change, this test passes.
(I ran this test by simply opening up .../mootools-more/Tests/Specs/Runner/runner.html?preset=more-all&spec=HtmlTable.Select%20should%20select%20all%20and%20select%20none. in my browser)
In fact, running Tests/Specs/Runner/runner.html without my change gives me
and with my change: