| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "core/xml/XPathNSResolver.h" | 57 #include "core/xml/XPathNSResolver.h" |
| 58 #include "core/xml/XPathResult.h" | 58 #include "core/xml/XPathResult.h" |
| 59 #include "wtf/RefPtr.h" | 59 #include "wtf/RefPtr.h" |
| 60 | 60 |
| 61 namespace WebCore { | 61 namespace WebCore { |
| 62 | 62 |
| 63 void V8Document::evaluateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
args) | 63 void V8Document::evaluateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
args) |
| 64 { | 64 { |
| 65 RefPtr<Document> document = V8Document::toNative(args.Holder()); | 65 RefPtr<Document> document = V8Document::toNative(args.Holder()); |
| 66 ExceptionState es(args.GetIsolate()); | 66 ExceptionState es(args.GetIsolate()); |
| 67 String expression = toWebCoreString(args[0]); | 67 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, expression, 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(TypeMismatchError, args.GetIsolate()); | 74 setDOMException(TypeMismatchError, args.GetIsolate()); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 for (int i = 0; i < args.Length(); i++) { | 111 for (int i = 0; i < args.Length(); i++) { |
| 112 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ?
V8Touch::toNative(args[i]->ToObject()) : 0; | 112 Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ?
V8Touch::toNative(args[i]->ToObject()) : 0; |
| 113 touchList->append(touch); | 113 touchList->append(touch); |
| 114 } | 114 } |
| 115 | 115 |
| 116 v8SetReturnValue(args, toV8(touchList.release(), args.Holder(), args.GetIsol
ate())); | 116 v8SetReturnValue(args, toV8(touchList.release(), args.Holder(), args.GetIsol
ate())); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace WebCore | 119 } // namespace WebCore |
| OLD | NEW |