Generate toFooElement() functions from tagname data.
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 22:57:40 +0000 (22:57 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 22:57:40 +0000 (22:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120676

Reviewed by Andreas Kling.

As r154965 introduced the isFooElement() generation, this patch adds generations of toFooElement() function
to *generateTypeChecking* attribute. To represent isFooElement() and toFooElement(), *generateTypeChecking*
is changed to *generateTypeHelpers*.

Removed all the hand-written toFooElement() that can be covered by the *generateTypeHelpers*.

* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/make_names.pl:
(defaultTagPropertyHash):
(printTypeHelpers):
(printTypeHelpersHeaderFile):
* html/HTMLAnchorElement.h:
* html/HTMLAreaElement.h:
* html/HTMLAudioElement.h:
* html/HTMLCanvasElement.h:
* html/HTMLElement.h:
* html/HTMLFormElement.h:
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLLabelElement.h:
* html/HTMLMapElement.h:
* html/HTMLMeterElement.h:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.h:
* html/HTMLProgressElement.h:
* html/HTMLScriptElement.h:
* html/HTMLStyleElement.h:
* html/HTMLTableElement.h:
* html/HTMLTableRowElement.h:
* html/HTMLTagNames.in:
* html/HTMLTextAreaElement.h:
* html/HTMLTitleElement.h:
* svg/SVGElement.h:
* svg/SVGFontElement.h:
* svg/SVGFontFaceElement.h:
* svg/SVGImageElement.h:
* svg/SVGScriptElement.h:
* svg/svgtags.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

34 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/make_names.pl
Source/WebCore/html/HTMLAnchorElement.h
Source/WebCore/html/HTMLAreaElement.h
Source/WebCore/html/HTMLAudioElement.h
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLLabelElement.h
Source/WebCore/html/HTMLMapElement.h
Source/WebCore/html/HTMLMeterElement.h
Source/WebCore/html/HTMLOptGroupElement.h
Source/WebCore/html/HTMLOptionElement.h
Source/WebCore/html/HTMLProgressElement.h
Source/WebCore/html/HTMLScriptElement.h
Source/WebCore/html/HTMLStyleElement.h
Source/WebCore/html/HTMLTableElement.h
Source/WebCore/html/HTMLTableRowElement.h
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/html/HTMLTitleElement.h
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGFontElement.h
Source/WebCore/svg/SVGFontFaceElement.h
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGScriptElement.h
Source/WebCore/svg/svgtags.in

index 419bb6c..10629a5 100644 (file)
@@ -1,3 +1,53 @@
+2013-09-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Generate toFooElement() functions from tagname data.
+        https://bugs.webkit.org/show_bug.cgi?id=120676
+
+        Reviewed by Andreas Kling.
+
+        As r154965 introduced the isFooElement() generation, this patch adds generations of toFooElement() function
+        to *generateTypeChecking* attribute. To represent isFooElement() and toFooElement(), *generateTypeChecking*
+        is changed to *generateTypeHelpers*.
+
+        Removed all the hand-written toFooElement() that can be covered by the *generateTypeHelpers*.
+
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/make_names.pl:
+        (defaultTagPropertyHash):
+        (printTypeHelpers):
+        (printTypeHelpersHeaderFile):
+        * html/HTMLAnchorElement.h:
+        * html/HTMLAreaElement.h:
+        * html/HTMLAudioElement.h:
+        * html/HTMLCanvasElement.h:
+        * html/HTMLElement.h:
+        * html/HTMLFormElement.h:
+        * html/HTMLFrameSetElement.h:
+        * html/HTMLImageElement.h:
+        * html/HTMLInputElement.h:
+        * html/HTMLLabelElement.h:
+        * html/HTMLMapElement.h:
+        * html/HTMLMeterElement.h:
+        * html/HTMLOptGroupElement.h:
+        * html/HTMLOptionElement.h:
+        * html/HTMLProgressElement.h:
+        * html/HTMLScriptElement.h:
+        * html/HTMLStyleElement.h:
+        * html/HTMLTableElement.h:
+        * html/HTMLTableRowElement.h:
+        * html/HTMLTagNames.in:
+        * html/HTMLTextAreaElement.h:
+        * html/HTMLTitleElement.h:
+        * svg/SVGElement.h:
+        * svg/SVGFontElement.h:
+        * svg/SVGFontFaceElement.h:
+        * svg/SVGImageElement.h:
+        * svg/SVGScriptElement.h:
+        * svg/svgtags.in:
+
 2013-09-05  Andreas Kling  <akling@apple.com>
 
         Cached Page and Frame don't need to be ref-counted.
index a4b88e9..5443b73 100644 (file)
@@ -298,7 +298,7 @@ DerivedSources/WebCore/PlugInsResources.h: $(WebCore)/css/make-css-file-arrays.p
 DerivedSources/WebCore/JSHTMLElementWrapperFactory.cpp: DerivedSources/WebCore/HTMLElementFactory.cpp
 DerivedSources/WebCore/HTMLElementFactory.cpp: DerivedSources/WebCore/HTMLElementFactory.h
 DerivedSources/WebCore/HTMLElementFactory.h: DerivedSources/WebCore/HTMLNames.cpp
-DerivedSources/WebCore/HTMLElementTypeChecks.h: DerivedSources/WebCore/HTMLNames.h
+DerivedSources/WebCore/HTMLElementTypeHelpers.h: DerivedSources/WebCore/HTMLNames.h
 DerivedSources/WebCore/HTMLNames.cpp: DerivedSources/WebCore/HTMLNames.h
 DerivedSources/WebCore/HTMLNames.h: $(WebCore)/dom/make_names.pl $(WebCore)/bindings/scripts/Hasher.pm $(WebCore)/bindings/scripts/StaticString.pm $(WebCore)/html/HTMLTagNames.in $(WebCore)/html/HTMLAttributeNames.in
        $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --extraDefines "$(feature_defines)" --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
index ae0019f..a3a449a 100644 (file)
@@ -15,7 +15,7 @@ webcore_built_sources += \
        DerivedSources/WebCore/ExceptionInterfaces.h \
        DerivedSources/WebCore/HTMLElementFactory.cpp \
        DerivedSources/WebCore/HTMLElementFactory.h \
-       DerivedSources/WebCore/HTMLElementTypeChecks.h \
+       DerivedSources/WebCore/HTMLElementTypeHelpers.h \
        DerivedSources/WebCore/HTMLEntityTable.cpp \
        DerivedSources/WebCore/HTMLNames.cpp \
        DerivedSources/WebCore/HTMLNames.h \
index e2ee7bc..7ec4d08 100644 (file)
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ExceptionHeaders.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ExceptionInterfaces.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLElementFactory.h" />
-    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLElementTypeChecks.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLElementTypeHelpers.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLNames.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptCanvasModuleSource.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptSource.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\MathMLElementFactory.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\MathMLNames.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementFactory.h" />
-    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementTypeChecks.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementTypeHelpers.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGNames.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentStyleSheets.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\WebKitFontFamilyNames.h" />
index 6a71aad..2179ad2 100644 (file)
                B55D5AA4119131FC00BCC315 /* JSSQLTransactionSyncCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */; };
                B55D5AA5119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */; };
                B55D5AA91191325000BCC315 /* JSSQLTransactionSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */; };
