| 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 30 matching lines...) Expand all Loading... |
| 41 #include "bindings/core/v8/V8PerContextData.h" | 41 #include "bindings/core/v8/V8PerContextData.h" |
| 42 #include "bindings/core/v8/V8SVGElement.h" | 42 #include "bindings/core/v8/V8SVGElement.h" |
| 43 #include "core/HTMLNames.h" | 43 #include "core/HTMLNames.h" |
| 44 #include "core/SVGNames.h" | 44 #include "core/SVGNames.h" |
| 45 #include "core/dom/Document.h" | 45 #include "core/dom/Document.h" |
| 46 #include "core/dom/ElementRegistrationOptions.h" | 46 #include "core/dom/ElementRegistrationOptions.h" |
| 47 #include "core/dom/custom/V0CustomElementDefinition.h" | 47 #include "core/dom/custom/V0CustomElementDefinition.h" |
| 48 #include "core/dom/custom/V0CustomElementDescriptor.h" | 48 #include "core/dom/custom/V0CustomElementDescriptor.h" |
| 49 #include "core/dom/custom/V0CustomElementException.h" | 49 #include "core/dom/custom/V0CustomElementException.h" |
| 50 #include "core/dom/custom/V0CustomElementProcessingStack.h" | 50 #include "core/dom/custom/V0CustomElementProcessingStack.h" |
| 51 #include "core/frame/UseCounter.h" |
| 51 #include "wtf/Assertions.h" | 52 #include "wtf/Assertions.h" |
| 52 | 53 |
| 53 namespace blink { | 54 namespace blink { |
| 54 | 55 |
| 55 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&); | 56 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&); |
| 56 | 57 |
| 57 V0CustomElementConstructorBuilder::V0CustomElementConstructorBuilder( | 58 V0CustomElementConstructorBuilder::V0CustomElementConstructorBuilder( |
| 58 ScriptState* scriptState, | 59 ScriptState* scriptState, |
| 59 const ElementRegistrationOptions& options) | 60 const ElementRegistrationOptions& options) |
| 60 : m_scriptState(scriptState), m_options(options) { | 61 : m_scriptState(scriptState), m_options(options) { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 scriptState, data, V8HiddenValue::customElementType(isolate)); | 348 scriptState, data, V8HiddenValue::customElementType(isolate)); |
| 348 TOSTRING_VOID(V8StringResource<>, type, maybeType); | 349 TOSTRING_VOID(V8StringResource<>, type, maybeType); |
| 349 | 350 |
| 350 ExceptionState exceptionState( | 351 ExceptionState exceptionState( |
| 351 info.GetIsolate(), ExceptionState::ConstructionContext, "CustomElement"); | 352 info.GetIsolate(), ExceptionState::ConstructionContext, "CustomElement"); |
| 352 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 353 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
| 353 Element* element = document->createElementNS( | 354 Element* element = document->createElementNS( |
| 354 namespaceURI, tagName, | 355 namespaceURI, tagName, |
| 355 StringOrDictionary::fromString(maybeType->IsNull() ? nullAtom : type), | 356 StringOrDictionary::fromString(maybeType->IsNull() ? nullAtom : type), |
| 356 exceptionState); | 357 exceptionState); |
| 358 if (element) { |
| 359 UseCounter::count(document, UseCounter::V0CustomElementsConstruct); |
| 360 } |
| 357 v8SetReturnValueFast(info, element, document); | 361 v8SetReturnValueFast(info, element, document); |
| 358 } | 362 } |
| 359 | 363 |
| 360 } // namespace blink | 364 } // namespace blink |
| OLD | NEW |