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

Side by Side Diff: Source/bindings/v8/custom/V8NodeCustom.cpp

Issue 18167006: Implement Custom Elements' entered and left document callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return; 122 return;
123 } 123 }
124 v8SetReturnValueNull(args); 124 v8SetReturnValueNull(args);
125 } 125 }
126 126
127 // This function is customized to take advantage of the optional 4th argument: A ttachBehavior 127 // This function is customized to take advantage of the optional 4th argument: A ttachBehavior
128 void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args) 128 void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
129 { 129 {
130 v8::Handle<v8::Object> holder = args.Holder(); 130 v8::Handle<v8::Object> holder = args.Holder();
131 Node* imp = V8Node::toNative(holder); 131 Node* imp = V8Node::toNative(holder);
132
133 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
134
132 ExceptionCode ec = 0; 135 ExceptionCode ec = 0;
133 Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(a rgs.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0 ; 136 Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(a rgs.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0 ;
134 bool success = imp->appendChild(newChild, ec, AttachLazily); 137 bool success = imp->appendChild(newChild, ec, AttachLazily);
135 if (ec) { 138 if (ec) {
136 setDOMException(ec, args.GetIsolate()); 139 setDOMException(ec, args.GetIsolate());
137 return; 140 return;
138 } 141 }
139 if (success) { 142 if (success) {
140 v8SetReturnValue(args, args[0]); 143 v8SetReturnValue(args, args[0]);
141 return; 144 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return wrap(toShadowRoot(impl), creationContext, isolate); 178 return wrap(toShadowRoot(impl), creationContext, isolate);
176 return wrap(static_cast<DocumentFragment*>(impl), creationContext, isola te); 179 return wrap(static_cast<DocumentFragment*>(impl), creationContext, isola te);
177 case Node::NOTATION_NODE: 180 case Node::NOTATION_NODE:
178 return wrap(static_cast<Notation*>(impl), creationContext, isolate); 181 return wrap(static_cast<Notation*>(impl), creationContext, isolate);
179 default: 182 default:
180 break; // ENTITY_REFERENCE_NODE or XPATH_NAMESPACE_NODE 183 break; // ENTITY_REFERENCE_NODE or XPATH_NAMESPACE_NODE
181 } 184 }
182 return V8Node::createWrapper(impl, creationContext, isolate); 185 return V8Node::createWrapper(impl, creationContext, isolate);
183 } 186 }
184 } // namespace WebCore 187 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8HiddenPropertyName.h ('k') | Source/core/dom/CustomElementCallbackDispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698