-               B562DB6017D3CD630010AF96 /* HTMLElementTypeChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5E17D3CD560010AF96 /* HTMLElementTypeChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               B562DB6117D3CD660010AF96 /* SVGElementTypeChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5F17D3CD560010AF96 /* SVGElementTypeChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               B562DB6117D3CD660010AF96 /* SVGElementTypeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
                B58CEB6911913607002A6790 /* JSDatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6711913607002A6790 /* JSDatabaseSync.h */; };
                B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */; };
                B58CEB6D1191361C002A6790 /* JSSQLTransactionSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */; };
                B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSyncCallback.h; sourceTree = "<group>"; };
                B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCallback.cpp; sourceTree = "<group>"; };
                B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCustom.cpp; sourceTree = "<group>"; };
-               B562DB5E17D3CD560010AF96 /* HTMLElementTypeChecks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTMLElementTypeChecks.h; sourceTree = "<group>"; };
-               B562DB5F17D3CD560010AF96 /* SVGElementTypeChecks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGElementTypeChecks.h; sourceTree = "<group>"; };
+               B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTMLElementTypeHelpers.h; sourceTree = "<group>"; };
+               B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGElementTypeHelpers.h; sourceTree = "<group>"; };
                B58CEB6711913607002A6790 /* JSDatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseSync.h; sourceTree = "<group>"; };
                B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSync.cpp; sourceTree = "<group>"; };
                B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSync.h; sourceTree = "<group>"; };
                                9767CE0A145ABC13005E64DB /* ExceptionInterfaces.h */,
                                A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */,
                                A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */,
