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, 2010 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 RefPtr<Element> row = children->item(index); | 90 RefPtr<Element> row = children->item(index); |
91 HTMLElement::removeChild(row.get(), exceptionState); | 91 HTMLElement::removeChild(row.get(), exceptionState); |
92 } else { | 92 } else { |
93 exceptionState.throwDOMException(IndexSizeError, "The provided index ("
+ String::number(index) + " is outside the range [-1, " + String::number(numRows
) + "]."); | 93 exceptionState.throwDOMException(IndexSizeError, "The provided index ("
+ String::number(index) + " is outside the range [-1, " + String::number(numRows
) + "]."); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 int HTMLTableSectionElement::numRows() const | 97 int HTMLTableSectionElement::numRows() const |
98 { | 98 { |
99 int rowCount = 0; | 99 int rowCount = 0; |
100 for (const Element* child = ElementTraversal::firstWithin(*this); child; chi
ld = ElementTraversal::nextSibling(*child)) { | 100 for (const HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstC
hild(*this); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) |
101 if (child->hasTagName(trTag)) | 101 ++rowCount; |
102 ++rowCount; | |
103 } | |
104 return rowCount; | 102 return rowCount; |
105 } | 103 } |
106 | 104 |
107 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() | 105 PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows() |
108 { | 106 { |
109 return ensureCachedHTMLCollection(TSectionRows); | 107 return ensureCachedHTMLCollection(TSectionRows); |
110 } | 108 } |
111 | 109 |
112 } | 110 } |
OLD | NEW |