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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "core/dom/Document.h" | 51 #include "core/dom/Document.h" |
52 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 52 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
53 #include "core/dom/shadow/ShadowRoot.h" | 53 #include "core/dom/shadow/ShadowRoot.h" |
54 #include "core/events/EventListener.h" | 54 #include "core/events/EventListener.h" |
55 #include "wtf/RefPtr.h" | 55 #include "wtf/RefPtr.h" |
56 | 56 |
57 namespace WebCore { | 57 namespace WebCore { |
58 | 58 |
59 // These functions are custom to prevent a wrapper lookup of the return value wh
ich is always | 59 // These functions are custom to prevent a wrapper lookup of the return value wh
ich is always |
60 // part of the arguments. | 60 // part of the arguments. |
61 void V8Node::insertBeforeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
info) | |
62 { | |
63 v8::Handle<v8::Object> holder = info.Holder(); | |
64 Node* impl = V8Node::toNative(holder); | |
65 | |
66 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | |
67 | |
68 ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertBefor
e", "Node", info.Holder(), info.GetIsolate()); | |
69 Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]); | |
70 Node* refChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]); | |
71 impl->insertBefore(newChild, refChild, exceptionState); | |
72 if (exceptionState.throwIfNeeded()) | |
73 return; | |
74 v8SetReturnValue(info, info[0]); | |
75 } | |
76 | |
77 void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
info) | 61 void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
info) |
78 { | 62 { |
79 v8::Handle<v8::Object> holder = info.Holder(); | 63 v8::Handle<v8::Object> holder = info.Holder(); |
80 Node* impl = V8Node::toNative(holder); | 64 Node* impl = V8Node::toNative(holder); |
81 | 65 |
82 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 66 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
83 | 67 |
84 ExceptionState exceptionState(ExceptionState::ExecutionContext, "replaceChil
d", "Node", info.Holder(), info.GetIsolate()); | 68 ExceptionState exceptionState(ExceptionState::ExecutionContext, "replaceChil
d", "Node", info.Holder(), info.GetIsolate()); |
85 Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]); | 69 Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]); |
86 Node* oldChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]); | 70 Node* oldChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return wrap(toDocumentType(impl), creationContext, isolate); | 144 return wrap(toDocumentType(impl), creationContext, isolate); |
161 case Node::DOCUMENT_FRAGMENT_NODE: | 145 case Node::DOCUMENT_FRAGMENT_NODE: |
162 if (impl->isShadowRoot()) | 146 if (impl->isShadowRoot()) |
163 return wrap(toShadowRoot(impl), creationContext, isolate); | 147 return wrap(toShadowRoot(impl), creationContext, isolate); |
164 return wrap(toDocumentFragment(impl), creationContext, isolate); | 148 return wrap(toDocumentFragment(impl), creationContext, isolate); |
165 } | 149 } |
166 ASSERT_NOT_REACHED(); | 150 ASSERT_NOT_REACHED(); |
167 return V8Node::createWrapper(impl, creationContext, isolate); | 151 return V8Node::createWrapper(impl, creationContext, isolate); |
168 } | 152 } |
169 } // namespace WebCore | 153 } // namespace WebCore |
OLD | NEW |