| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 { | 64 { |
| 65 RefPtr<Document> document = V8Document::toNative(args.Holder()); | 65 RefPtr<Document> document = V8Document::toNative(args.Holder()); |
| 66 ExceptionCode ec = 0; | 66 ExceptionCode ec = 0; |
| 67 String expression = toWebCoreString(args[0]); | 67 String expression = toWebCoreString(args[0]); |
| 68 RefPtr<Node> contextNode; | 68 RefPtr<Node> contextNode; |
| 69 if (V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolat
e()))) | 69 if (V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolat
e()))) |
| 70 contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])); | 70 contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])); |
| 71 | 71 |
| 72 RefPtr<XPathNSResolver> resolver = toXPathNSResolver(args[2], args.GetIsolat
e()); | 72 RefPtr<XPathNSResolver> resolver = toXPathNSResolver(args[2], args.GetIsolat
e()); |
| 73 if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined()) { | 73 if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined()) { |
| 74 setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate()); | 74 setDOMException(TypeMismatchError, args.GetIsolate()); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 int type = toInt32(args[3]); | 78 int type = toInt32(args[3]); |
| 79 RefPtr<XPathResult> inResult; | 79 RefPtr<XPathResult> inResult; |
| 80 if (V8XPathResult::HasInstance(args[4], args.GetIsolate(), worldType(args.Ge
tIsolate()))) | 80 if (V8XPathResult::HasInstance(args[4], args.GetIsolate(), worldType(args.Ge
tIsolate()))) |
| 81 inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(args[4])
); | 81 inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(args[4])
); |
| 82 | 82 |
| 83 V8TRYCATCH_VOID(RefPtr<XPathResult>, result, document->evaluate(expression,
contextNode.get(), resolver.get(), type, inResult.get(), ec)); | 83 V8TRYCATCH_VOID(RefPtr<XPathResult>, result, document->evaluate(expression,
contextNode.get(), resolver.get(), type, inResult.get(), ec)); |
| 84 if (ec) { | 84 if (ec) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 112 | 112 |
| 113 for (int i = 0; i < args.Length(); i++) { | 113 for (int i = 0; i < args.Length(); i++) { |
| 114 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ?
V8Touch::toNative(args[i]->ToObject()) : 0; | 114 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ?
V8Touch::toNative(args[i]->ToObject()) : 0; |
| 115 touchList->append(touch); | 115 touchList->append(touch); |
| 116 } | 116 } |
| 117 | 117 |
| 118 v8SetReturnValue(args, toV8(touchList.release(), args.Holder(), args.GetIsol
ate())); | 118 v8SetReturnValue(args, toV8(touchList.release(), args.Holder(), args.GetIsol
ate())); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace WebCore | 121 } // namespace WebCore |
| OLD | NEW |