| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // https://bugs.webkit.org/show_bug.cgi?id=108138 | 57 // https://bugs.webkit.org/show_bug.cgi?id=108138 |
| 58 if (!CustomElementHelpers::isFeatureAllowed(context)) { | 58 if (!CustomElementHelpers::isFeatureAllowed(context)) { |
| 59 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationCon
text, &V8HTMLElement::info, impl.get(), isolate); | 59 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationCon
text, &V8HTMLElement::info, impl.get(), isolate); |
| 60 if (!wrapper.IsEmpty()) | 60 if (!wrapper.IsEmpty()) |
| 61 V8DOMWrapper::associateObjectWithWrapper(impl, &V8HTMLElement::info,
wrapper, isolate, WrapperConfiguration::Dependent); | 61 V8DOMWrapper::associateObjectWithWrapper(impl, &V8HTMLElement::info,
wrapper, isolate, WrapperConfiguration::Dependent); |
| 62 return wrapper; | 62 return wrapper; |
| 63 } | 63 } |
| 64 | 64 |
| 65 CustomElementRegistry* registry = impl->document()->registry(); | 65 CustomElementRegistry* registry = impl->document()->registry(); |
| 66 RefPtr<CustomElementDefinition> definition = registry->findFor(impl.get()); | 66 RefPtr<CustomElementDefinition> definition = registry->findFor(impl.get()); |
| 67 if (!definition) | 67 if (!impl->isUpgradedCustomElement() || !definition) |
| 68 return createUpgradeCandidateWrapper(impl, creationContext, isolate, cre
ateTypeExtensionUpgradeCandidateWrapper); | 68 return createUpgradeCandidateWrapper(impl, creationContext, isolate, cre
ateTypeExtensionUpgradeCandidateWrapper); |
| 69 | 69 |
| 70 V8PerContextData* perContextData = V8PerContextData::from(context); | 70 V8PerContextData* perContextData = V8PerContextData::from(context); |
| 71 if (!perContextData) | 71 if (!perContextData) |
| 72 return v8::Handle<v8::Object>(); | 72 return v8::Handle<v8::Object>(); |
| 73 | 73 |
| 74 v8::Handle<v8::Object> prototype = perContextData->customElementPrototypes()
->get(definition->type()).newLocal(isolate); | 74 v8::Handle<v8::Object> prototype = perContextData->customElementPrototypes()
->get(definition->type()).newLocal(isolate); |
| 75 WrapperTypeInfo* typeInfo = CustomElementHelpers::findWrapperType(prototype)
; | 75 WrapperTypeInfo* typeInfo = CustomElementHelpers::findWrapperType(prototype)
; |
| 76 if (!typeInfo) { | 76 if (!typeInfo) { |
| 77 // FIXME: When can this happen? | 77 // FIXME: When can this happen? |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Only prototype objects of native-backed types have the extra internal
field storing WrapperTypeInfo. | 135 // Only prototype objects of native-backed types have the extra internal
field storing WrapperTypeInfo. |
| 136 if (v8PrototypeInternalFieldcount == chainObject->InternalFieldCount()) | 136 if (v8PrototypeInternalFieldcount == chainObject->InternalFieldCount()) |
| 137 return reinterpret_cast<WrapperTypeInfo*>(chainObject->GetAlignedPoi
nterFromInternalField(v8PrototypeTypeIndex)); | 137 return reinterpret_cast<WrapperTypeInfo*>(chainObject->GetAlignedPoi
nterFromInternalField(v8PrototypeTypeIndex)); |
| 138 chain = chainObject->GetPrototype(); | 138 chain = chainObject->GetPrototype(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 return 0; | 141 return 0; |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace WebCore | 144 } // namespace WebCore |
| OLD | NEW |