-                               B562DB5E17D3CD560010AF96 /* HTMLElementTypeChecks.h */,
+                               B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */,
                                A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */,
                                A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
                                A8D06B370A265DCD005E7203 /* HTMLNames.h */,
                                53EF766A16530A61004CBE49 /* SettingsMacros.h */,
                                656581E609D1508D000E61D7 /* SVGElementFactory.cpp */,
                                656581E709D1508D000E61D7 /* SVGElementFactory.h */,
-                               B562DB5F17D3CD560010AF96 /* SVGElementTypeChecks.h */,
+                               B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */,
                                656581E809D1508D000E61D7 /* SVGNames.cpp */,
                                656581E909D1508D000E61D7 /* SVGNames.h */,
                                656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */,
                                85909CDC0ACC7A7E00DF01F1 /* DOMCSSCharsetRuleInternal.h in Headers */,
                                85032DD90AA8C9BE007D3B7D /* DOMCSSFontFaceRule.h in Headers */,
                                85909CDD0ACC7A7E00DF01F1 /* DOMCSSFontFaceRuleInternal.h in Headers */,
-                               B562DB6117D3CD660010AF96 /* SVGElementTypeChecks.h in Headers */,
+                               B562DB6117D3CD660010AF96 /* SVGElementTypeHelpers.h in Headers */,
                                85032DDB0AA8C9BE007D3B7D /* DOMCSSImportRule.h in Headers */,
                                85909CDE0ACC7A7E00DF01F1 /* DOMCSSImportRuleInternal.h in Headers */,
                                85032DDD0AA8C9BE007D3B7D /* DOMCSSMediaRule.h in Headers */,
                                8C0E334F138A92C7008DA94F /* LevelDBWriteBatch.h in Headers */,
                                84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
                                B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
-                               B562DB6017D3CD630010AF96 /* HTMLElementTypeChecks.h in Headers */,
+                               B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */,
                                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
                                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
                                89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */,
index d43acff..b8bc99a 100755 (executable)
@@ -155,14 +155,14 @@ die "You must specify a namespaceURI (e.g. http://www.w3.org/2000/svg)" unless $
 $parameters{namespacePrefix} = $parameters{namespace} unless $parameters{namespacePrefix};
 $parameters{fallbackJSInterfaceName} = $parameters{fallbackInterfaceName} unless $parameters{fallbackJSInterfaceName};
 
-my $typeChecksBasePath = "$outputDir/$parameters{namespace}ElementTypeChecks";
+my $typeHelpersBasePath = "$outputDir/$parameters{namespace}ElementTypeHelpers";
 my $namesBasePath = "$outputDir/$parameters{namespace}Names";
 my $factoryBasePath = "$outputDir/$parameters{namespace}ElementFactory";
 my $wrapperFactoryFileName = "$parameters{namespace}ElementWrapperFactory";
 
 printNamesHeaderFile("$namesBasePath.h");
 printNamesCppFile("$namesBasePath.cpp");
-printTypeChecksHeaderFile("$typeChecksBasePath.h");
+printTypeHelpersHeaderFile("$typeHelpersBasePath.h");
 
 if ($printFactory) {
     printFactoryCppFile("$factoryBasePath.cpp");
@@ -190,7 +190,7 @@ sub defaultTagPropertyHash
         'conditional' => 0,
         'contextConditional' => 0,
         'runtimeConditional' => 0,
-        'generateTypeChecks' => 0
+        'generateTypeHelpers' => 0
     );
 }
 
@@ -616,42 +616,45 @@ sub printLicenseHeader
 ";
 }
 
