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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 XPathResult* XPathEvaluator::evaluate(const String& expression, | 53 XPathResult* XPathEvaluator::evaluate(const String& expression, |
54 Node* contextNode, | 54 Node* contextNode, |
55 XPathNSResolver* resolver, | 55 XPathNSResolver* resolver, |
56 unsigned short type, | 56 unsigned short type, |
57 const ScriptValue&, | 57 const ScriptValue&, |
58 ExceptionState& exceptionState) { | 58 ExceptionState& exceptionState) { |
59 if (!isValidContextNode(contextNode)) { | 59 if (!isValidContextNode(contextNode)) { |
60 exceptionState.throwDOMException( | 60 exceptionState.throwDOMException( |
61 NotSupportedError, "The node provided is '" + contextNode->nodeName() + | 61 NotSupportedError, |
62 "', which is not a valid context node type."); | 62 "The node provided is '" + contextNode->nodeName() + |
| 63 "', which is not a valid context node type."); |
63 return nullptr; | 64 return nullptr; |
64 } | 65 } |
65 | 66 |
66 XPathExpression* expr = | 67 XPathExpression* expr = |
67 createExpression(expression, resolver, exceptionState); | 68 createExpression(expression, resolver, exceptionState); |
68 if (exceptionState.hadException()) | 69 if (exceptionState.hadException()) |
69 return nullptr; | 70 return nullptr; |
70 | 71 |
71 return expr->evaluate(contextNode, type, ScriptValue(), exceptionState); | 72 return expr->evaluate(contextNode, type, ScriptValue(), exceptionState); |
72 } | 73 } |
73 | 74 |
74 } // namespace blink | 75 } // namespace blink |
OLD | NEW |