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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return cell.release(); | 135 return cell.release(); |
136 } | 136 } |
137 | 137 |
138 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState) | 138 void HTMLTableRowElement::deleteCell(int index, ExceptionState& exceptionState) |
139 { | 139 { |
140 RefPtr<HTMLCollection> children = cells(); | 140 RefPtr<HTMLCollection> children = cells(); |
141 int numCells = children ? children->length() : 0; | 141 int numCells = children ? children->length() : 0; |
142 if (index == -1) | 142 if (index == -1) |
143 index = numCells-1; | 143 index = numCells-1; |
144 if (index >= 0 && index < numCells) { | 144 if (index >= 0 && index < numCells) { |
145 RefPtr<Node> cell = children->item(index); | 145 RefPtr<Element> cell = children->item(index); |
146 HTMLElement::removeChild(cell.get(), exceptionState); | 146 HTMLElement::removeChild(cell.get(), exceptionState); |
147 } else { | 147 } else { |
148 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [0, " + String::number(numCell
s) + ")."); | 148 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [0, " + String::number(numCell
s) + ")."); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() | 152 PassRefPtr<HTMLCollection> HTMLTableRowElement::cells() |
153 { | 153 { |
154 return ensureCachedHTMLCollection(TRCells); | 154 return ensureCachedHTMLCollection(TRCells); |
155 } | 155 } |
156 | 156 |
157 } | 157 } |
OLD | NEW |