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 ...@@ -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
PASS All correct nodes found for rect PASS All correct nodes found for rect
Check area hits crossing neighbouring table cells Check area hits crossing neighbouring table cells
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [170,165], [41,21] - TD#td22
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [240,265], [41,21] - TD#td43
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [165,170], [21,41] - TD#td22
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [265,240], [21,41] - TD#td34
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [170,170], [41,41] - TD#td22
Check area hits crossing entire table cells Check area hits crossing entire table cells
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [110,165], [181,21] - TD#td21
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [165,110], [21,181] - TD#td12
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [90,90], [121,121] - TD#td11
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [115,230], [21,131] - TD#td31
PASS All correct nodes found for rect FAIL Unexpected node #0 for rect [230,140], [131,21] - TD#td13
Check area hits on right-to-left table 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 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 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 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 PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
.tblr { .tblr {
-webkit-writing-mode: vertical-lr; -webkit-writing-mode: vertical-lr;
} }
table td {
background: gray;
}
table:hover td {
background: rgba(0,0,0,0.1);
}
</style> </style>
<script src="../../../resources/js-test.js"></script> <script src="../../../resources/js-test.js"></script>
<script src="resources/nodesFromRect.js"></script> <script src="resources/nodesFromRect.js"></script>
...@@ -51,7 +57,6 @@ ...@@ -51,7 +57,6 @@
<td id=td44> <td id=td44>
</table> </table>
</div> </div>
<script> <script>
function runTest() function runTest()
{ {
...@@ -80,41 +85,37 @@ ...@@ -80,41 +85,37 @@
check(290, 290, 41, 41, [e.td44, e.testtable, e.sandbox]); check(290, 290, 41, 41, [e.td44, e.testtable, e.sandbox]);
debug('Check area hits crossing neighbouring table cells'); debug('Check area hits crossing neighbouring table cells');
check(170, 165, 41, 21, [e.td22, e.td23, e.testtable]); check(170, 165, 41, 21, [e.td23, e.td22, e.testtable]);
check(240, 265, 41, 21, [e.td43, e.td44, e.testtable]); check(240, 265, 41, 21, [e.td44, e.td43, e.testtable]);
check(165, 170, 21, 41, [e.td22, e.td32, e.testtable]); check(165, 170, 21, 41, [e.td32, e.td22, e.testtable]);
check(265, 240, 21, 41, [e.td34, e.td44, e.testtable]); check(265, 240, 21, 41, [e.td44, e.td34, e.testtable]);
check(170, 170, 41, 41, [e.td22, e.td23, e.td32, e.td33, 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'); debug('Check area hits crossing entire table cells');
check(110, 165, 181, 21, [e.td21, e.td22, e.td23, e.td24, e.testtable]); check(110, 165, 181, 21, [e.td24, e.td23, e.td22, e.td21, e.testtable]);
check(165, 110, 21, 181, [e.td12, e.td22, e.td32, e.td42, e.testtable]); check(165, 110, 21, 181, [e.td42, e.td32, e.td22, e.td12, e.testtable]);
check(90, 90, 121, 121, [e.td11, e.td12, e.td13, check(90, 90, 121, 121, [e.td33, e.td32, e.td31,
e.td21, e.td22, e.td23, e.td23, e.td22, e.td21,
e.td31, e.td32, e.td33, e.td13, e.td12, e.td11,
e.testtable, e.sandbox]); e.testtable, e.sandbox]);
check(115, 230, 21, 131, [e.td31, e.td41, e.testtable, e.sandbox]); check(115, 230, 21, 131, [e.td41, e.td31, e.testtable, e.sandbox]);
check(230, 140, 131, 21, [e.td13, e.td14, e.td23, e.td24, 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'); debug('Check area hits on right-to-left table');
e['testtable'].setAttribute('class', 'rtl'); e['testtable'].setAttribute('class', 'rtl');
check(265, 115, 21, 21, [e.td11]); check(265, 115, 21, 21, [e.td11]);
check(165, 165, 21, 21, [e.td23]); 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'); debug('Check area hits on flipped (tb-lr) table');
e['testtable'].setAttribute('class', 'tblr'); e['testtable'].setAttribute('class', 'tblr');
check(265, 115, 21, 21, [e.td41]); check(265, 115, 21, 21, [e.td41]);
check(115, 265, 21, 21, [e.td14]); 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(); runTest();
</script> </script>
<p id='description'></p>
<span id="console"></span>
</body> </body>
</html> </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