-sub printTypeChecks
+sub printTypeHelpers
 {
     my ($F, $namesRef) = @_;
     my %names = %$namesRef;
 
     for my $name (sort keys %names) {
-        if (!$parsedTags{$name}{generateTypeChecks}) {
+        if (!$parsedTags{$name}{generateTypeHelpers}) {
             next;
         }
 
         my $class = $parsedTags{$name}{interfaceName};
-        my $helper = "is$class";
+        my $checkHelper = "is$class";
+        my $castingHelper = "to$class";
 
         print F "class $class;\n";
-        print F "inline bool $helper(const Element& element) { return element.hasTagName(".$parameters{namespace}."Names::".$name."Tag); }\n";
-        print F "inline bool $helper(const Element* element) { ASSERT(element); return $helper(*element); }\n";
-        print F "inline bool $helper(const Node* node) { ASSERT(node); return node->isElementNode() && $helper(toElement(node)); }\n";
-        print F "template <> inline bool isElementOfType<$class>(const Element* element) { return $helper(element); }\n";
+        print F "inline bool $checkHelper(const Element& element) { return element.hasTagName(".$parameters{namespace}."Names::".$name."Tag); }\n";
+        print F "inline bool $checkHelper(const Element* element) { ASSERT(element); return $checkHelper(*element); }\n";
+        print F "inline bool $checkHelper(const Node* node) { ASSERT(node); return node->isElementNode() && $checkHelper(toElement(node)); }\n";
+        print F "template <> inline bool isElementOfType<$class>(const Element* element) { return $checkHelper(element); }\n";
+        print F "inline $class* $castingHelper(Node* node) { ASSERT_WITH_SECURITY_IMPLICATION(!node || $checkHelper(node)); return reinterpret_cast<".$class."*>(node); }\n";
+        print F "inline $class* $castingHelper(Element* element) { ASSERT_WITH_SECURITY_IMPLICATION(!element || $checkHelper(element)); return reinterpret_cast<".$class."*>(element); }\n";
 
         print F "\n";
     }
 }
 
-sub printTypeChecksHeaderFile
+sub printTypeHelpersHeaderFile
 {
     my ($headerPath) = shift;
     my $F;
     open F, ">$headerPath";
     printLicenseHeader($F);
 
-    print F "#ifndef ".$parameters{namespace}."ElementTypeChecks_h\n";
-    print F "#define ".$parameters{namespace}."ElementTypeChecks_h\n\n";
+    print F "#ifndef ".$parameters{namespace}."ElementTypeHelpers_h\n";
+    print F "#define ".$parameters{namespace}."ElementTypeHelpers_h\n\n";
     print F "#include \"".$parameters{namespace}."Names.h\"\n\n";
     print F "namespace WebCore {\n\n";
 
-    printTypeChecks($F, \%allTags);
+    printTypeHelpers($F, \%allTags);
 
     print F "}\n\n";
     print F "#endif\n";
index d4ad69b..64ff0a4 100644 (file)
@@ -149,12 +149,6 @@ inline LinkHash HTMLAnchorElement::visitedLinkHash() const
     return m_cachedVisitedLinkHash; 
 }
 
-inline HTMLAnchorElement* toHTMLAnchorElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAnchorElement(node));
-    return static_cast<HTMLAnchorElement*>(node);
-}
-
 // Functions shared with the other anchor elements (i.e., SVG).
 
 bool isEnterKeyKeydownEvent(Event*);
index d6c2c3d..0e031e3 100644 (file)
@@ -70,12 +70,6 @@ private:
     Shape m_shape;
 };
 
-inline HTMLAreaElement* toHTMLAreaElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAreaElement(node));
-    return static_cast<HTMLAreaElement*>(node);
-}
-
 } //namespace
 
 #endif
index 8153b35..fde628f 100644 (file)
@@ -43,12 +43,6 @@ private:
     HTMLAudioElement(const QualifiedName&, Document*, bool);
 };
 
-inline HTMLAudioElement* toHTMLAudioElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAudioElement(node));
-    return static_cast<HTMLAudioElement*>(node);
-}
-
 } //namespace
 
 #endif
index 2844e92..00b7ac0 100644 (file)
@@ -188,12 +188,6 @@ private:
     mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platforms that have to copy the image buffer to render (and for CSSCanvasValue).
 };
 
-inline const HTMLCanvasElement* toHTMLCanvasElement(const Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLCanvasElement(node));
-    return static_cast<const HTMLCanvasElement*>(node);
-}
-
 // This will catch anyone doing an unnecessary cast.
 void toHTMLCanvasElement(const HTMLCanvasElement*);
 
index 4ff0001..bf52a44 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "StyledElement.h"
 
-#include "HTMLElementTypeChecks.h"
+#include "HTMLElementTypeHelpers.h"
 
 namespace WebCore {
 
index 61a5a4b..26aecb0 100644 (file)
@@ -166,12 +166,6 @@ private:
     bool m_wasDemoted;
 };
 
-inline HTMLFormElement* toHTMLFormElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFormElement(node));
-    return static_cast<HTMLFormElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // HTMLFormElement_h
index ac2a99d..a87c6cd 100644 (file)
@@ -100,18 +100,6 @@ private:
     bool m_noresize;
 };
 
-inline HTMLFrameSetElement* toHTMLFrameSetElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
-    return static_cast<HTMLFrameSetElement*>(node);
-}
-
-inline const HTMLFrameSetElement* toHTMLFrameSetElement(const Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
-    return static_cast<const HTMLFrameSetElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // HTMLFrameSetElement_h
index 248e6c2..3f90c87 100644 (file)
@@ -115,12 +115,6 @@ private:
     AtomicString m_bestFitImageURL;
 };
 
-inline HTMLImageElement* toHTMLImageElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLImageElement(node));
-    return static_cast<HTMLImageElement*>(node);
-}
-
 } //namespace
 
 #endif
index 1d787b7..2300924 100644 (file)
@@ -443,17 +443,5 @@ private:
 #endif
 };
 
-inline HTMLInputElement* toHTMLInputElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLInputElement(node));
-    return static_cast<HTMLInputElement*>(node);
-}
-
-inline const HTMLInputElement* toHTMLInputElement(const Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLInputElement(node));
-    return static_cast<const HTMLInputElement*>(node);
-}
-
 } //namespace
 #endif
index 90a3691..3e6debe 100644 (file)
@@ -55,12 +55,6 @@ private:
     virtual void focus(bool restorePreviousSelection, FocusDirection) OVERRIDE;
 };
 
-inline HTMLLabelElement* toHTMLLabelElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLLabelElement(node));
-    return static_cast<HTMLLabelElement*>(node);
-}
-
 } //namespace
 
 #endif
index 8f62741..5167b11 100644 (file)
@@ -54,12 +54,6 @@ private:
     AtomicString m_name;
 };
 
-inline HTMLMapElement* toHTMLMapElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLMapElement(node));
-    return static_cast<HTMLMapElement*>(node);
-}
-
-} //namespace
+} // namespaces
 
 #endif
index ce74607..c6bc04d 100644 (file)
@@ -82,12 +82,6 @@ private:
     RefPtr<MeterValueElement> m_value;
 };
 
-inline HTMLMeterElement* toHTMLMeterElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLMeterElement(node));
-    return static_cast<HTMLMeterElement*>(node);
-}
-
 } // namespace
 
 #endif
index 330eb71..df901ea 100644 (file)
@@ -63,12 +63,6 @@ private:
     RefPtr<RenderStyle> m_style;
 };
 
-inline HTMLOptGroupElement* toHTMLOptGroupElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLOptGroupElement(node));
-    return static_cast<HTMLOptGroupElement*>(node);
-}
-
 } //namespace
 
 #endif
index 2762dbe..6583353 100644 (file)
@@ -95,12 +95,6 @@ private:
     RefPtr<RenderStyle> m_style;
 };
 
-inline HTMLOptionElement* toHTMLOptionElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLOptionElement(node));
-    return static_cast<HTMLOptionElement*>(node);
-}
-
 } // namespace
 
 #endif
index 39ff23d..49c6ac0 100644 (file)
@@ -69,12 +69,6 @@ private:
     ProgressValueElement* m_value;
 };
 
