| Index: Source/bindings/v8/CustomElementHelpers.cpp
|
| diff --git a/Source/bindings/v8/CustomElementHelpers.cpp b/Source/bindings/v8/CustomElementHelpers.cpp
|
| index 674f4e97ef0ce62aca5b954088a12a4631b3fdf3..6c950a1c32cf2b664552f4f260b49f0aa0141ded 100644
|
| --- a/Source/bindings/v8/CustomElementHelpers.cpp
|
| +++ b/Source/bindings/v8/CustomElementHelpers.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "HTMLNames.h"
|
| #include "V8CustomElementConstructor.h"
|
| #include "V8HTMLElementWrapperFactory.h"
|
| +#include "bindings/v8/DOMDataStore.h"
|
| #include "bindings/v8/DOMWrapperWorld.h"
|
| #include "bindings/v8/ScriptController.h"
|
| #include "core/dom/CustomElementRegistry.h"
|
| @@ -242,6 +243,28 @@ const QualifiedName* CustomElementHelpers::findLocalName(v8::Handle<v8::Object>
|
| return 0;
|
| }
|
|
|
| +void CustomElementHelpers::upgradeWrappers(ScriptExecutionContext* executionContext, const HashSet<Element*>& elements, const ScriptValue& prototype)
|
| +{
|
| + if (elements.isEmpty())
|
| + return;
|
| +
|
| + v8::HandleScope handleScope;
|
| + v8::Handle<v8::Context> context = toV8Context(executionContext, mainThreadNormalWorld());
|
| + v8::Context::Scope scope(context);
|
| +
|
| + v8::Handle<v8::Value> v8Prototype = prototype.v8Value();
|
| +
|
| + for (HashSet<Element*>::const_iterator it = elements.begin(); it != elements.end(); ++it) {
|
| + v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld(*it);
|
| + if (wrapper.IsEmpty()) {
|
| + // The wrapper will be created with the right prototype when
|
| + // retrieved; we don't need to eagerly create the wrapper.
|
| + continue;
|
| + }
|
| + wrapper->SetPrototype(v8Prototype);
|
| + }
|
| +}
|
| +
|
| void CustomElementHelpers::invokeReadyCallbackIfNeeded(Element* element, v8::Handle<v8::Context> context)
|
| {
|
| v8::Handle<v8::Value> wrapperValue = toV8(element, context->Global(), context->GetIsolate());
|
|
|