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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 throwTypeError("DOM object constructor cannot be called as a function.",
isolate); | 261 throwTypeError("DOM object constructor cannot be called as a function.",
isolate); |
262 return; | 262 return; |
263 } | 263 } |
264 | 264 |
265 if (info.Length() > 0) { | 265 if (info.Length() > 0) { |
266 throwTypeError("This constructor should be called without arguments.", i
solate); | 266 throwTypeError("This constructor should be called without arguments.", i
solate); |
267 return; | 267 return; |
268 } | 268 } |
269 | 269 |
270 Document* document = V8Document::toNative(V8HiddenValue::getHiddenValue(info
.GetIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<
v8::Object>()); | 270 Document* document = V8Document::toNative(V8HiddenValue::getHiddenValue(info
.GetIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<
v8::Object>()); |
271 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, V8Hid
denValue::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementNam
espaceURI(isolate))); | 271 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, namespaceURI, V8HiddenValu
e::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementNamespaceU
RI(isolate))); |
272 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, tagName, V8HiddenVa
lue::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementTagName(
isolate))); | 272 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, tagName, V8HiddenValue::ge
tHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementTagName(isolate
))); |
273 v8::Handle<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsol
ate(), info.Callee(), V8HiddenValue::customElementType(isolate)); | 273 v8::Handle<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsol
ate(), info.Callee(), V8HiddenValue::customElementType(isolate)); |
274 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType); | 274 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, type, maybeType); |
275 | 275 |
276 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl
ement", info.Holder(), info.GetIsolate()); | 276 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl
ement", info.Holder(), info.GetIsolate()); |
277 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 277 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
278 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m
aybeType->IsNull() ? nullAtom : type, exceptionState); | 278 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m
aybeType->IsNull() ? nullAtom : type, exceptionState); |
279 if (exceptionState.throwIfNeeded()) | 279 if (exceptionState.throwIfNeeded()) |
280 return; | 280 return; |
281 v8SetReturnValueFast(info, element.release(), document); | 281 v8SetReturnValueFast(info, element.release(), document); |
282 } | 282 } |
283 | 283 |
284 } // namespace WebCore | 284 } // namespace WebCore |
OLD | NEW |