-inline HTMLProgressElement* toHTMLProgressElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLProgressElement(node));
-    return static_cast<HTMLProgressElement*>(node);
-}
-
 } // namespace
 
 #endif
index e33d158..a7878e1 100644 (file)
@@ -67,12 +67,6 @@ private:
     virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren();
 };
 
-inline HTMLScriptElement* toHTMLScriptElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::scriptTag));
-    return static_cast<HTMLScriptElement*>(node);
-}
-
 } //namespace
 
 #endif
index 920dea5..5d68801 100644 (file)
@@ -93,12 +93,6 @@ private:
     ScopedStyleRegistrationState m_scopedStyleRegistrationState;
 };
 
-inline HTMLStyleElement* toHTMLStyleElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLStyleElement(node));
-    return static_cast<HTMLStyleElement*>(node);
-}
-
 } //namespace
 
 #endif
index 0d76ab5..c47f181 100644 (file)
@@ -100,12 +100,6 @@ private:
     RefPtr<StylePropertySet> m_sharedCellStyle;
 };
 
-inline HTMLTableElement* toHTMLTableElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTableElement(node));
-    return static_cast<HTMLTableElement*>(node);
-}
-
 } //namespace
 
 #endif
index 53ef4f3..b9e2ba5 100644 (file)
@@ -51,12 +51,6 @@ private:
     HTMLTableRowElement(const QualifiedName&, Document*);
 };
 
-inline HTMLTableRowElement* toHTMLTableRowElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTableRowElement(node));
-    return static_cast<HTMLTableRowElement*>(node);
-}
-
 } // namespace
 
 #endif
index 4661524..a53031e 100644 (file)
@@ -3,17 +3,17 @@ namespacePrefix="xhtml"
 namespaceURI="http://www.w3.org/1999/xhtml"
 fallbackInterfaceName="HTMLUnknownElement"
 
-a interfaceName=HTMLAnchorElement, generateTypeChecks
+a interfaceName=HTMLAnchorElement, generateTypeHelpers
 abbr interfaceName=HTMLElement
 acronym interfaceName=HTMLElement
 address interfaceName=HTMLElement
 applet constructorNeedsCreatedByParser
-area generateTypeChecks
+area generateTypeHelpers
 article interfaceName=HTMLElement
 aside interfaceName=HTMLElement
-audio wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser, generateTypeChecks
+audio wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser, generateTypeHelpers
 b interfaceName=HTMLElement
-base generateTypeChecks
+base generateTypeHelpers
 basefont interfaceName=HTMLBaseFontElement
 bdi interfaceName=HTMLBDIElement, JSInterfaceName=HTMLElement
 bdo interfaceName=HTMLElement
@@ -23,7 +23,7 @@ blockquote interfaceName=HTMLQuoteElement
 body
 br interfaceName=HTMLBRElement
 button constructorNeedsFormElement
-canvas generateTypeChecks
+canvas generateTypeHelpers
 caption interfaceName=HTMLTableCaptionElement
 center interfaceName=HTMLElement
 cite interfaceName=HTMLElement
@@ -44,14 +44,14 @@ dl interfaceName=HTMLDListElement
 dt interfaceName=HTMLElement
 em interfaceName=HTMLElement
 embed constructorNeedsCreatedByParser
-fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement, generateTypeChecks
+fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement, generateTypeHelpers
 figcaption interfaceName=HTMLElement
 figure interfaceName=HTMLElement
 font
 footer interfaceName=HTMLElement
-form generateTypeChecks
+form generateTypeHelpers
 frame
-frameset interfaceName=HTMLFrameSetElement, generateTypeChecks
+frameset interfaceName=HTMLFrameSetElement, generateTypeHelpers
 h1 interfaceName=HTMLHeadingElement
 h2 interfaceName=HTMLHeadingElement
 h3 interfaceName=HTMLHeadingElement
@@ -66,25 +66,25 @@ html
 i interfaceName=HTMLElement
 iframe interfaceName=HTMLIFrameElement
 image interfaceName=HTMLElement
