| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv
ed. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserv
ed. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 while (n); | 116 while (n); |
| 117 | 117 |
| 118 return rIndex; | 118 return rIndex; |
| 119 } | 119 } |
| 120 | 120 |
| 121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat
e& es) | 121 PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionStat
e& es) |
| 122 { | 122 { |
| 123 RefPtr<HTMLCollection> children = cells(); | 123 RefPtr<HTMLCollection> children = cells(); |
| 124 int numCells = children ? children->length() : 0; | 124 int numCells = children ? children->length() : 0; |
| 125 if (index < -1 || index > numCells) { | 125 if (index < -1 || index > numCells) { |
| 126 es.throwDOMException(IndexSizeError); | 126 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 127 return 0; | 127 return 0; |
| 128 } | 128 } |
| 129 | 129 |
| 130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, docu
ment()); | 130 RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, docu
ment()); |
| 131 if (index < 0 || index >= numCells) | 131 if (index < 0 || index >= numCells) |
| 132 appendChild(cell, es); | 132 appendChild(cell, es); |
| 133 else { | 133 else { |
| 134 Node* n; | 134 Node* n; |
| 135 if (index < 1) | 135 if (index < 1) |
| 136 n = firstChild(); | 136 n = firstChild(); |
| 137 else | 137 else |
| 138 n = children->item(index); | 138 n = children->item(index); |
| 139 insertBefore(cell, n, es); | 139 insertBefore(cell, n, es); |
| 140 } | 140 } |
| 141 return cell.release(); | 141 return cell.release(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void HTMLTableRowElement::deleteCell(int index, ExceptionState& es) | 144 void HTMLTableRowElement::deleteCell(int index, ExceptionState& es) |
| 145 { | 145 { |
| 146 RefPtr<HTMLCollection> children = cells(); | 146 RefPtr<HTMLCollection> children = cells(); |
| 147 int numCells = children ? children->length() : 0; | 147 int numCells = children ? children->length() : 0; |
| 148 if (index == -1) | 148 if (index == -1) |
| 149 index = numCells-1; | 149 index = numCells-1; |
| 150 if (index >= 0 && index < numCells) { | 150 if (index >= 0 && index < numCells) { |
| 151 RefPtr<Node> cell = children->item(index); | 151 RefPtr<Node> cell = children->item(index); |
| 152 HTMLElement::removeChild(cell.get(), es); | 152 HTMLElement::removeChild(cell.get(), es); |
| 153 } else { | 153 } else { |
| 154 es.throwDOMException(IndexSizeError); | 154 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() | 158 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() |
| 159 { | 159 { |
| 160 return ensureCachedHTMLCollection(TRCells); | 160 return ensureCachedHTMLCollection(TRCells); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es) | 163 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es) |
| 164 { | 164 { |
| 165 es.throwDOMException(NoModificationAllowedError); | 165 es.throwUninformativeAndGenericDOMException(NoModificationAllowedError); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| OLD | NEW |