| 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 e71b9750c378ceb23b0f9945b9a1d74bc9d50f48..71ff72d986a8c121f8e0b5c1c920adb1c049d512 100644
|
| --- a/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| +++ b/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
|
| @@ -1,4 +1,4 @@
|
| -{% from "macros.tmpl" import license -%}
|
| +{% from "macros.tmpl" import license %}
|
| {{ license() }}
|
|
|
| #include "config.h"
|
| @@ -7,12 +7,12 @@
|
| #include "RuntimeEnabledFeatures.h"
|
| #include "{{namespace}}Names.h"
|
| #include "bindings/v8/CustomElementWrapper.h"
|
| -{%- for tag in tags|sort if tag.has_js_interface %}
|
| +{% for tag in tags|sort if tag.has_js_interface %}
|
| #include "V8{{tag.interface}}.h"
|
| -{%- endfor %}
|
| -{%- for tag in tags|sort if tag.has_js_interface %}
|
| +{% endfor %}
|
| +{% for tag in tags|sort if tag.has_js_interface %}
|
| #include "core/{{namespace|lower}}/{{tag.js_interface}}.h"
|
| -{%- endfor %}
|
| +{% endfor %}
|
| #include "core/{{namespace|lower}}/{{fallback_js_interface}}.h"
|
| #include "core/dom/ContextFeatures.h"
|
| #include "core/dom/Document.h"
|
| @@ -30,30 +30,29 @@ static v8::Handle<v8::Object> create{{namespace}}ElementWrapper({{namespace}}Ele
|
| ASSERT_NOT_REACHED();
|
| return v8::Handle<v8::Object>();
|
| }
|
| -
|
| -{%- for js_interface, list in tags|sort|selectattr('has_js_interface')|groupby('js_interface') %}
|
| +{% for js_interface, list in tags|sort|selectattr('has_js_interface')|groupby('js_interface') %}
|
| static v8::Handle<v8::Object> create{{js_interface}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| -{%- if list[0].contextConditional %}
|
| + {% if list[0].contextConditional %}
|
| if (!ContextFeatures::{{list[0].contextConditional}}Enabled(&element->document()))
|
| return createV8{{namespace}}FallbackWrapper(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| -{%- endif %}
|
| -{%- if list[0].runtimeEnabled %}
|
| + {% endif %}
|
| + {% if list[0].runtimeEnabled %}
|
| if (!RuntimeEnabledFeatures::{{list[0].runtimeEnabled}}Enabled())
|
| return createV8{{namespace}}FallbackWrapper(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| -{%- endif %}
|
| + {% endif %}
|
| return wrap(static_cast<{{js_interface}}*>(element), creationContext, isolate);
|
| }
|
| -{%- endfor %}
|
| +{% endfor %}
|
|
|
| v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| typedef HashMap<StringImpl*, Create{{namespace}}ElementWrapperFunction> FunctionMap;
|
| DEFINE_STATIC_LOCAL(FunctionMap, map, ());
|
| if (map.isEmpty()) {
|
| -{%- for tag in tags|sort %}
|
| + {% for tag in tags|sort %}
|
| map.set({{tag|symbol}}Tag.localName().impl(), create{{tag.js_interface}}Wrapper);
|
| -{%- endfor %}
|
| + {% endfor %}
|
| }
|
|
|
| Create{{namespace}}ElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
|
| @@ -64,11 +63,11 @@ v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* elemen
|
|
|
| if (createWrapperFunction)
|
| return createWrapperFunction(element, creationContext, isolate);
|
| -{%- if fallback_js_interface == namespace + "Element" %}
|
| + {% if fallback_js_interface == namespace + 'Element' %}
|
| return V8{{fallback_js_interface}}::createWrapper(element, creationContext, isolate);
|
| -{%- else %}
|
| + {% else %}
|
| return wrap(to{{fallback_js_interface}}(element), creationContext, isolate);
|
| -{%- endif %}
|
| + {% endif %}
|
| }
|
|
|
| const WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString& name)
|
| @@ -78,9 +77,9 @@ const WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString
|
| if (map.isEmpty()) {
|
| // 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 %}
|
| + {% for tag in tags|sort if tag.has_js_interface %}
|
| map.set({{tag|symbol}}Tag.localName().impl(), &V8{{tag.js_interface}}::wrapperTypeInfo);
|
| -{%- endfor %}
|
| + {% endfor %}
|
| }
|
|
|
| if (const WrapperTypeInfo* result = map.get(name.impl()))
|
|
|