LayoutTests/ChangeLog

 12011-08-10 Tom Zakrajsek <tomz@codeaurora.org>
 2
 3 Created tests for HTMLUnknownElement interface.
 4 https://bugs.webkit.org/show_bug.cgi?id=41841.
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/dom/prototype-inheritance-expected.txt:
 9 * fast/html/unknown-tag.html: Added.
 10 * platform/chromium/fast/dom/prototype-inheritance-expected.txt:
 11 * platform/gtk/fast/dom/prototype-inheritance-expected.txt:
 12 * platform/qt/fast/dom/prototype-inheritance-expected.txt:
 13 * platform/win/fast/dom/prototype-inheritance-expected.txt:
 14
1152011-08-10 Abhishek Arya <inferno@chromium.org>
216
317 Tests that we do not crash when trying to access a removed

LayoutTests/fast/dom/prototype-inheritance-expected.txt

@@PASS inner.HTMLTitleElement.isInner is true
241241PASS inner.HTMLTitleElement.constructor.isInner is true
242242PASS inner.HTMLUListElement.isInner is true
243243PASS inner.HTMLUListElement.constructor.isInner is true
 244PASS inner.HTMLUnknownElement.isInner is true
 245PASS inner.HTMLUnknownElement.constructor.isInner is true
244246PASS inner.HTMLVideoElement.isInner is true
245247PASS inner.HTMLVideoElement.constructor.isInner is true
246248PASS inner.HashChangeEvent.isInner is true

LayoutTests/fast/html/unknown-tag.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
 5<script src="../../fast/js/resources/js-test-pre.js"></script>
 6</head>
 7<body>
 8 Test HTMLUnknownElement
 9 <p>
 10 This test verifies the following:
 11 <ol>
 12 <li>The <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlunknownelement">HTMLUnknownElement</a></code>
 13 interface is used for HTML elements that are not defined by the HTML5
 14 specification (or other applicable specifications).
 15 <li>The <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlunknownelement">HTMLUnknownElement</a></code>
 16 interface is <b>not</b> used for HTML elements that <b>are</b> defined
 17 by the HTML5 specification (or other applicable specifications).
 18 </ol>
 19 </p>
 20 </p>
 21 <div id="console"></div>
 22
 23 <b></b>
 24 <foo1></foo1>
 25 <foo2></foo2>
 26
 27 <font></font>
 28 <h1></h1>
 29 <table></table>
 30
 31 <script>
 32// These tags are required by the HTML spec
 33var validTags = ["div", "font", "h1", "table"];
 34
 35// These tags are manufactured and should not be recognized by any browser
 36var bogusTags = ["foo1", "foo2"];
 37
 38var allTags = validTags.concat(bogusTags);
 39
 40function isBogusTag (tag) {
 41 for (var k in bogusTags) {
 42 var bogusTag = bogusTags[k];
 43 if (tag == bogusTag) {
 44 return true;
 45 }
 46 }
 47 return false;
 48}
 49
 50var DynamicElements = new Array();
 51
 52for (var k in allTags) {
 53 var tag = allTags[k];
 54 DynamicElements[tag] = document.createElement(tag);
 55}
 56
 57for (var element in DynamicElements) {
 58 shouldBeTrue("DynamicElements[\"" + element + "\"]" + " instanceof HTMLElement");
 59 if (isBogusTag(element)) {
 60 shouldBeTrue("DynamicElements[\"" + element + "\"]" + " instanceof HTMLUnknownElement");
 61 } else {
 62 shouldBeFalse("DynamicElements[\"" + element + "\"]" + " instanceof HTMLUnknownElement");
 63 }
 64}
 65
 66var staticElements = new Array();
 67
 68for (var k in allTags) {
 69 var tag = allTags[k];
 70 staticElements[tag] = document.getElementsByTagName(tag)[0];
 71}
 72
 73for (var staticElement in staticElements) {
 74 if (staticElements[staticElement]) {
 75 if (isBogusTag(staticElement)) {
 76 shouldBeTrue("staticElements[\"" + staticElement + "\"]" + " instanceof HTMLUnknownElement");
 77 } else {
 78 shouldBeFalse("staticElements[\"" + staticElement + "\"]" + " instanceof HTMLUnknownElement");
 79 }
 80 }
 81}
 82
 83var successfullyParsed = true;
 84</script>
 85 <script src="../../fast/js/resources/js-test-post.js"></script>
 86</body>
 87</html>

LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt

@@PASS inner.HTMLTitleElement.isInner is true
241241PASS inner.HTMLTitleElement.constructor.isInner is true
242242PASS inner.HTMLUListElement.isInner is true
243243PASS inner.HTMLUListElement.constructor.isInner is true
 244PASS inner.HTMLUnknownElement.isInner is true
 245PASS inner.HTMLUnknownElement.constructor.isInner is true
244246PASS inner.HTMLVideoElement.isInner is true
245247PASS inner.HTMLVideoElement.constructor.isInner is true
246248PASS inner.HashChangeEvent.isInner is true

LayoutTests/platform/gtk/fast/dom/prototype-inheritance-expected.txt

@@PASS inner.HTMLTitleElement.isInner is true
241241PASS inner.HTMLTitleElement.constructor.isInner is true
242242PASS inner.HTMLUListElement.isInner is true
243243PASS inner.HTMLUListElement.constructor.isInner is true
 244PASS inner.HTMLUnknownElement.isInner is true
 245PASS inner.HTMLUnknownElement.constructor.isInner is true
244246PASS inner.HTMLVideoElement.isInner is true
245247PASS inner.HTMLVideoElement.constructor.isInner is true
246248PASS inner.HashChangeEvent.isInner is true

LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt

@@PASS inner.HTMLTitleElement.isInner is true
241241PASS inner.HTMLTitleElement.constructor.isInner is true
242242PASS inner.HTMLUListElement.isInner is true
243243PASS inner.HTMLUListElement.constructor.isInner is true
 244PASS inner.HTMLUnknownElement.isInner is true
 245PASS inner.HTMLUnknownElement.constructor.isInner is true
244246PASS inner.HTMLVideoElement.isInner is true
245247PASS inner.HTMLVideoElement.constructor.isInner is true
246248PASS inner.HashChangeEvent.isInner is true

LayoutTests/platform/win/fast/dom/prototype-inheritance-expected.txt

@@PASS inner.HTMLTitleElement.isInner is true
239239PASS inner.HTMLTitleElement.constructor.isInner is true
240240PASS inner.HTMLUListElement.isInner is true
241241PASS inner.HTMLUListElement.constructor.isInner is true
 242PASS inner.HTMLUnknownElement.isInner is true
 243PASS inner.HTMLUnknownElement.constructor.isInner is true
242244PASS inner.HTMLVideoElement.isInner is true
243245PASS inner.HTMLVideoElement.constructor.isInner is true
244246PASS inner.HashChangeEvent.isInner is true

Source/WebCore/CMakeLists.txt

@@SET(WebCore_IDL_FILES
268268 html/HTMLTitleElement.idl
269269 html/HTMLTrackElement.idl
270270 html/HTMLUListElement.idl
 271 html/HTMLUnknownElement.idl
271272 html/HTMLVideoElement.idl
272273 html/ImageData.idl
273274 html/MediaError.idl

Source/WebCore/ChangeLog

 12011-08-10 Tom Zakrajsek <tomz@codeaurora.org>
 2
 3 Add HTMLUnknownElement interface as defined in
 4 http://www.w3.org/TR/html5/elements.html#elements-in-the-dom.
 5 https://bugs.webkit.org/show_bug.cgi?id=41841
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Test: fast/html/unknown-tag.html
 10
 11 * CMakeLists.txt:
 12 * CodeGenerators.pri:
 13 * DerivedSources.cpp:
 14 * DerivedSources.make:
 15 * GNUmakefile.list.am:
 16 * WebCore.gypi:
 17 * WebCore.vcproj/WebCore.vcproj:
 18 * WebCore.xcodeproj/project.pbxproj:
 19 * bindings/scripts/CodeGeneratorV8.pm:
 20 (IsDOMNodeType):
 21 * dom/make_names.pl:
 22 (defaultParametersHash):
 23 (buildConstructorMap):
 24 (printJSElementIncludes):
 25 (printElementIncludes):
 26 (printWrapperFunctions):
 27 (printWrapperFactoryCppFile):
 28 * html/HTMLTagNames.in:
 29 * html/HTMLUnknownElement.h: Added.
 30 (WebCore::HTMLUnknownElement::create):
 31 (WebCore::HTMLUnknownElement::HTMLUnknownElement):
 32 * html/HTMLUnknownElement.idl: Added.
 33 * mathml/mathtags.in:
 34 * page/DOMWindow.idl:
 35 * svg/svgtags.in:
 36
1372011-08-10 Abhishek Arya <inferno@chromium.org>
238
339 Check that we do not need layout before trying to dirty

Source/WebCore/CodeGenerators.pri

@@IDL_BINDINGS += \
311311 html/HTMLTitleElement.idl \
312312 html/HTMLTrackElement.idl \
313313 html/HTMLUListElement.idl \
 314 html/HTMLUnknownElement.idl \
314315 html/HTMLVideoElement.idl \
315316 html/ImageData.idl \
316317 html/MediaError.idl \

Source/WebCore/DerivedSources.cpp

204204#include "JSHTMLTableSectionElement.cpp"
205205#include "JSHTMLTextAreaElement.cpp"
206206#include "JSHTMLTitleElement.cpp"
 207#include "JSHTMLUnknownElement.cpp"
207208#include "JSHTMLUListElement.cpp"
208209#include "JSHTMLVideoElement.cpp"
209210#include "JSIDBAny.cpp"

Source/WebCore/DerivedSources.make

@@DOM_CLASSES = \
278278 HTMLTitleElement \
279279 HTMLTrackElement \
280280 HTMLUListElement \
 281 HTMLUnknownElement \
281282 HTMLVideoElement \
282283 IDBAny \
283284 IDBCursor \

Source/WebCore/GNUmakefile.list.am

@@webcore_built_sources += \
325325 DerivedSources/WebCore/JSHTMLTitleElement.h \
326326 DerivedSources/WebCore/JSHTMLTrackElement.cpp \
327327 DerivedSources/WebCore/JSHTMLTrackElement.h \
 328 DerivedSources/WebCore/JSHTMLUnknownElement.cpp \
 329 DerivedSources/WebCore/JSHTMLUnknownElement.h \
328330 DerivedSources/WebCore/JSHTMLUListElement.cpp \
329331 DerivedSources/WebCore/JSHTMLUListElement.h \
330332 DerivedSources/WebCore/JSHTMLVideoElement.cpp \

@@webcore_sources += \
17891791 Source/WebCore/html/HTMLTitleElement.h \
17901792 Source/WebCore/html/HTMLTrackElement.cpp \
17911793 Source/WebCore/html/HTMLTrackElement.h \
 1794 Source/WebCore/html/HTMLUnknownElement.h \
17921795 Source/WebCore/html/HTMLUListElement.cpp \
17931796 Source/WebCore/html/HTMLUListElement.h \
17941797 Source/WebCore/html/HTMLVideoElement.cpp \

Source/WebCore/WebCore.gypi

414414 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDocument.h',
415415 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSElement.h',
416416 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLElement.h',
 417 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.h',
417418 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSNode.h',
418419 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSNodeList.h',
419420 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSRange.h',

13111312 'html/HTMLTitleElement.idl',
13121313 'html/HTMLTrackElement.idl',
13131314 'html/HTMLUListElement.idl',
 1315 'html/HTMLUnknownElement.idl',
13141316 'html/HTMLVideoElement.idl',
13151317 'html/ImageData.idl',
13161318 'html/MediaError.idl',

56305632 'html/HTMLTrackElement.h',
56315633 'html/HTMLUListElement.cpp',
56325634 'html/HTMLUListElement.h',
 5635 'html/HTMLUnknownElement.h',
56335636 'html/HTMLVideoElement.cpp',
56345637 'html/HTMLVideoElement.h',
56355638 'html/HTMLViewSourceDocument.cpp',

74947497 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLTitleElement.h',
74957498 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUListElement.cpp',
74967499 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUListElement.h',
 7500 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.cpp',
 7501 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.h',
74977502 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLVideoElement.cpp',
74987503 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLVideoElement.h',
74997504 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHashChangeEvent.cpp',

Source/WebCore/WebCore.vcproj/WebCore.vcproj

66586658 </FileConfiguration>
66596659 </File>
66606660 <File
 6661 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.cpp"
 6662 >
 6663 <FileConfiguration
 6664 Name="Debug|Win32"
 6665 ExcludedFromBuild="true"
 6666 >
 6667 <Tool
 6668 Name="VCCLCompilerTool"
 6669 />
 6670 </FileConfiguration>
 6671 <FileConfiguration
 6672 Name="Release|Win32"
 6673 ExcludedFromBuild="true"
 6674 >
 6675 <Tool
 6676 Name="VCCLCompilerTool"
 6677 />
 6678 </FileConfiguration>
 6679 <FileConfiguration
 6680 Name="Debug_Cairo_CFLite|Win32"
 6681 ExcludedFromBuild="true"
 6682 >
 6683 <Tool
 6684 Name="VCCLCompilerTool"
 6685 />
 6686 </FileConfiguration>
 6687 <FileConfiguration
 6688 Name="Release_Cairo_CFLite|Win32"
 6689 ExcludedFromBuild="true"
 6690 >
 6691 <Tool
 6692 Name="VCCLCompilerTool"
 6693 />
 6694 </FileConfiguration>
 6695 <FileConfiguration
 6696 Name="Debug_All|Win32"
 6697 ExcludedFromBuild="true"
 6698 >
 6699 <Tool
 6700 Name="VCCLCompilerTool"
 6701 />
 6702 </FileConfiguration>
 6703 <FileConfiguration
 6704 Name="Production|Win32"
 6705 ExcludedFromBuild="true"
 6706 >
 6707 <Tool
 6708 Name="VCCLCompilerTool"
 6709 />
 6710 </FileConfiguration>
 6711 </File>
 6712 <File
66616713 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElement.h"
66626714 >
66636715 </File>
66646716 <File
 6717 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.h"
 6718 >
 6719 </File>
 6720 <File
66656721 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElementWrapperFactory.cpp"
66666722 >
66676723 <FileConfiguration

67146770 </FileConfiguration>
67156771 </File>
67166772 <File
6717  RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElementWrapperFactory.h"
 6773 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.h"
 6774 >
 6775 </File>
 6776 <File RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElementWrapperFactory.h"
67186777 >
67196778 </File>
67206779 <File

Source/WebCore/WebCore.xcodeproj/project.pbxproj

16711671 6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */; };
16721672 6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */; };
16731673 6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */; };
 1674 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */; };
 1675 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; };
16741676 6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */; };
16751677 6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */; };
16761678 6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */; };

83028304 6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
83038305 6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLGetInfo.cpp; path = canvas/WebGLGetInfo.cpp; sourceTree = "<group>"; };
83048306 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLGetInfo.h; path = canvas/WebGLGetInfo.h; sourceTree = "<group>"; };
 8307 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLUnknownElement.cpp; sourceTree = "<group>"; };
 8308 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLUnknownElement.h; sourceTree = "<group>"; };
83058309 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CanvasContextAttributes.cpp; path = canvas/CanvasContextAttributes.cpp; sourceTree = "<group>"; };
83068310 6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanvasContextAttributes.h; path = canvas/CanvasContextAttributes.h; sourceTree = "<group>"; };
83078311 6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLContextAttributes.cpp; path = canvas/WebGLContextAttributes.cpp; sourceTree = "<group>"; };

1685016854 A80E7B020A19D606007FB8C5 /* JSHTMLTitleElement.h */,
1685116855 1A85B20E0A1B258700D8C87C /* JSHTMLUListElement.cpp */,
1685216856 1A85B20F0A1B258700D8C87C /* JSHTMLUListElement.h */,
 16857 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */,
 16858 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */,
1685316859 E446140E0CD6826900FADA75 /* JSHTMLVideoElement.cpp */,
1685416860 E446140F0CD6826900FADA75 /* JSHTMLVideoElement.h */,
1685516861 A77979240D6B9E64003851B9 /* JSImageData.cpp */,

2198821994 A80E7E9D0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h in Headers */,
2198921995 A80E7B0C0A19D606007FB8C5 /* JSHTMLTitleElement.h in Headers */,
2199021996 1A85B2110A1B258700D8C87C /* JSHTMLUListElement.h in Headers */,
 21997 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */,
2199121998 E44614170CD6826900FADA75 /* JSHTMLVideoElement.h in Headers */,
2199221999 C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */,
2199322000 81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */,

2496624973 A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */,
2496724974 A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
2496824975 1A85B2100A1B258700D8C87C /* JSHTMLUListElement.cpp in Sources */,
 24976 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */,
2496924977 E44614160CD6826900FADA75 /* JSHTMLVideoElement.cpp in Sources */,
2497024978 C585A67C11D4FB08004C3E4B /* JSIDBAny.cpp in Sources */,
2497124979 C585A65E11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp in Sources */,

Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

@@sub IsDOMNodeType
31803180 return 1 if $type eq 'HTMLCanvasElement';
31813181 return 1 if $type eq 'HTMLDocument';
31823182 return 1 if $type eq 'HTMLElement';
 3183 return 1 if $type eq 'HTMLUnknownElement';
31833184 return 1 if $type eq 'HTMLFormElement';
31843185 return 1 if $type eq 'HTMLTableCaptionElement';
31853186 return 1 if $type eq 'HTMLTableSectionElement';

Source/WebCore/dom/make_names.pl

@@sub defaultParametersHash
146146 'namespaceURI' => '',
147147 'guardFactoryWith' => '',
148148 'tagsNullNamespace' => 0,
149  'attrsNullNamespace' => 0
 149 'attrsNullNamespace' => 0,
 150 'fallbackInterfaceName' => ''
150151 );
151152}
152153

@@sub usesDefaultWrapper
268269 return $tagName eq $parameters{namespace} . "Element";
269270}
270271
271 # Build a direct mapping from the tags to the Element to create, excluding
272 # Element that have not constructor.
 272# Build a direct mapping from the tags to the Element to create.
273273sub buildConstructorMap
274274{
275275 my %tagConstructorMap = ();
276276 for my $tagName (keys %enabledTags) {
277277 my $interfaceName = $enabledTags{$tagName}{interfaceName};
278  next if (usesDefaultWrapper($interfaceName));
279278
280279 if ($enabledTags{$tagName}{mapToTagName}) {
281280 die "Cannot handle multiple mapToTagName for $tagName\n" if $enabledTags{$enabledTags{$tagName}{mapToTagName}}{mapToTagName};

@@sub printJSElementIncludes
605604
606605 print F "#include \"${wrapperFactoryType}${JSInterfaceName}.h\"\n";
607606 }
 607 print F "#include \"${wrapperFactoryType}$parameters{fallbackInterfaceName}.h\"\n";
608608}
609609
610610sub printElementIncludes

@@sub printElementIncludes
623623
624624 print F "#include \"${interfaceName}.h\"\n";
625625 }
 626 print F "#include \"$parameters{fallbackInterfaceName}.h\"\n";
626627}
627628
628629sub printConditionalElementIncludes

@@printFunctionInits($F, \%tagConstructorMap);
762763
763764print F "}\n";
764765
 766
765767print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}ElementFactory::create$parameters{namespace}Element(const QualifiedName& qName, Document* document";
766768print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
767769print F ", bool createdByParser)\n{\n";

@@if ($parameters{namespace} eq "HTML") {
798800 print F " return function(qName, document, createdByParser);\n";
799801}
800802
801 print F " return $parameters{namespace}Element::create(qName, document);\n";
 803print F " return $parameters{fallbackInterfaceName}::create(qName, document);\n";
802804
803805print F <<END
804806}

@@sub printWrapperFunctions
885887 for my $tagName (sort keys %enabledTags) {
886888 # Avoid defining the same wrapper method twice.
887889 my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};
888  next if defined($tagsSeen{$JSInterfaceName}) || usesDefaultJSWrapper($tagName);
 890 next if defined($tagsSeen{$JSInterfaceName}) || (usesDefaultJSWrapper($tagName) && ($parameters{fallbackInterfaceName} eq $parameters{namespace} . "Element"));
889891 $tagsSeen{$JSInterfaceName} = 1;
890892
891893 my $conditional = $enabledTags{$tagName}{conditional};

@@static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespa
932934
933935END
934936;
935  } else {
 937 } elsif (${JSInterfaceName} eq "HTMLElement") {
 938 print F <<END
 939static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
 940{
 941 return V8$parameters{namespace}Element::wrap(element);
 942}
 943
 944END
 945;
 946 } else {
936947 print F <<END
937948static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
938949{

@@END
10461057
10471058 for my $tag (sort keys %enabledTags) {
10481059 # Do not add the name to the map if it does not have a JS wrapper constructor or uses the default wrapper.
1049  next if usesDefaultJSWrapper($tag, \%enabledTags);
 1060 next if (usesDefaultJSWrapper($tag, \%enabledTags) && ($parameters{fallbackInterfaceName} eq $parameters{namespace} . "Element"));
10501061
10511062 my $conditional = $enabledTags{$tag}{conditional};
10521063 if ($conditional) {

@@END
10711082 if ($wrapperFactoryType eq "JS") {
10721083 print F <<END
10731084 return createWrapperFunction(exec, globalObject, element);
1074  return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
 1085 return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{fallbackInterfaceName}, element.get());
10751086END
10761087;
10771088 } elsif ($wrapperFactoryType eq "V8") {
10781089 print F <<END
10791090 return createWrapperFunction(element);
1080  return V8$parameters{namespace}Element::wrap(element, forceNewObject);
 1091 return V8$parameters{fallbackInterfaceName}::wrap(static_cast<$parameters{fallbackInterfaceName}*>(element), forceNewObject);
10811092END
10821093;
10831094 }

Source/WebCore/html/HTMLTagNames.in

11namespace="HTML"
22namespacePrefix="xhtml"
33namespaceURI="http://www.w3.org/1999/xhtml"
 4fallbackInterfaceName="HTMLUnknownElement"
45
56a interfaceName=HTMLAnchorElement
67abbr interfaceName=HTMLElement

Source/WebCore/html/HTMLUnknownElement.h

 1/*
 2 * Copyright (c) 2011 Code Aurora Forum. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 * * Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * * Redistributions in binary form must reproduce the above
 10 * copyright notice, this list of conditions and the following
 11 * disclaimer in the documentation and/or other materials provided
 12 * with the distribution.
 13 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
 14 * contributors may be used to endorse or promote products derived
 15 * from this software without specific prior written permission.
 16 *
 17 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 24 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 26 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#ifndef HTMLUnknownElement_h
 31#define HTMLUnknownElement_h
 32
 33#include "HTMLElement.h"
 34
 35namespace WebCore {
 36
 37class HTMLUnknownElement : public HTMLElement {
 38public:
 39 static PassRefPtr<HTMLUnknownElement> create(const QualifiedName& tagName, Document* document)
 40 {
 41 return adoptRef(new HTMLUnknownElement(tagName, document));
 42 }
 43
 44private:
 45 HTMLUnknownElement(const QualifiedName& tagName, Document* document)
 46 : HTMLElement(tagName, document)
 47 {
 48 }
 49};
 50
 51} // namespace
 52
 53#endif

Source/WebCore/html/HTMLUnknownElement.idl

 1/*
 2 * Copyright (c) 2011 Code Aurora Forum. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 * * Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * * Redistributions in binary form must reproduce the above
 10 * copyright notice, this list of conditions and the following
 11 * disclaimer in the documentation and/or other materials provided
 12 * with the distribution.
 13 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
 14 * contributors may be used to endorse or promote products derived
 15 * from this software without specific prior written permission.
 16 *
 17 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 24 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 26 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30module html {
 31
 32 interface HTMLUnknownElement : HTMLElement {
 33 };
 34
 35}

Source/WebCore/mathml/mathtags.in

11namespace="MathML"
22namespaceURI="http://www.w3.org/1998/Math/MathML"
33guardFactoryWith="ENABLE(MATHML)"
 4fallbackInterfaceName="MathMLElement"
45
56math
67mfrac interfaceName=MathMLInlineContainerElement

Source/WebCore/page/DOMWindow.idl

@@module window {
482482
483483 attribute HTMLCollectionConstructor HTMLCollection;
484484 attribute HTMLAllCollectionConstructor HTMLAllCollection;
 485 attribute HTMLUnknownElementConstructor HTMLUnknownElement;
485486
486487 attribute [CustomGetter] HTMLImageElementConstructor Image; // Usable with new operator
487488 attribute [CustomGetter] HTMLOptionElementConstructor Option; // Usable with new operator

Source/WebCore/svg/svgtags.in

11namespace="SVG"
22namespaceURI="http://www.w3.org/2000/svg"
33guardFactoryWith="ENABLE(SVG)"
 4fallbackInterfaceName="SVGElement"
45
56a
67#if ENABLE_SVG_FONTS