Generate isFooElement() functions from tagname data.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 20:10:11 +0000 (20:10 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 20:10:11 +0000 (20:10 +0000)
commit7264285e3f868826720c75a42d68d11ee7d4c36b
treebab1d5cb74737bc4060c3513a2c52c06a2bb7197
parent192c39eb2aef100579e91787b42ffe75d0aa29c1
Generate isFooElement() functions from tagname data.
<https://webkit.org/b/120584>

Reviewed by Antti Koivisto.

Add a "generateTypeChecks" attribute that can be used in HTMLTagNames.in & friends.
If present, isFooElement() style helpers will be added to HTMLElementTypeChecks.h.
This also outputs an isElementOfType<T> check for the Element iterators.

Removed all the hand-written isFooElement() functions that only checked tag name.

* html/HTMLTagNames.in:
* svg/svgtags.in:

    Added "generateTypeChecks" attribute as appropriate.

* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:

    Added to build systems based on how HTMLNames.h was done.
    We're just outputting an additional header file in the generated code directory
    so I suspect most ports will just pick this up automagically.

* dom/make_names.pl:
(defaultTagPropertyHash):
(printLicenseHeader):
(printTypeChecks):
(printTypeChecksHeaderFile):

    Generate a separate file for each namespace with isFooElement() helpers for
    elements with "generateTypeChecks" attribute set.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 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/HTMLBaseElement.h
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFieldSetElement.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/HTMLLegendElement.h
Source/WebCore/html/HTMLMapElement.h
Source/WebCore/html/HTMLMeterElement.h
Source/WebCore/html/HTMLOptGroupElement.h
Source/WebCore/html/HTMLOptionElement.h
Source/WebCore/html/HTMLParamElement.h
Source/WebCore/html/HTMLProgressElement.h
Source/WebCore/html/HTMLScriptElement.h
Source/WebCore/html/HTMLSourceElement.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/html/HTMLTrackElement.h
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGFontElement.h
Source/WebCore/svg/SVGFontFaceElement.h
Source/WebCore/svg/SVGForeignObjectElement.h
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGScriptElement.h
Source/WebCore/svg/svgtags.in