| OLD | NEW |
| 1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
| 2 | 2 |
| 3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. | 3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> | 4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> |
| 5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob
ile.com/) | 5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob
ile.com/) |
| 6 # Copyright (C) 2011 Ericsson AB. All rights reserved. | 6 # Copyright (C) 2011 Ericsson AB. All rights reserved. |
| 7 # | 7 # |
| 8 # Redistribution and use in source and binary forms, with or without | 8 # Redistribution and use in source and binary forms, with or without |
| 9 # modification, are permitted provided that the following conditions | 9 # modification, are permitted provided that the following conditions |
| 10 # are met: | 10 # are met: |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 | 890 |
| 891 | 891 |
| 892 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme
ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum
ent* document"; | 892 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme
ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum
ent* document"; |
| 893 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML"; | 893 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML"; |
| 894 print F ", bool createdByParser)\n{\n"; | 894 print F ", bool createdByParser)\n{\n"; |
| 895 | 895 |
| 896 print F <<END | 896 print F <<END |
| 897 if (!document) | 897 if (!document) |
| 898 return 0; | 898 return 0; |
| 899 | 899 |
| 900 if (document->registry()) { | 900 if (CustomElementRegistry::isCustomTagName(qName.localName())) { |
| 901 if (RefPtr<Element> element = document->registry()->tryToCreateCustomTag
Element(qName)) { | 901 RefPtr<Element> element = document->ensureCustomElementRegistry()->creat
eCustomTagElement(qName); |
| 902 ASSERT(element->is$parameters{namespace}Element()); | 902 ASSERT(element->is$parameters{namespace}Element()); |
| 903 return static_pointer_cast<$parameters{namespace}Element>(element.re
lease()); | 903 return static_pointer_cast<$parameters{namespace}Element>(element.releas
e()); |
| 904 } | |
| 905 } | 904 } |
| 906 | 905 |
| 907 if (!gFunctionMap) | 906 if (!gFunctionMap) |
| 908 createFunctionMap(); | 907 createFunctionMap(); |
| 909 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl(
))) { | 908 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl(
))) { |
| 910 END | 909 END |
| 911 ; | 910 ; |
| 912 | 911 |
| 913 if ($parameters{namespace} eq "HTML") { | 912 if ($parameters{namespace} eq "HTML") { |
| 914 print F " if (PassRefPtr<$parameters{namespace}Element> element = fun
ction(qName, document, formElement, createdByParser))\n"; | 913 print F " if (PassRefPtr<$parameters{namespace}Element> element = fun
ction(qName, document, formElement, createdByParser))\n"; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 print F " map.set(${tag}Tag.localName().impl(), create${ucTag}Wrap
per);\n"; | 1145 print F " map.set(${tag}Tag.localName().impl(), create${ucTag}Wrap
per);\n"; |
| 1147 | 1146 |
| 1148 if ($conditional) { | 1147 if ($conditional) { |
| 1149 print F "#endif\n"; | 1148 print F "#endif\n"; |
| 1150 } | 1149 } |
| 1151 } | 1150 } |
| 1152 | 1151 |
| 1153 print F <<END | 1152 print F <<END |
| 1154 } | 1153 } |
| 1155 | 1154 |
| 1156 if (CustomElementHelpers::hasDefinition(element)) | |
| 1157 return CustomElementHelpers::wrap(element, creationContext, isolate); | |
| 1158 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m
ap.get(element->localName().impl()); | 1155 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m
ap.get(element->localName().impl()); |
| 1156 if (CustomElementHelpers::isCustomElement(element)) |
| 1157 return CustomElementHelpers::wrap(element, creationContext, isolate, Cus
tomElementHelpers::CreateWrapperFunction(createWrapperFunction)); |
| 1159 if (createWrapperFunction) | 1158 if (createWrapperFunction) |
| 1160 { | 1159 { |
| 1161 END | 1160 END |
| 1162 ; | 1161 ; |
| 1163 if ($parameters{namespace} eq "HTML") { | 1162 if ($parameters{namespace} eq "HTML") { |
| 1164 print F <<END | 1163 print F <<END |
| 1165 if (createWrapperFunction == createHTMLElementWrapper) | 1164 if (createWrapperFunction == createHTMLElementWrapper) |
| 1166 return V8HTMLElement::createWrapper(element, creationContext, isolate
); | 1165 return V8HTMLElement::createWrapper(element, creationContext, isolate
); |
| 1167 END | 1166 END |
| 1168 } | 1167 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 } | 1259 } |
| 1261 } | 1260 } |
| 1262 END | 1261 END |
| 1263 ; | 1262 ; |
| 1264 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa
ctoryWith}; | 1263 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa
ctoryWith}; |
| 1265 | 1264 |
| 1266 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n"; | 1265 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n"; |
| 1267 | 1266 |
| 1268 close F; | 1267 close F; |
| 1269 } | 1268 } |
| OLD | NEW |