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

Side by Side Diff: Source/bindings/v8/CustomElementConstructorBuilder.cpp

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 years, 6 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
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/bindings/v8/V8RecursionScope.cpp » ('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 (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 25 matching lines...) Expand all
36 #include "V8Document.h" 36 #include "V8Document.h"
37 #include "V8HTMLElementWrapperFactory.h" 37 #include "V8HTMLElementWrapperFactory.h"
38 #include "V8SVGElementWrapperFactory.h" 38 #include "V8SVGElementWrapperFactory.h"
39 #include "bindings/v8/CustomElementHelpers.h" 39 #include "bindings/v8/CustomElementHelpers.h"
40 #include "bindings/v8/Dictionary.h" 40 #include "bindings/v8/Dictionary.h"
41 #include "bindings/v8/UnsafePersistent.h" 41 #include "bindings/v8/UnsafePersistent.h"
42 #include "bindings/v8/V8Binding.h" 42 #include "bindings/v8/V8Binding.h"
43 #include "bindings/v8/V8CustomElementCallback.h" 43 #include "bindings/v8/V8CustomElementCallback.h"
44 #include "bindings/v8/V8HiddenPropertyName.h" 44 #include "bindings/v8/V8HiddenPropertyName.h"
45 #include "bindings/v8/V8PerContextData.h" 45 #include "bindings/v8/V8PerContextData.h"
46 #include "core/dom/CustomElementCallbackDispatcher.h"
46 #include "core/dom/CustomElementDefinition.h" 47 #include "core/dom/CustomElementDefinition.h"
47 #include "core/dom/CustomElementRegistry.h"
48 #include "core/dom/Document.h" 48 #include "core/dom/Document.h"
49 #include "wtf/Assertions.h" 49 #include "wtf/Assertions.h"
50 #include "wtf/RefPtr.h" 50 #include "wtf/RefPtr.h"
51 51
52 namespace WebCore { 52 namespace WebCore {
53 53
54 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&); 54 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&);
55 55
56 CustomElementConstructorBuilder::CustomElementConstructorBuilder(ScriptState* st ate, const Dictionary* options) 56 CustomElementConstructorBuilder::CustomElementConstructorBuilder(ScriptState* st ate, const Dictionary* options)
57 : m_context(state->context()) 57 : m_context(state->context())
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 return; 270 return;
271 } 271 }
272 272
273 Document* document = V8Document::toNative(v8::Handle<v8::Object>::Cast(args. Callee()->GetHiddenValue(V8HiddenPropertyName::document()))); 273 Document* document = V8Document::toNative(v8::Handle<v8::Object>::Cast(args. Callee()->GetHiddenValue(V8HiddenPropertyName::document())));
274 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args. Callee()->GetHiddenValue(V8HiddenPropertyName::namespaceURI())); 274 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args. Callee()->GetHiddenValue(V8HiddenPropertyName::namespaceURI()));
275 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, args.Callee() ->GetHiddenValue(V8HiddenPropertyName::name())); 275 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, args.Callee() ->GetHiddenValue(V8HiddenPropertyName::name()));
276 v8::Handle<v8::Value> maybeType = args.Callee()->GetHiddenValue(V8HiddenProp ertyName::type()); 276 v8::Handle<v8::Value> maybeType = args.Callee()->GetHiddenValue(V8HiddenProp ertyName::type());
277 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType); 277 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType);
278 278
279 ExceptionCode ec = 0; 279 ExceptionCode ec = 0;
280 CustomElementRegistry::CallbackDeliveryScope deliveryScope; 280 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
281 RefPtr<Element> element = document->createElementNS(namespaceURI, name, mayb eType->IsNull() ? nullAtom : type, ec); 281 RefPtr<Element> element = document->createElementNS(namespaceURI, name, mayb eType->IsNull() ? nullAtom : type, ec);
282 if (ec) { 282 if (ec) {
283 setDOMException(ec, isolate); 283 setDOMException(ec, isolate);
284 return; 284 return;
285 } 285 }
286 v8SetReturnValue(args, toV8Fast(element.release(), args, document)); 286 v8SetReturnValue(args, toV8Fast(element.release(), args, document));
287 } 287 }
288 288
289 } // namespace WebCore 289 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/bindings/v8/V8RecursionScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698