-img interfaceName=HTMLImageElement, constructorNeedsFormElement, generateTypeChecks
-input constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeChecks
+img interfaceName=HTMLImageElement, constructorNeedsFormElement, generateTypeHelpers
+input constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeHelpers
 ins interfaceName=HTMLModElement
 isindex interfaceName=HTMLUnknownElement
 kbd interfaceName=HTMLElement
 keygen constructorNeedsFormElement
-label generateTypeChecks
+label generateTypeHelpers
 layer interfaceName=HTMLElement
-legend generateTypeChecks
+legend generateTypeHelpers
 li interfaceName=HTMLLIElement
 link constructorNeedsCreatedByParser
 listing interfaceName=HTMLPreElement
 main interfaceName=HTMLElement
-map generateTypeChecks
+map generateTypeHelpers
 mark interfaceName=HTMLElement
 marquee
 menu
 meta
-meter interfaceName=HTMLMeterElement, conditional=METER_ELEMENT, generateTypeChecks
+meter interfaceName=HTMLMeterElement, conditional=METER_ELEMENT, generateTypeHelpers
 nav interfaceName=HTMLElement
 nobr interfaceName=HTMLElement
 noembed interfaceName=HTMLElement
@@ -92,43 +92,43 @@ noframes interfaceName=HTMLElement
 nolayer interfaceName=HTMLElement
 object constructorNeedsFormElement, constructorNeedsCreatedByParser
 ol interfaceName=HTMLOListElement
-optgroup interfaceName=HTMLOptGroupElement, generateTypeChecks
-option generateTypeChecks
+optgroup interfaceName=HTMLOptGroupElement, generateTypeHelpers
+option generateTypeHelpers
 output constructorNeedsFormElement
 p interfaceName=HTMLParagraphElement
-param generateTypeChecks
+param generateTypeHelpers
 plaintext interfaceName=HTMLElement
 pre
-progress interfaceName=HTMLProgressElement, conditional=PROGRESS_ELEMENT, generateTypeChecks
+progress interfaceName=HTMLProgressElement, conditional=PROGRESS_ELEMENT, generateTypeHelpers
 q interfaceName=HTMLQuoteElement
 rp interfaceName=HTMLElement
 rt interfaceName=HTMLElement
 ruby interfaceName=HTMLElement
 s interfaceName=HTMLElement
 samp interfaceName=HTMLElement
-script constructorNeedsCreatedByParser, generateTypeChecks
+script constructorNeedsCreatedByParser, generateTypeHelpers
 section interfaceName=HTMLElement
 select constructorNeedsFormElement
 small interfaceName=HTMLElement
-source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, generateTypeChecks
+source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, generateTypeHelpers
 span
 strike interfaceName=HTMLElement
 strong interfaceName=HTMLElement
-style constructorNeedsCreatedByParser, generateTypeChecks
+style constructorNeedsCreatedByParser, generateTypeHelpers
 sub interfaceName=HTMLElement
 summary interfaceName=HTMLSummaryElement, JSInterfaceName=HTMLElement, conditional=DETAILS_ELEMENT
 sup interfaceName=HTMLElement
-table generateTypeChecks
+table generateTypeHelpers
 tbody interfaceName=HTMLTableSectionElement
 td interfaceName=HTMLTableCellElement
 template conditional=TEMPLATE_ELEMENT
-textarea interfaceName=HTMLTextAreaElement, constructorNeedsFormElement, generateTypeChecks
+textarea interfaceName=HTMLTextAreaElement, constructorNeedsFormElement, generateTypeHelpers
 tfoot interfaceName=HTMLTableSectionElement
 th interfaceName=HTMLTableCellElement
 thead interfaceName=HTMLTableSectionElement
-title generateTypeChecks
-tr interfaceName=HTMLTableRowElement, generateTypeChecks
-track wrapperOnlyIfMediaIsAvailable, conditional=VIDEO_TRACK, generateTypeChecks
+title generateTypeHelpers
+tr interfaceName=HTMLTableRowElement, generateTypeHelpers
+track wrapperOnlyIfMediaIsAvailable, conditional=VIDEO_TRACK, generateTypeHelpers
 tt interfaceName=HTMLElement
 u interfaceName=HTMLElement
 ul interfaceName=HTMLUListElement
index 6755118..38d96d5 100644 (file)
@@ -127,12 +127,6 @@ private:
     mutable bool m_wasModifiedByUser;
 };
 
-inline HTMLTextAreaElement* toHTMLTextAreaElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTextAreaElement(node));
-    return static_cast<HTMLTextAreaElement*>(node);
-}
-
 } //namespace
 
 #endif
index b694e36..bd0589a 100644 (file)
@@ -46,12 +46,6 @@ private:
     StringWithDirection m_title;
 };
 
-inline HTMLTitleElement* toHTMLTitleElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTitleElement(node));
-    return static_cast<HTMLTitleElement*>(node);
-}
-
 } //namespace
 
 #endif
index b13f025..7591153 100644 (file)
@@ -26,7 +26,7 @@
 #if ENABLE(SVG)
 #include "CSSPropertyNames.h"
 #include "SVGAnimatedString.h"
-#include "SVGElementTypeChecks.h"
+#include "SVGElementTypeHelpers.h"
 #include "SVGLangSpace.h"
 #include "SVGLocatable.h"
 #include "SVGParsingError.h"
index 0681a67..9f8420a 100644 (file)
@@ -27,7 +27,6 @@
 #include "SVGElement.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGGlyphMap.h"
-#include "SVGNames.h"
 #include "SVGParserUtilities.h"
 
 namespace WebCore {
@@ -89,12 +88,6 @@ private:
     bool m_isGlyphCacheValid;
 };
 
-inline SVGFontElement* toSVGFontElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGFontElement(node));
-    return static_cast<SVGFontElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(SVG_FONTS)
index 6e7d8e6..e2e104d 100644 (file)
@@ -24,7 +24,6 @@
 
 #if ENABLE(SVG_FONTS)
 #include "SVGElement.h"
-#include "SVGNames.h"
 
 namespace WebCore {
 
@@ -67,12 +66,6 @@ private:
     SVGFontElement* m_fontElement;
 };
 
-inline SVGFontFaceElement* toSVGFontFaceElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGFontFaceElement(node));
-    return static_cast<SVGFontFaceElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(SVG_FONTS)
index 9134f1b..18315c9 100644 (file)
@@ -28,7 +28,6 @@
 #include "SVGExternalResourcesRequired.h"
 #include "SVGGraphicsElement.h"
 #include "SVGImageLoader.h"
-#include "SVGNames.h"
 #include "SVGURIReference.h"
 
 namespace WebCore {
@@ -77,12 +76,6 @@ private:
     SVGImageLoader m_imageLoader;
 };
 
-inline SVGImageElement* toSVGImageElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGImageElement(node));
-    return static_cast<SVGImageElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
index caa0982..1bbf0e1 100644 (file)
@@ -26,7 +26,6 @@
 #include "SVGAnimatedString.h"
 #include "SVGElement.h"
 #include "SVGExternalResourcesRequired.h"
-#include "SVGNames.h"
 #include "SVGURIReference.h"
 #include "ScriptElement.h"
 
@@ -88,12 +87,6 @@ private:
     Timer<SVGElement> m_svgLoadEventTimer;
 };
 
-inline SVGScriptElement* toSVGScriptElement(Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::scriptTag));
-    return static_cast<SVGScriptElement*>(node);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
index c406311..bc940db 100644 (file)
@@ -53,21 +53,21 @@ feTurbulence
 filter
 #endif
 #if ENABLE_SVG_FONTS
-font generateTypeChecks
-font_face generateTypeChecks
+font generateTypeHelpers
+font_face generateTypeHelpers
 font_face_format
 font_face_name
 font_face_src
 font_face_uri
 #endif
-foreignObject generateTypeChecks
+foreignObject generateTypeHelpers
 g
 #if ENABLE_SVG_FONTS
 glyph
 glyphRef
 hkern interfaceName=SVGHKernElement
 #endif
-image generateTypeChecks
+image generateTypeHelpers
 line
 linearGradient
 marker
@@ -83,7 +83,7 @@ polygon
 polyline
 radialGradient
 rect
-script constructorNeedsCreatedByParser, generateTypeChecks
+script constructorNeedsCreatedByParser, generateTypeHelpers
 stop
 style constructorNeedsCreatedByParser
 svg interfaceName=SVGSVGElement