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/V8HTMLElement.h" | 5 #include "bindings/core/v8/V8HTMLElement.h" |
6 | 6 |
7 #include "bindings/core/v8/DOMWrapperWorld.h" | 7 #include "bindings/core/v8/DOMWrapperWorld.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" |
10 #include "bindings/core/v8/V8BindingMacros.h" | 10 #include "bindings/core/v8/V8BindingMacros.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // TODO(dominicc): Implement cases where the definition's | 45 // TODO(dominicc): Implement cases where the definition's |
46 // construction stack is not empty when parser-creation is | 46 // construction stack is not empty when parser-creation is |
47 // implemented. | 47 // implemented. |
48 | 48 |
49 ExceptionState exceptionState( | 49 ExceptionState exceptionState( |
50 ExceptionState::ConstructionContext, | 50 ExceptionState::ConstructionContext, |
51 "HTMLElement", | 51 "HTMLElement", |
52 info.Holder(), | 52 info.Holder(), |
53 isolate); | 53 isolate); |
54 Element* element = window->document()->createElement( | 54 Element* element = window->document()->createElement( |
55 def->localName(), | 55 def->descriptor().localName(), |
56 AtomicString(), | 56 AtomicString(), |
57 exceptionState); | 57 exceptionState); |
58 if (exceptionState.throwIfNeeded()) | 58 if (exceptionState.throwIfNeeded()) |
59 return; | 59 return; |
60 const WrapperTypeInfo* wrapperType = element->wrapperTypeInfo(); | 60 const WrapperTypeInfo* wrapperType = element->wrapperTypeInfo(); |
61 v8::Local<v8::Object> wrapper = V8DOMWrapper::associateObjectWithWrapper( | 61 v8::Local<v8::Object> wrapper = V8DOMWrapper::associateObjectWithWrapper( |
62 isolate, | 62 isolate, |
63 element, | 63 element, |
64 wrapperType, | 64 wrapperType, |
65 info.This()); | 65 info.This()); |
66 | 66 |
67 if (!v8CallBoolean(wrapper->SetPrototype( | 67 if (!v8CallBoolean(wrapper->SetPrototype( |
68 scriptState->context(), | 68 scriptState->context(), |
69 def->prototype(scriptState)))) { | 69 def->prototype(scriptState)))) { |
70 return; | 70 return; |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
OLD | NEW |