| Differences between
and this patch
- a/Source/WebCore/ChangeLog +22 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-07-07  Chris Dumez  <cdumez@apple.com>
2
3
        tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there are no rows / cells
4
        https://bugs.webkit.org/show_bug.cgi?id=159527
5
        <rdar://problem/27232261>
6
7
        Reviewed by Alex Christensen.
8
9
        tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there
10
        are no rows / cells:
11
        - https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-deleterow
12
        - https://html.spec.whatwg.org/multipage/tables.html#dom-tr-deletecell
13
14
        Firefox and Chrome do not throw but WebKit was throwing.
15
16
        No new tests, rebaselined existing tests.
17
18
        * html/HTMLTableRowElement.cpp:
19
        (WebCore::HTMLTableRowElement::deleteCell):
20
        * html/HTMLTableSectionElement.cpp:
21
        (WebCore::HTMLTableSectionElement::deleteRow):
22
1
2016-07-07  Dean Jackson  <dino@apple.com>
23
2016-07-07  Dean Jackson  <dino@apple.com>
2
24
3
        REGRESSION(r200769): animations are no longer overridden
25
        REGRESSION(r200769): animations are no longer overridden
- a/Source/WebCore/html/HTMLTableRowElement.cpp -2 / +6 lines
Lines 130-137 void HTMLTableRowElement::deleteCell(int index, ExceptionCode& ec) a/Source/WebCore/html/HTMLTableRowElement.cpp_sec1
130
{
130
{
131
    Ref<HTMLCollection> children = cells();
131
    Ref<HTMLCollection> children = cells();
132
    int numCells = children->length();
132
    int numCells = children->length();
133
    if (index == -1)
133
    if (index == -1) {
134
        index = numCells-1;
134
        if (!numCells)
135
            return;
136
137
        index = numCells - 1;
138
    }
135
    if (index >= 0 && index < numCells)
139
    if (index >= 0 && index < numCells)
136
        HTMLElement::removeChild(*children->item(index), ec);
140
        HTMLElement::removeChild(*children->item(index), ec);
137
    else
141
    else
- a/Source/WebCore/html/HTMLTableSectionElement.cpp -1 / +5 lines
Lines 85-92 void HTMLTableSectionElement::deleteRow(int index, ExceptionCode& ec) a/Source/WebCore/html/HTMLTableSectionElement.cpp_sec1
85
{
85
{
86
    Ref<HTMLCollection> children = rows();
86
    Ref<HTMLCollection> children = rows();
87
    int numRows = children->length();
87
    int numRows = children->length();
88
    if (index == -1)
88
    if (index == -1) {
89
        if (!numRows)
90
            return;
91
89
        index = numRows - 1;
92
        index = numRows - 1;
93
    }
90
    if (index >= 0 && index < numRows)
94
    if (index >= 0 && index < numRows)
91
        HTMLElement::removeChild(*children->item(index), ec);
95
        HTMLElement::removeChild(*children->item(index), ec);
92
    else
96
    else
- a/LayoutTests/imported/w3c/ChangeLog +13 lines
Lines 1-5 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2016-07-07  Chris Dumez  <cdumez@apple.com>
1
2016-07-07  Chris Dumez  <cdumez@apple.com>
2
2
3
        tdody.deleteRow(-1) and tr.deleteCell(-1) should not throw when there are no rows / cells
4
        https://bugs.webkit.org/show_bug.cgi?id=159527
5
        <rdar://problem/27232261>
6
7
        Reviewed by Alex Christensen.
8
9
        Rebaseline now that more checks are passing.
10
11
        * web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt:
12
        * web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt:
13
14
2016-07-07  Chris Dumez  <cdumez@apple.com>
15
3
        td / th should be exposed as HTMLTableCellElement objects
16
        td / th should be exposed as HTMLTableCellElement objects
4
        https://bugs.webkit.org/show_bug.cgi?id=159518
17
        https://bugs.webkit.org/show_bug.cgi?id=159518
5
        <rdar://problem/27225436>
18
        <rdar://problem/27225436>
- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt -1 / +1 lines
Lines 3-7 PASS HTMLTableSectionElement deleteRow(0) a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt_sec1
3
PASS HTMLTableSectionElement deleteRow(-1) 
3
PASS HTMLTableSectionElement deleteRow(-1) 
4
PASS HTMLTableSectionElement deleteRow(rows.length) 
4
PASS HTMLTableSectionElement deleteRow(rows.length) 
5
PASS HTMLTableSectionElement deleteRow(-2) 
5
PASS HTMLTableSectionElement deleteRow(-2) 
6
FAIL HTMLTableSectionElement deleteRow(-1) with no rows IndexSizeError: DOM Exception 1
6
PASS HTMLTableSectionElement deleteRow(-1) with no rows 
7
7
- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt -1 / +1 lines
Lines 3-7 PASS HTMLTableRowElement deleteCell(0) a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt_sec1
3
PASS HTMLTableRowElement deleteCell(-1) 
3
PASS HTMLTableRowElement deleteCell(-1) 
4
PASS HTMLTableRowElement deleteCell(-2) 
4
PASS HTMLTableRowElement deleteCell(-2) 
5
PASS HTMLTableRowElement deleteCell(cells.length) 
5
PASS HTMLTableRowElement deleteCell(cells.length) 
6
FAIL HTMLTableRowElement deleteCell(-1) with no cells IndexSizeError: DOM Exception 1
6
PASS HTMLTableRowElement deleteCell(-1) with no cells 
7
7

Return to Bug 159527