OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 PassRefPtrWillBeRawPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* n
odeResolver) | 49 PassRefPtrWillBeRawPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* n
odeResolver) |
50 { | 50 { |
51 return NativeXPathNSResolver::create(nodeResolver); | 51 return NativeXPathNSResolver::create(nodeResolver); |
52 } | 52 } |
53 | 53 |
54 PassRefPtrWillBeRawPtr<XPathResult> XPathEvaluator::evaluate(const String& expre
ssion, Node* contextNode, | 54 PassRefPtrWillBeRawPtr<XPathResult> XPathEvaluator::evaluate(const String& expre
ssion, Node* contextNode, |
55 PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigned short type, XPath
Result* result, ExceptionState& exceptionState) | 55 PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigned short type, XPath
Result* result, ExceptionState& exceptionState) |
56 { | 56 { |
57 if (!contextNode) { | 57 if (!contextNode) { |
58 exceptionState.throwDOMException(NotSupportedError, "The context node pr
ovided is null."); | 58 exceptionState.throwDOMException(NotSupportedError, "The context node pr
ovided is null."); |
59 return 0; | 59 return nullptr; |
60 } | 60 } |
61 | 61 |
62 if (!isValidContextNode(contextNode)) { | 62 if (!isValidContextNode(contextNode)) { |
63 exceptionState.throwDOMException(NotSupportedError, "The node provided i
s '" + contextNode->nodeName() + "', which is not a valid context node type."); | 63 exceptionState.throwDOMException(NotSupportedError, "The node provided i
s '" + contextNode->nodeName() + "', which is not a valid context node type."); |
64 return 0; | 64 return nullptr; |
65 } | 65 } |
66 | 66 |
67 RefPtrWillBeRawPtr<XPathExpression> expr = createExpression(expression, reso
lver, exceptionState); | 67 RefPtrWillBeRawPtr<XPathExpression> expr = createExpression(expression, reso
lver, exceptionState); |
68 if (exceptionState.hadException()) | 68 if (exceptionState.hadException()) |
69 return 0; | 69 return nullptr; |
70 | 70 |
71 return expr->evaluate(contextNode, type, result, exceptionState); | 71 return expr->evaluate(contextNode, type, result, exceptionState); |
72 } | 72 } |
73 | 73 |
74 } | 74 } |
OLD | NEW |