| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> |
| 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 Node* XPathResult::iterateNext(ExceptionState& es) | 181 Node* XPathResult::iterateNext(ExceptionState& es) |
| 182 { | 182 { |
| 183 if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_
NODE_ITERATOR_TYPE) { | 183 if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_
NODE_ITERATOR_TYPE) { |
| 184 es.throwTypeError(); | 184 es.throwTypeError(); |
| 185 return 0; | 185 return 0; |
| 186 } | 186 } |
| 187 | 187 |
| 188 if (invalidIteratorState()) { | 188 if (invalidIteratorState()) { |
| 189 es.throwDOMException(InvalidStateError); | 189 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 190 return 0; | 190 return 0; |
| 191 } | 191 } |
| 192 | 192 |
| 193 if (m_nodeSetPosition + 1 > m_nodeSet.size()) | 193 if (m_nodeSetPosition + 1 > m_nodeSet.size()) |
| 194 return 0; | 194 return 0; |
| 195 | 195 |
| 196 Node* node = m_nodeSet[m_nodeSetPosition]; | 196 Node* node = m_nodeSet[m_nodeSetPosition]; |
| 197 | 197 |
| 198 m_nodeSetPosition++; | 198 m_nodeSetPosition++; |
| 199 | 199 |
| 200 return node; | 200 return node; |
| 201 } | 201 } |
| 202 | 202 |
| 203 Node* XPathResult::snapshotItem(unsigned long index, ExceptionState& es) | 203 Node* XPathResult::snapshotItem(unsigned long index, ExceptionState& es) |
| 204 { | 204 { |
| 205 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_
NODE_SNAPSHOT_TYPE) { | 205 if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_
NODE_SNAPSHOT_TYPE) { |
| 206 es.throwTypeError(); | 206 es.throwTypeError(); |
| 207 return 0; | 207 return 0; |
| 208 } | 208 } |
| 209 | 209 |
| 210 const NodeSet& nodes = m_value.toNodeSet(); | 210 const NodeSet& nodes = m_value.toNodeSet(); |
| 211 if (index >= nodes.size()) | 211 if (index >= nodes.size()) |
| 212 return 0; | 212 return 0; |
| 213 | 213 |
| 214 return nodes[index]; | 214 return nodes[index]; |
| 215 } | 215 } |
| 216 | 216 |
| 217 } | 217 } |
| OLD | NEW |