Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: Source/core/scripts/make_names.pl

Issue 14083009: Remove ENABLE_CUSTOM_ELEMENTS compile time flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 836
837 printConditionalElementIncludes($F); 837 printConditionalElementIncludes($F);
838 838
839 print F <<END 839 print F <<END
840 840
841 #include "ContextFeatures.h" 841 #include "ContextFeatures.h"
842 #include "Document.h" 842 #include "Document.h"
843 #include "RuntimeEnabledFeatures.h" 843 #include "RuntimeEnabledFeatures.h"
844 #include "Settings.h" 844 #include "Settings.h"
845 845
846 #if ENABLE(CUSTOM_ELEMENTS)
847 #include "CustomElementConstructor.h" 846 #include "CustomElementConstructor.h"
848 #include "CustomElementRegistry.h" 847 #include "CustomElementRegistry.h"
849 #endif
850 848
851 namespace WebCore { 849 namespace WebCore {
852 850
853 using namespace $parameters{namespace}Names; 851 using namespace $parameters{namespace}Names;
854 852
855 END 853 END
856 ; 854 ;
857 855
858 print F "typedef PassRefPtr<$parameters{namespace}Element> (*ConstructorFunction )(const QualifiedName&, Document*"; 856 print F "typedef PassRefPtr<$parameters{namespace}Element> (*ConstructorFunction )(const QualifiedName&, Document*";
859 print F ", HTMLFormElement*" if $parameters{namespace} eq "HTML"; 857 print F ", HTMLFormElement*" if $parameters{namespace} eq "HTML";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 891
894 892
895 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum ent* document"; 893 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum ent* document";
896 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML"; 894 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
897 print F ", bool createdByParser)\n{\n"; 895 print F ", bool createdByParser)\n{\n";
898 896
899 print F <<END 897 print F <<END
900 if (!document) 898 if (!document)
901 return 0; 899 return 0;
902 900
903 #if ENABLE(CUSTOM_ELEMENTS)
904 if (document->registry()) { 901 if (document->registry()) {
905 if (RefPtr<CustomElementConstructor> constructor = document->registry()- >find(nullQName(), qName)) { 902 if (RefPtr<CustomElementConstructor> constructor = document->registry()- >find(nullQName(), qName)) {
906 RefPtr<Element> element = constructor->createElement(); 903 RefPtr<Element> element = constructor->createElement();
907 ASSERT(element->is$parameters{namespace}Element()); 904 ASSERT(element->is$parameters{namespace}Element());
908 return static_pointer_cast<$parameters{namespace}Element>(element.re lease()); 905 return static_pointer_cast<$parameters{namespace}Element>(element.re lease());
909 } 906 }
910 } 907 }
911 #endif
912 908
913 if (!gFunctionMap) 909 if (!gFunctionMap)
914 createFunctionMap(); 910 createFunctionMap();
915 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl( ))) { 911 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl( ))) {
916 END 912 END
917 ; 913 ;
918 914
919 if ($parameters{namespace} eq "HTML") { 915 if ($parameters{namespace} eq "HTML") {
920 print F " if (PassRefPtr<$parameters{namespace}Element> element = fun ction(qName, document, formElement, createdByParser))\n"; 916 print F " if (PassRefPtr<$parameters{namespace}Element> element = fun ction(qName, document, formElement, createdByParser))\n";
921 print F " return element;\n"; 917 print F " return element;\n";
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 1103
1108 print F <<END 1104 print F <<END
1109 1105
1110 #include "ContextFeatures.h" 1106 #include "ContextFeatures.h"
1111 #include "Document.h" 1107 #include "Document.h"
1112 #include "RuntimeEnabledFeatures.h" 1108 #include "RuntimeEnabledFeatures.h"
1113 #include "Settings.h" 1109 #include "Settings.h"
1114 1110
1115 #include "V8$parameters{namespace}Element.h" 1111 #include "V8$parameters{namespace}Element.h"
1116 1112
1117 #if ENABLE(CUSTOM_ELEMENTS)
1118 #include "CustomElementHelpers.h" 1113 #include "CustomElementHelpers.h"
1119 #endif
1120 1114
1121 #include <v8.h> 1115 #include <v8.h>
1122 1116
1123 namespace WebCore { 1117 namespace WebCore {
1124 1118
1125 using namespace $parameters{namespace}Names; 1119 using namespace $parameters{namespace}Names;
1126 1120
1127 typedef v8::Handle<v8::Object> (*Create$parameters{namespace}ElementWrapperFunct ion)($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8: :Isolate*); 1121 typedef v8::Handle<v8::Object> (*Create$parameters{namespace}ElementWrapperFunct ion)($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8: :Isolate*);
1128 1122
1129 END 1123 END
(...skipping 23 matching lines...) Expand all
1153 my $ucTag = $enabledTags{$tag}{JSInterfaceName}; 1147 my $ucTag = $enabledTags{$tag}{JSInterfaceName};
1154 print F " map.set(${tag}Tag.localName().impl(), create${ucTag}Wrap per);\n"; 1148 print F " map.set(${tag}Tag.localName().impl(), create${ucTag}Wrap per);\n";
1155 1149
1156 if ($conditional) { 1150 if ($conditional) {
1157 print F "#endif\n"; 1151 print F "#endif\n";
1158 } 1152 }
1159 } 1153 }
1160 1154
1161 print F <<END 1155 print F <<END
1162 } 1156 }
1163 #if ENABLE(CUSTOM_ELEMENTS) 1157
1164 if (PassRefPtr<CustomElementConstructor> constructor = CustomElementHelpers: :constructorOf(element)) 1158 if (PassRefPtr<CustomElementConstructor> constructor = CustomElementHelpers: :constructorOf(element))
1165 return CustomElementHelpers::wrap(element, creationContext, constructor, isolate); 1159 return CustomElementHelpers::wrap(element, creationContext, constructor, isolate);
1166 #endif
1167 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m ap.get(element->localName().impl()); 1160 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m ap.get(element->localName().impl());
1168 if (createWrapperFunction) 1161 if (createWrapperFunction)
1169 { 1162 {
1170 END 1163 END
1171 ; 1164 ;
1172 if ($parameters{namespace} eq "HTML") { 1165 if ($parameters{namespace} eq "HTML") {
1173 print F <<END 1166 print F <<END
1174 if (createWrapperFunction == createHTMLElementWrapper) 1167 if (createWrapperFunction == createHTMLElementWrapper)
1175 return V8HTMLElement::createWrapper(element, creationContext, isolate ); 1168 return V8HTMLElement::createWrapper(element, creationContext, isolate );
1176 END 1169 END
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } 1262 }
1270 } 1263 }
1271 END 1264 END
1272 ; 1265 ;
1273 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa ctoryWith}; 1266 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa ctoryWith};
1274 1267
1275 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n"; 1268 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n";
1276 1269
1277 close F; 1270 close F;
1278 } 1271 }
OLDNEW
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698