Commit f13f0034 authored by Aleks Totic's avatar Aleks Totic Committed by Chromium LUCI CQ

Fix incorrect table nodesFromRect test

nodesFromRect returned table elements in an incorrect order in
legacy table code.
Test was modified to expect elements in correct order.
It now passes in TablesNG.

Change-Id: Ibdd1aef2b0fe5636c2bf8d560a7590acc463818d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616945Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841682}
parent 1d01e099
......@@ -12,25 +12,25 @@ PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
Check area hits crossing neighbouring table cells
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
FAIL Unexpected node #0 for rect [170,165], [41,21] - TD#td22
FAIL Unexpected node #0 for rect [240,265], [41,21] - TD#td43
FAIL Unexpected node #0 for rect [165,170], [21,41] - TD#td22
FAIL Unexpected node #0 for rect [265,240], [21,41] - TD#td34
FAIL Unexpected node #0 for rect [170,170], [41,41] - TD#td22
Check area hits crossing entire table cells
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
FAIL Unexpected node #0 for rect [110,165], [181,21] - TD#td21
FAIL Unexpected node #0 for rect [165,110], [21,181] - TD#td12
FAIL Unexpected node #0 for rect [90,90], [121,121] - TD#td11
FAIL Unexpected node #0 for rect [115,230], [21,131] - TD#td31
FAIL Unexpected node #0 for rect [230,140], [131,21] - TD#td13
Check area hits on right-to-left table
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
FAIL Unexpected node #0 for rect [165,170], [21,41] - TD#td23
Check area hits on flipped (tb-lr) table
PASS All correct nodes found for rect
PASS All correct nodes found for rect
PASS All correct nodes found for rect
FAIL Unexpected node #0 for rect [110,165], [181,21] - TD#td12
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -21,6 +21,12 @@
.tblr {
-webkit-writing-mode: vertical-lr;
}
table td {
background: gray;
}
table:hover td {
background: rgba(0,0,0,0.1);
}
</style>
<script src="../../../resources/js-test.js"></script>
<script src="resources/nodesFromRect.js"></script>
......@@ -51,7 +57,6 @@
<td id=td44>
</table>
</div>
<script>
function runTest()
{
......@@ -80,41 +85,37 @@
check(290, 290, 41, 41, [e.td44, e.testtable, e.sandbox]);
debug('Check area hits crossing neighbouring table cells');
check(170, 165, 41, 21, [e.td22, e.td23, e.testtable]);
check(240, 265, 41, 21, [e.td43, e.td44, e.testtable]);
check(165, 170, 21, 41, [e.td22, e.td32, e.testtable]);
check(265, 240, 21, 41, [e.td34, e.td44, e.testtable]);
check(170, 170, 41, 41, [e.td22, e.td23, e.td32, e.td33, e.testtable]);
check(170, 165, 41, 21, [e.td23, e.td22, e.testtable]);
check(240, 265, 41, 21, [e.td44, e.td43, e.testtable]);
check(165, 170, 21, 41, [e.td32, e.td22, e.testtable]);
check(265, 240, 21, 41, [e.td44, e.td34, e.testtable]);
check(170, 170, 41, 41, [e.td33, e.td32, e.td23, e.td22, e.testtable]);
debug('Check area hits crossing entire table cells');
check(110, 165, 181, 21, [e.td21, e.td22, e.td23, e.td24, e.testtable]);
check(165, 110, 21, 181, [e.td12, e.td22, e.td32, e.td42, e.testtable]);
check(90, 90, 121, 121, [e.td11, e.td12, e.td13,
e.td21, e.td22, e.td23,
e.td31, e.td32, e.td33,
e.testtable, e.sandbox]);
check(115, 230, 21, 131, [e.td31, e.td41, e.testtable, e.sandbox]);
check(230, 140, 131, 21, [e.td13, e.td14, e.td23, e.td24, e.testtable, e.sandbox]);
check(110, 165, 181, 21, [e.td24, e.td23, e.td22, e.td21, e.testtable]);
check(165, 110, 21, 181, [e.td42, e.td32, e.td22, e.td12, e.testtable]);
check(90, 90, 121, 121, [e.td33, e.td32, e.td31,
e.td23, e.td22, e.td21,
e.td13, e.td12, e.td11,
e.testtable, e.sandbox]);
check(115, 230, 21, 131, [e.td41, e.td31, e.testtable, e.sandbox]);
check(230, 140, 131, 21, [e.td24, e.td23, e.td14, e.td13, e.testtable, e.sandbox]);
debug('Check area hits on right-to-left table');
e['testtable'].setAttribute('class', 'rtl');
check(265, 115, 21, 21, [e.td11]);
check(165, 165, 21, 21, [e.td23]);
check(165, 170, 21, 41, [e.td23, e.td33, e.testtable]);
check(165, 170, 21, 41, [e.td33, e.td23, e.testtable]);
debug('Check area hits on flipped (tb-lr) table');
e['testtable'].setAttribute('class', 'tblr');
check(265, 115, 21, 21, [e.td41]);
check(115, 265, 21, 21, [e.td14]);
check(110, 165, 181, 21, [e.td12, e.td22, e.td32, e.td42, e.testtable]);
check(110, 165, 181, 21, [e.td42, e.td32, e.td22, e.td12, e.testtable]);
}
runTest();
</script>
<p id='description'></p>
<span id="console"></span>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment