| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 using namespace XPath; | 38 using namespace XPath; |
| 39 | 39 |
| 40 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(XPathResult); | 40 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(XPathResult); |
| 41 | 41 |
| 42 XPathResult::XPathResult(EvaluationContext& context, const Value& value) | 42 XPathResult::XPathResult(EvaluationContext& context, const Value& value) |
| 43 : m_value(value) | 43 : m_value(value) |
| 44 , m_nodeSetPosition(0) | 44 , m_nodeSetPosition(0) |
| 45 , m_domTreeVersion(0) | 45 , m_domTreeVersion(0) |
| 46 { | 46 { |
| 47 ScriptWrappable::init(this); | |
| 48 switch (m_value.type()) { | 47 switch (m_value.type()) { |
| 49 case Value::BooleanValue: | 48 case Value::BooleanValue: |
| 50 m_resultType = BOOLEAN_TYPE; | 49 m_resultType = BOOLEAN_TYPE; |
| 51 return; | 50 return; |
| 52 case Value::NumberValue: | 51 case Value::NumberValue: |
| 53 m_resultType = NUMBER_TYPE; | 52 m_resultType = NUMBER_TYPE; |
| 54 return; | 53 return; |
| 55 case Value::StringValue: | 54 case Value::StringValue: |
| 56 m_resultType = STRING_TYPE; | 55 m_resultType = STRING_TYPE; |
| 57 return; | 56 return; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 213 } |
| 215 | 214 |
| 216 const NodeSet& nodes = m_value.toNodeSet(0); | 215 const NodeSet& nodes = m_value.toNodeSet(0); |
| 217 if (index >= nodes.size()) | 216 if (index >= nodes.size()) |
| 218 return 0; | 217 return 0; |
| 219 | 218 |
| 220 return nodes[index]; | 219 return nodes[index]; |
| 221 } | 220 } |
| 222 | 221 |
| 223 } | 222 } |
| OLD | NEW |