| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 CreateSVGWrapperFunction m_svg; | 81 CreateSVGWrapperFunction m_svg; |
| 82 CreateHTMLWrapperFunction m_html; | 82 CreateHTMLWrapperFunction m_html; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // You can just use toV8(Node*) to get correct wrapper objects, | 85 // You can just use toV8(Node*) to get correct wrapper objects, |
| 86 // even for custom elements. Then generated | 86 // even for custom elements. Then generated |
| 87 // ElementWrapperFactories call V8CustomElement::wrap() with | 87 // ElementWrapperFactories call V8CustomElement::wrap() with |
| 88 // proper prototype instances accordingly. | 88 // proper prototype instances accordingly. |
| 89 static v8::Handle<v8::Object> wrap(Element*, v8::Handle<v8::Object> creation
Context, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgradeCa
ndidateWrapper); | 89 static v8::Handle<v8::Object> wrap(Element*, v8::Handle<v8::Object> creation
Context, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgradeCa
ndidateWrapper); |
| 90 | 90 |
| 91 static bool isCustomElement(Element*); |
| 92 |
| 91 private: | 93 private: |
| 92 static void invokeReadyCallbackIfNeeded(Element*, v8::Handle<v8::Context>); | 94 static void invokeReadyCallbackIfNeeded(Element*, v8::Handle<v8::Context>); |
| 93 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Element>, v8::Handle<
v8::Object>, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgra
deCandidateWrapper); | 95 static v8::Handle<v8::Object> createWrapper(PassRefPtr<Element>, v8::Handle<
v8::Object>, v8::Isolate*, const CreateWrapperFunction& createTypeExtensionUpgra
deCandidateWrapper); |
| 94 static v8::Handle<v8::Object> createUpgradeCandidateWrapper(PassRefPtr<Eleme
nt>, v8::Handle<v8::Object> creationContext, v8::Isolate*, const CreateWrapperFu
nction& createTypeExtensionUpgradeCandidateWrapper); | 96 static v8::Handle<v8::Object> createUpgradeCandidateWrapper(PassRefPtr<Eleme
nt>, v8::Handle<v8::Object> creationContext, v8::Isolate*, const CreateWrapperFu
nction& createTypeExtensionUpgradeCandidateWrapper); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 inline v8::Handle<v8::Object> CustomElementHelpers::wrap(Element* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate, const CreateWrapperFunctio
n& createWrapper) | 99 inline v8::Handle<v8::Object> CustomElementHelpers::wrap(Element* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate, const CreateWrapperFunctio
n& createWrapper) |
| 98 { | 100 { |
| 99 ASSERT(impl); | 101 ASSERT(impl); |
| 100 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); | 102 ASSERT(DOMDataStore::getWrapper(impl, isolate).IsEmpty()); |
| 101 return CustomElementHelpers::createWrapper(impl, creationContext, isolate, c
reateWrapper); | 103 return CustomElementHelpers::createWrapper(impl, creationContext, isolate, c
reateWrapper); |
| 102 } | 104 } |
| 103 | 105 |
| 104 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v
alue, ScriptState* state) | 106 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v
alue, ScriptState* state) |
| 105 { | 107 { |
| 106 AtomicString namespaceURI; | 108 AtomicString namespaceURI; |
| 107 return isValidPrototypeParameter(value, state, namespaceURI); | 109 return isValidPrototypeParameter(value, state, namespaceURI); |
| 108 } | 110 } |
| 109 | 111 |
| 110 } // namespace WebCore | 112 } // namespace WebCore |
| 111 | 113 |
| 112 #endif // CustomElementHelpers_h | 114 #endif // CustomElementHelpers_h |
| OLD | NEW |