| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "bindings/v8/ExceptionState.h" | 30 #include "bindings/v8/ExceptionState.h" |
| 31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
| 32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
| 33 #include "core/xml/XPathEvaluator.h" | 33 #include "core/xml/XPathEvaluator.h" |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 using namespace XPath; | 37 using namespace XPath; |
| 38 | 38 |
| 39 DEFINE_GC_INFO(XPathResult); |
| 40 |
| 39 XPathResult::XPathResult(Document* document, const Value& value) | 41 XPathResult::XPathResult(Document* document, const Value& value) |
| 40 : m_value(value) | 42 : m_value(value) |
| 41 , m_nodeSetPosition(0) | 43 , m_nodeSetPosition(0) |
| 42 , m_domTreeVersion(0) | 44 , m_domTreeVersion(0) |
| 43 { | 45 { |
| 44 ScriptWrappable::init(this); | 46 ScriptWrappable::init(this); |
| 45 switch (m_value.type()) { | 47 switch (m_value.type()) { |
| 46 case Value::BooleanValue: | 48 case Value::BooleanValue: |
| 47 m_resultType = BOOLEAN_TYPE; | 49 m_resultType = BOOLEAN_TYPE; |
| 48 return; | 50 return; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 210 } |
| 209 | 211 |
| 210 const NodeSet& nodes = m_value.toNodeSet(); | 212 const NodeSet& nodes = m_value.toNodeSet(); |
| 211 if (index >= nodes.size()) | 213 if (index >= nodes.size()) |
| 212 return 0; | 214 return 0; |
| 213 | 215 |
| 214 return nodes[index]; | 216 return nodes[index]; |
| 215 } | 217 } |
| 216 | 218 |
| 217 } | 219 } |
| OLD | NEW |