| Index: Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| diff --git a/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl b/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| index b3b4603045eaf0ee100c29ea025fc3cf1a3086b6..fb5e9f9fecbe72b9c43d6d5498f4ea89d958de2c 100644
|
| --- a/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| +++ b/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| @@ -8,14 +8,12 @@
|
| #include "{{namespace}}Names.h"
|
| #include "bindings/v8/CustomElementWrapper.h"
|
| {%- for tag in tags|sort if tag|has_js_interface %}
|
| -#include "V8{{tag|interface}}.h"
|
| +#include "V8{{namespace}}{{tag|interface}}.h"
|
| {%- endfor %}
|
| {%- for tag in tags|sort if tag|has_js_interface %}
|
| -#include "core/{{namespace|lower}}/{{tag|js_interface}}.h"
|
| +#include "core/{{namespace|lower}}/{{namespace}}{{tag|js_interface}}.h"
|
| {%- endfor %}
|
| -{%- if fallback_interface %}
|
| -#include "core/{{namespace|lower}}/{{fallback_interface}}.h"
|
| -{%- endif %}
|
| +#include "core/{{namespace|lower}}/{{fallback_js_interface}}.h"
|
| #include "core/dom/ContextFeatures.h"
|
| #include "core/dom/Document.h"
|
| #include "core/page/Settings.h"
|
| @@ -34,18 +32,18 @@ static v8::Handle<v8::Object> create{{namespace}}ElementWrapper({{namespace}}Ele
|
| }
|
|
|
| {%- for interface, list in tags|sort|groupby('js_interface') if interface %}
|
| -static v8::Handle<v8::Object> create{{interface}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| +static v8::Handle<v8::Object> create{{namespace}}{{interface}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| {%- if list[0].wrapperOnlyIfMediaIsAvailable %}
|
| Settings* settings = element->document().settings();
|
| if (!RuntimeEnabledFeatures::mediaEnabled() || (settings && !settings->mediaEnabled()))
|
| - return createV8{{namespace}}FallbackWrapper(to{{fallback_interface}}(element), creationContext, isolate);
|
| + return createV8{{namespace}}FallbackWrapper(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| {%- endif %}
|
| {%- if list[0].contextConditional %}
|
| if (!ContextFeatures::{{list[0].contextConditional}}Enabled(&element->document()))
|
| - return createV8{{namespace}}FallbackWrapper(to{{fallback_interface}}(element), creationContext, isolate);
|
| + return createV8{{namespace}}FallbackWrapper(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| {%- endif %}
|
| - return wrap(static_cast<{{interface}}*>(element), creationContext, isolate);
|
| + return wrap(static_cast<{{namespace}}{{interface}}*>(element), creationContext, isolate);
|
| }
|
| {%- endfor %}
|
|
|
| @@ -55,11 +53,11 @@ v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* elemen
|
| DEFINE_STATIC_LOCAL(FunctionMap, map, ());
|
| if (map.isEmpty()) {
|
| {%- for tag in tags|sort %}
|
| - map.set({{tag|symbol}}Tag.localName().impl(), create{{tag|js_interface}}Wrapper);
|
| + map.set({{tag|symbol}}Tag.localName().impl(), create{{namespace}}{{tag|js_interface}}Wrapper);
|
| {%- endfor %}
|
| } // taco
|
|
|
| - CreateHTMLElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
|
| + Create{{namespace}}ElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
|
| if (createWrapperFunction == create{{namespace}}ElementWrapper)
|
| createWrapperFunction = createV8{{namespace}}DirectWrapper;
|
| if (element->isCustomElement())
|
| @@ -67,7 +65,11 @@ v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* elemen
|
|
|
| if (createWrapperFunction)
|
| return createWrapperFunction(element, creationContext, isolate);
|
| - return wrap(to{{fallback_interface}}(element), creationContext, isolate);
|
| +{%- if fallback_js_interface == namespace + "Element" %}
|
| + return V8{{fallback_js_interface}}::createWrapper(element, creationContext, isolate);
|
| +{%- else %}
|
| + return wrap(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| +{%- endif %}
|
| }
|
|
|
| WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString& name)
|
| @@ -78,14 +80,14 @@ WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString& name
|
| // FIXME: This seems wrong. We should list every interface here, not
|
| // just the ones that have specialized JavaScript interfaces.
|
| {%- for tag in tags|sort if tag|has_js_interface %}
|
| - map.set({{tag|symbol}}Tag.localName().impl(), WrapperTypeTraits<{{tag|js_interface}}>::info());
|
| + map.set({{tag|symbol}}Tag.localName().impl(), WrapperTypeTraits<{{namespace}}{{tag|js_interface}}>::info());
|
| {%- endfor %}
|
| }
|
|
|
| if (WrapperTypeInfo* result = map.get(name.impl()))
|
| return result;
|
|
|
| - return WrapperTypeTraits<{{fallback_interface}}>::info();
|
| + return WrapperTypeTraits<{{fallback_js_interface}}>::info();
|
| }
|
|
|
| }
|
|
|