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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const Node* n = this; | 107 const Node* n = this; |
108 do { | 108 do { |
109 n = n->previousSibling(); | 109 n = n->previousSibling(); |
110 if (n && isHTMLTableRowElement(*n)) | 110 if (n && isHTMLTableRowElement(*n)) |
111 ++rIndex; | 111 ++rIndex; |
112 } while (n); | 112 } while (n); |
113 | 113 |
114 return rIndex; | 114 return rIndex; |
115 } | 115 } |
116 | 116 |
117 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(ExceptionSta
te& exceptionState) | |
118 { | |
119 // The default 'index' argument value is -1. | |
120 return insertCell(-1, exceptionState); | |
121 } | |
122 | |
123 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E
xceptionState& exceptionState) | 117 PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, E
xceptionState& exceptionState) |
124 { | 118 { |
125 RefPtrWillBeRawPtr<HTMLCollection> children = cells(); | 119 RefPtrWillBeRawPtr<HTMLCollection> children = cells(); |
126 int numCells = children ? children->length() : 0; | 120 int numCells = children ? children->length() : 0; |
127 if (index < -1 || index > numCells) { | 121 if (index < -1 || index > numCells) { |
128 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [-1, " + String::number(numCel
ls) + "]."); | 122 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [-1, " + String::number(numCel
ls) + "]."); |
129 return nullptr; | 123 return nullptr; |
130 } | 124 } |
131 | 125 |
132 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create
(tdTag, document()); | 126 RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create
(tdTag, document()); |
(...skipping 17 matching lines...) Expand all Loading... |
150 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [0, " + String::number(numCell
s) + ")."); | 144 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(index) + ") is outside the range [0, " + String::number(numCell
s) + ")."); |
151 } | 145 } |
152 } | 146 } |
153 | 147 |
154 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells() | 148 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableRowElement::cells() |
155 { | 149 { |
156 return ensureCachedCollection<HTMLCollection>(TRCells); | 150 return ensureCachedCollection<HTMLCollection>(TRCells); |
157 } | 151 } |
158 | 152 |
159 } | 153 } |
OLD | NEW |