Changeset 207640 in webkit
- Timestamp:
- Oct 20, 2016 2:00:54 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r207573 r207640 1 2016-10-20 Chris Dumez <cdumez@apple.com> 2 3 Make table.deleteRow(-1) a no-op when there are no rows 4 https://bugs.webkit.org/show_bug.cgi?id=163746 5 6 Reviewed by Alex Christensen. 7 8 Import test coverage from: 9 - https://github.com/w3c/web-platform-tests/pull/4001 10 11 * web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row-expected.txt: 12 * web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row.html: 13 * web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt: 14 * web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html: 15 * web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt: 16 * web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html: 17 1 18 2016-10-19 Dean Jackson <dino@apple.com> 2 19 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row-expected.txt
r204079 r207640 1 First column Second column2 1 3 2 PASS deleteRow function invalid argument … … 5 4 PASS check normal deleteRow 6 5 PASS check normal deleteRow bis 6 PASS deleteRow(-1) with no rows 7 PASS deleteRow(0) with no rows 7 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row.html
r204079 r207640 43 43 }, "check normal deleteRow"); 44 44 test(function() { 45 while (el.rows.length > 1) { 45 assert_equals(el.rows.length, 3); 46 do { 47 var old_length = el.rows.length; 46 48 el.deleteRow(-1); 47 }48 assert_equals(1,el.rows.length);49 assert_equals(el.rows.length, old_length - 1); 50 } while (el.rows.length); 49 51 }, "check normal deleteRow bis"); 52 53 test(function() { 54 assert_equals(el.rows.length, 0); 55 el.deleteRow(-1); 56 }, 'deleteRow(-1) with no rows'); 57 58 test(function() { 59 assert_equals(el.rows.length, 0); 60 assert_throws("IndexSizeError", function() { 61 el.deleteRow(0); 62 }); 63 }, 'deleteRow(0) with no rows'); 50 64 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt
r202952 r207640 5 5 PASS HTMLTableSectionElement deleteRow(-2) 6 6 PASS HTMLTableSectionElement deleteRow(-1) with no rows 7 PASS HTMLTableSectionElement deleteRow(0) with no rows 7 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
r194580 r207640 52 52 }, "HTMLTableSectionElement deleteRow(-1) with no rows"); 53 53 54 test(function () { 55 assert_equals(tbody.rows.length, 0); 56 assert_throws("IndexSizeError", function () { 57 tbody.deleteRow(0); 58 }); 59 }, "HTMLTableSectionElement deleteRow(0) with no rows"); 60 54 61 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt
r202952 r207640 5 5 PASS HTMLTableRowElement deleteCell(cells.length) 6 6 PASS HTMLTableRowElement deleteCell(-1) with no cells 7 PASS HTMLTableRowElement deleteCell(0) with no cells 7 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
r194580 r207640 52 52 }, "HTMLTableRowElement deleteCell(-1) with no cells"); 53 53 54 test(function () { 55 assert_equals(tr.cells.length, 0); 56 assert_throws("IndexSizeError", function () { 57 tr.deleteCell(0); 58 }); 59 }, "HTMLTableRowElement deleteCell(0) with no cells"); 60 54 61 </script> -
trunk/Source/WebCore/ChangeLog
r207638 r207640 1 2016-10-20 Chris Dumez <cdumez@apple.com> 2 3 Make table.deleteRow(-1) a no-op when there are no rows 4 https://bugs.webkit.org/show_bug.cgi?id=163746 5 6 Reviewed by Alex Christensen. 7 8 Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing: 9 - https://github.com/whatwg/html/pull/1924 10 11 This is more consistent with the behavior of tbody.deleteRow(-1) and 12 tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the 13 same change via: 14 - https://codereview.chromium.org/2427963004/ 15 16 No new tests, updated existing tests. 17 18 * html/HTMLTableElement.cpp: 19 (WebCore::HTMLTableElement::deleteRow): 20 1 21 2016-10-20 Dave Hyatt <hyatt@apple.com> 2 22 -
trunk/Source/WebCore/html/HTMLTableElement.cpp
r207458 r207640 251 251 { 252 252 HTMLTableRowElement* row = nullptr; 253 if (index == -1) 253 if (index == -1) { 254 254 row = HTMLTableRowsCollection::lastRow(*this); 255 else { 255 if (!row) 256 return; 257 } else { 256 258 for (int i = 0; i <= index; ++i) { 257 259 row = HTMLTableRowsCollection::rowAfter(*this, row); … … 259 261 break; 260 262 } 261 }262 if (!row) {263 ec = INDEX_SIZE_ERR;264 return;263 if (!row) { 264 ec = INDEX_SIZE_ERR; 265 return; 266 } 265 267 } 266 268 row->remove(ec);
Note: See TracChangeset
for help on using the changeset viewer.