Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: Source/core/xml/XPathEvaluator.cpp

Issue 983123003: Add [TypeChecking=Interface] to XPath interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: revert test change; no longer needed Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/xml/XPathEvaluator.h ('k') | Source/core/xml/XPathEvaluator.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 { 43 {
44 return XPathExpression::createExpression(expression, resolver, exceptionStat e); 44 return XPathExpression::createExpression(expression, resolver, exceptionStat e);
45 } 45 }
46 46
47 PassRefPtrWillBeRawPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* n odeResolver) 47 PassRefPtrWillBeRawPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* n odeResolver)
48 { 48 {
49 return NativeXPathNSResolver::create(nodeResolver); 49 return NativeXPathNSResolver::create(nodeResolver);
50 } 50 }
51 51
52 PassRefPtrWillBeRawPtr<XPathResult> XPathEvaluator::evaluate(const String& expre ssion, Node* contextNode, 52 PassRefPtrWillBeRawPtr<XPathResult> XPathEvaluator::evaluate(const String& expre ssion, Node* contextNode,
53 PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigned short type, XPath Result* result, ExceptionState& exceptionState) 53 PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigned short type, const ScriptValue&, ExceptionState& exceptionState)
54 { 54 {
55 if (!contextNode) {
56 exceptionState.throwDOMException(NotSupportedError, "The context node pr ovided is null.");
57 return nullptr;
58 }
59
60 if (!isValidContextNode(contextNode)) { 55 if (!isValidContextNode(contextNode)) {
61 exceptionState.throwDOMException(NotSupportedError, "The node provided i s '" + contextNode->nodeName() + "', which is not a valid context node type."); 56 exceptionState.throwDOMException(NotSupportedError, "The node provided i s '" + contextNode->nodeName() + "', which is not a valid context node type.");
62 return nullptr; 57 return nullptr;
63 } 58 }
64 59
65 RefPtrWillBeRawPtr<XPathExpression> expr = createExpression(expression, reso lver, exceptionState); 60 RefPtrWillBeRawPtr<XPathExpression> expr = createExpression(expression, reso lver, exceptionState);
66 if (exceptionState.hadException()) 61 if (exceptionState.hadException())
67 return nullptr; 62 return nullptr;
68 63
69 return expr->evaluate(contextNode, type, result, exceptionState); 64 return expr->evaluate(contextNode, type, ScriptValue(), exceptionState);
70 } 65 }
71 66
72 } 67 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathEvaluator.h ('k') | Source/core/xml/XPathEvaluator.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698