OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "bindings/core/v8/V8HTMLConstructor.h" | 5 #include "bindings/core/v8/V8HTMLConstructor.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptCustomElementDefinition.h" | 8 #include "bindings/core/v8/ScriptCustomElementDefinition.h" |
9 #include "bindings/core/v8/V8BindingForCore.h" | 9 #include "bindings/core/v8/V8BindingForCore.h" |
10 #include "bindings/core/v8/V8HTMLElement.h" | 10 #include "bindings/core/v8/V8HTMLElement.h" |
11 #include "bindings/core/v8/V8PerContextData.h" | |
12 #include "bindings/core/v8/V8ThrowException.h" | |
13 #include "core/dom/Document.h" | 11 #include "core/dom/Document.h" |
14 #include "core/dom/Element.h" | 12 #include "core/dom/Element.h" |
15 #include "core/dom/ExceptionCode.h" | 13 #include "core/dom/ExceptionCode.h" |
16 #include "core/dom/custom/CustomElementRegistry.h" | 14 #include "core/dom/custom/CustomElementRegistry.h" |
17 #include "core/frame/LocalDOMWindow.h" | 15 #include "core/frame/LocalDOMWindow.h" |
18 #include "platform/RuntimeEnabledFeatures.h" | 16 #include "platform/RuntimeEnabledFeatures.h" |
19 #include "platform/bindings/DOMWrapperWorld.h" | 17 #include "platform/bindings/DOMWrapperWorld.h" |
20 #include "platform/bindings/V8BindingMacros.h" | 18 #include "platform/bindings/V8BindingMacros.h" |
21 #include "platform/bindings/V8DOMWrapper.h" | 19 #include "platform/bindings/V8DOMWrapper.h" |
| 20 #include "platform/bindings/V8PerContextData.h" |
| 21 #include "platform/bindings/V8ThrowException.h" |
22 #include "platform/instrumentation/tracing/TraceEvent.h" | 22 #include "platform/instrumentation/tracing/TraceEvent.h" |
23 | 23 |
24 namespace blink { | 24 namespace blink { |
25 | 25 |
26 // https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors | 26 // https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors |
27 void V8HTMLConstructor::HtmlConstructor( | 27 void V8HTMLConstructor::HtmlConstructor( |
28 const v8::FunctionCallbackInfo<v8::Value>& info, | 28 const v8::FunctionCallbackInfo<v8::Value>& info, |
29 const WrapperTypeInfo& wrapper_type_info, | 29 const WrapperTypeInfo& wrapper_type_info, |
30 const HTMLElementType element_interface_name) { | 30 const HTMLElementType element_interface_name) { |
31 TRACE_EVENT0("blink", "HTMLConstructor"); | 31 TRACE_EVENT0("blink", "HTMLConstructor"); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // If the element had a wrapper, we now update and return that | 145 // If the element had a wrapper, we now update and return that |
146 // instead. | 146 // instead. |
147 V8SetReturnValue(info, wrapper); | 147 V8SetReturnValue(info, wrapper); |
148 | 148 |
149 // 11. Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions. | 149 // 11. Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions. |
150 // Note: I don't think this prototype set *can* throw exceptions. | 150 // Note: I don't think this prototype set *can* throw exceptions. |
151 wrapper->SetPrototype(script_state->GetContext(), prototype.As<v8::Object>()) | 151 wrapper->SetPrototype(script_state->GetContext(), prototype.As<v8::Object>()) |
152 .ToChecked(); | 152 .ToChecked(); |
153 } | 153 } |
154 } // namespace blink | 154 } // namespace blink |
OLD | NEW |