| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |