Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 m_prototype = prototypeScriptValue.v8Value().As<v8::Object>(); | 83 m_prototype = prototypeScriptValue.v8Value().As<v8::Object>(); |
| 84 } else { | 84 } else { |
| 85 m_prototype = v8::Object::New(m_context->GetIsolate()); | 85 m_prototype = v8::Object::New(m_context->GetIsolate()); |
| 86 v8::Local<v8::Object> basePrototype = V8PerContextData::from(m_context)- >prototypeForType(&V8HTMLElement::wrapperTypeInfo); | 86 v8::Local<v8::Object> basePrototype = V8PerContextData::from(m_context)- >prototypeForType(&V8HTMLElement::wrapperTypeInfo); |
| 87 if (!basePrototype.IsEmpty()) | 87 if (!basePrototype.IsEmpty()) |
| 88 m_prototype->SetPrototype(basePrototype); | 88 m_prototype->SetPrototype(basePrototype); |
| 89 } | 89 } |
| 90 | 90 |
| 91 String extends; | 91 AtomicString extends; |
| 92 bool extendsProvidedAndNonNull = m_options->get("extends", extends); | 92 bool extendsProvidedAndNonNull = m_options->get("extends", extends); |
| 93 | 93 |
| 94 if (!V8PerContextData::from(m_context)) { | 94 if (!V8PerContextData::from(m_context)) { |
| 95 // FIXME: This should generate an InvalidContext exception at a later po int. | 95 // FIXME: This should generate an InvalidContext exception at a later po int. |
| 96 CustomElementException::throwException(CustomElementException::ContextDe stroyedCheckingPrototype, type, exceptionState); | 96 CustomElementException::throwException(CustomElementException::ContextDe stroyedCheckingPrototype, type, exceptionState); |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 AtomicString namespaceURI = HTMLNames::xhtmlNamespaceURI; | 100 AtomicString namespaceURI = HTMLNames::xhtmlNamespaceURI; |
| 101 if (hasValidPrototypeChainFor(&V8SVGElement::wrapperTypeInfo)) | 101 if (hasValidPrototypeChainFor(&V8SVGElement::wrapperTypeInfo)) |
| 102 namespaceURI = SVGNames::svgNamespaceURI; | 102 namespaceURI = SVGNames::svgNamespaceURI; |
| 103 | 103 |
| 104 AtomicString localName; | 104 AtomicString localName; |
| 105 | 105 |
| 106 if (extendsProvidedAndNonNull) { | 106 if (extendsProvidedAndNonNull) { |
| 107 localName = extends.lower(); | 107 localName = extends.lower(); |
|
Inactive
2013/12/31 15:43:46
String -> AtomicString conversion if extends is no
| |
| 108 | 108 |
| 109 if (!Document::isValidName(localName)) { | 109 if (!Document::isValidName(localName)) { |
| 110 CustomElementException::throwException(CustomElementException::Exten dsIsInvalidName, type, exceptionState); | 110 CustomElementException::throwException(CustomElementException::Exten dsIsInvalidName, type, exceptionState); |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 if (CustomElement::isValidName(localName)) { | 113 if (CustomElement::isValidName(localName)) { |
| 114 CustomElementException::throwException(CustomElementException::Exten dsIsCustomElementName, type, exceptionState); | 114 CustomElementException::throwException(CustomElementException::Exten dsIsCustomElementName, type, exceptionState); |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 } else { | 117 } else { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 | 278 |
| 279 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate()); | 279 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate()); |
| 280 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 280 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 281 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState); | 281 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState); |
| 282 if (exceptionState.throwIfNeeded()) | 282 if (exceptionState.throwIfNeeded()) |
| 283 return; | 283 return; |
| 284 v8SetReturnValueFast(info, element.release(), document); | 284 v8SetReturnValueFast(info, element.release(), document); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace WebCore | 287 } // namespace WebCore |
| OLD | NEW |