Source/WebCore: Add HTMLUnknownElement interface as defined in
http://www.w3.org/TR/html5/elements.html#elements-in-the-dom.
https://bugs.webkit.org/show_bug.cgi?id=41841
Patch by Tom Zakrajsek <tomz@codeaurora.org> on 2011-08-11
Reviewed by Adam Barth.
Test: fast/html/unknown-tag.html
* CMakeLists.txt:
* CodeGenerators.pri:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorV8.pm:
(IsDOMNodeType):
* dom/make_names.pl:
(defaultParametersHash):
(buildConstructorMap):
(printJSElementIncludes):
(printElementIncludes):
(printWrapperFunctions):
(printWrapperFactoryCppFile):
* html/HTMLTagNames.in:
* html/HTMLUnknownElement.h: Added.
(WebCore::HTMLUnknownElement::create):
(WebCore::HTMLUnknownElement::HTMLUnknownElement):
* html/HTMLUnknownElement.idl: Added.
* mathml/mathtags.in:
* page/DOMWindow.idl:
* svg/svgtags.in:
LayoutTests: Created tests for HTMLUnknownElement interface.
https://bugs.webkit.org/show_bug.cgi?id=41841.
Patch by Tom Zakrajsek <tomz@codeaurora.org> on 2011-08-11
Reviewed by Adam Barth.
* fast/dom/prototype-inheritance-expected.txt:
* fast/html/unknown-tag.html: Added.
* platform/chromium/fast/dom/prototype-inheritance-expected.txt:
* platform/gtk/fast/dom/prototype-inheritance-expected.txt:
* platform/qt/fast/dom/prototype-inheritance-expected.txt:
* platform/win/fast/dom/prototype-inheritance-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0ef537e..d8d0321 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2011-08-11 Tom Zakrajsek <tomz@codeaurora.org>
+
+ Created tests for HTMLUnknownElement interface.
+ https://bugs.webkit.org/show_bug.cgi?id=41841.
+
+ Reviewed by Adam Barth.
+
+ * fast/dom/prototype-inheritance-expected.txt:
+ * fast/html/unknown-tag.html: Added.
+ * platform/chromium/fast/dom/prototype-inheritance-expected.txt:
+ * platform/gtk/fast/dom/prototype-inheritance-expected.txt:
+ * platform/qt/fast/dom/prototype-inheritance-expected.txt:
+ * platform/win/fast/dom/prototype-inheritance-expected.txt:
+
2011-08-11 Adam Barth <abarth@webkit.org>
pfeldman says we need to rebaseline this test. The massively complex
diff --git a/LayoutTests/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/fast/dom/prototype-inheritance-expected.txt
index 83cecf4..b251774 100644
--- a/LayoutTests/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/fast/dom/prototype-inheritance-expected.txt
@@ -241,6 +241,8 @@
PASS inner.HTMLTitleElement.constructor.isInner is true
PASS inner.HTMLUListElement.isInner is true
PASS inner.HTMLUListElement.constructor.isInner is true
+PASS inner.HTMLUnknownElement.isInner is true
+PASS inner.HTMLUnknownElement.constructor.isInner is true
PASS inner.HTMLVideoElement.isInner is true
PASS inner.HTMLVideoElement.constructor.isInner is true
PASS inner.HashChangeEvent.isInner is true
diff --git a/LayoutTests/fast/html/unknown-tag.html b/LayoutTests/fast/html/unknown-tag.html
new file mode 100644
index 0000000..5816f38
--- /dev/null
+++ b/LayoutTests/fast/html/unknown-tag.html
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+ Test HTMLUnknownElement
+ <p>
+ This test verifies the following:
+ <ol>
+ <li>The <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlunknownelement">HTMLUnknownElement</a></code>
+ interface is used for HTML elements that are not defined by the HTML5
+ specification (or other applicable specifications).
+ <li>The <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlunknownelement">HTMLUnknownElement</a></code>
+ interface is <b>not</b> used for HTML elements that <b>are</b> defined
+ by the HTML5 specification (or other applicable specifications).
+ </ol>
+ </p>
+ </p>
+ <div id="console"></div>
+
+ <b></b>
+ <foo1></foo1>
+ <foo2></foo2>
+
+ <font></font>
+ <h1></h1>
+ <table></table>
+
+ <script>
+// These tags are required by the HTML spec
+var validTags = ["div", "font", "h1", "table"];
+
+// These tags are manufactured and should not be recognized by any browser
+var bogusTags = ["foo1", "foo2"];
+
+var allTags = validTags.concat(bogusTags);
+
+function isBogusTag (tag) {
+ for (var k in bogusTags) {
+ var bogusTag = bogusTags[k];
+ if (tag == bogusTag) {
+ return true;
+ }
+ }
+ return false;
+}
+
+var DynamicElements = new Array();
+
+for (var k in allTags) {
+ var tag = allTags[k];
+ DynamicElements[tag] = document.createElement(tag);
+}
+
+for (var element in DynamicElements) {
+ shouldBeTrue("DynamicElements[\"" + element + "\"]" + " instanceof HTMLElement");
+ if (isBogusTag(element)) {
+ shouldBeTrue("DynamicElements[\"" + element + "\"]" + " instanceof HTMLUnknownElement");
+ } else {
+ shouldBeFalse("DynamicElements[\"" + element + "\"]" + " instanceof HTMLUnknownElement");
+ }
+}
+
+var staticElements = new Array();
+
+for (var k in allTags) {
+ var tag = allTags[k];
+ staticElements[tag] = document.getElementsByTagName(tag)[0];
+}
+
+for (var staticElement in staticElements) {
+ if (staticElements[staticElement]) {
+ if (isBogusTag(staticElement)) {
+ shouldBeTrue("staticElements[\"" + staticElement + "\"]" + " instanceof HTMLUnknownElement");
+ } else {
+ shouldBeFalse("staticElements[\"" + staticElement + "\"]" + " instanceof HTMLUnknownElement");
+ }
+ }
+}
+
+var successfullyParsed = true;
+</script>
+ <script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt
index 5563713..2f65382 100644
--- a/LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt
@@ -241,6 +241,8 @@
PASS inner.HTMLTitleElement.constructor.isInner is true
PASS inner.HTMLUListElement.isInner is true
PASS inner.HTMLUListElement.constructor.isInner is true
+PASS inner.HTMLUnknownElement.isInner is true
+PASS inner.HTMLUnknownElement.constructor.isInner is true
PASS inner.HTMLVideoElement.isInner is true
PASS inner.HTMLVideoElement.constructor.isInner is true
PASS inner.HashChangeEvent.isInner is true
diff --git a/LayoutTests/platform/gtk/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/platform/gtk/fast/dom/prototype-inheritance-expected.txt
index baa6c17..b8b0b86 100644
--- a/LayoutTests/platform/gtk/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/platform/gtk/fast/dom/prototype-inheritance-expected.txt
@@ -241,6 +241,8 @@
PASS inner.HTMLTitleElement.constructor.isInner is true
PASS inner.HTMLUListElement.isInner is true
PASS inner.HTMLUListElement.constructor.isInner is true
+PASS inner.HTMLUnknownElement.isInner is true
+PASS inner.HTMLUnknownElement.constructor.isInner is true
PASS inner.HTMLVideoElement.isInner is true
PASS inner.HTMLVideoElement.constructor.isInner is true
PASS inner.HashChangeEvent.isInner is true
diff --git a/LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt
index 306780c..3cd1ea2 100644
--- a/LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/platform/qt/fast/dom/prototype-inheritance-expected.txt
@@ -241,6 +241,8 @@
PASS inner.HTMLTitleElement.constructor.isInner is true
PASS inner.HTMLUListElement.isInner is true
PASS inner.HTMLUListElement.constructor.isInner is true
+PASS inner.HTMLUnknownElement.isInner is true
+PASS inner.HTMLUnknownElement.constructor.isInner is true
PASS inner.HTMLVideoElement.isInner is true
PASS inner.HTMLVideoElement.constructor.isInner is true
PASS inner.HashChangeEvent.isInner is true
diff --git a/LayoutTests/platform/win/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/platform/win/fast/dom/prototype-inheritance-expected.txt
index 7a40a87..eaf58f5 100644
--- a/LayoutTests/platform/win/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/platform/win/fast/dom/prototype-inheritance-expected.txt
@@ -239,6 +239,8 @@
PASS inner.HTMLTitleElement.constructor.isInner is true
PASS inner.HTMLUListElement.isInner is true
PASS inner.HTMLUListElement.constructor.isInner is true
+PASS inner.HTMLUnknownElement.isInner is true
+PASS inner.HTMLUnknownElement.constructor.isInner is true
PASS inner.HTMLVideoElement.isInner is true
PASS inner.HTMLVideoElement.constructor.isInner is true
PASS inner.HashChangeEvent.isInner is true
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index e6c6900..5cb8c92 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -268,6 +268,7 @@
html/HTMLTitleElement.idl
html/HTMLTrackElement.idl
html/HTMLUListElement.idl
+ html/HTMLUnknownElement.idl
html/HTMLVideoElement.idl
html/ImageData.idl
html/MediaError.idl
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 2cfd3dd..a404e8b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,39 @@
+2011-08-11 Tom Zakrajsek <tomz@codeaurora.org>
+
+ Add HTMLUnknownElement interface as defined in
+ http://www.w3.org/TR/html5/elements.html#elements-in-the-dom.
+ https://bugs.webkit.org/show_bug.cgi?id=41841
+
+ Reviewed by Adam Barth.
+
+ Test: fast/html/unknown-tag.html
+
+ * CMakeLists.txt:
+ * CodeGenerators.pri:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.list.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (IsDOMNodeType):
+ * dom/make_names.pl:
+ (defaultParametersHash):
+ (buildConstructorMap):
+ (printJSElementIncludes):
+ (printElementIncludes):
+ (printWrapperFunctions):
+ (printWrapperFactoryCppFile):
+ * html/HTMLTagNames.in:
+ * html/HTMLUnknownElement.h: Added.
+ (WebCore::HTMLUnknownElement::create):
+ (WebCore::HTMLUnknownElement::HTMLUnknownElement):
+ * html/HTMLUnknownElement.idl: Added.
+ * mathml/mathtags.in:
+ * page/DOMWindow.idl:
+ * svg/svgtags.in:
+
2011-08-11 Levi Weintraub <leviw@chromium.org>
Remove dead code: borderInnerRect
diff --git a/Source/WebCore/CodeGenerators.pri b/Source/WebCore/CodeGenerators.pri
index e582ba8..420e08a 100644
--- a/Source/WebCore/CodeGenerators.pri
+++ b/Source/WebCore/CodeGenerators.pri
@@ -311,6 +311,7 @@
html/HTMLTitleElement.idl \
html/HTMLTrackElement.idl \
html/HTMLUListElement.idl \
+ html/HTMLUnknownElement.idl \
html/HTMLVideoElement.idl \
html/ImageData.idl \
html/MediaError.idl \
diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp
index c56b189..602f87c 100644
--- a/Source/WebCore/DerivedSources.cpp
+++ b/Source/WebCore/DerivedSources.cpp
@@ -204,6 +204,7 @@
#include "JSHTMLTableSectionElement.cpp"
#include "JSHTMLTextAreaElement.cpp"
#include "JSHTMLTitleElement.cpp"
+#include "JSHTMLUnknownElement.cpp"
#include "JSHTMLUListElement.cpp"
#include "JSHTMLVideoElement.cpp"
#include "JSIDBAny.cpp"
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index 26b60ab..6dd728e 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -278,6 +278,7 @@
HTMLTitleElement \
HTMLTrackElement \
HTMLUListElement \
+ HTMLUnknownElement \
HTMLVideoElement \
IDBAny \
IDBCursor \
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index fc60dd3..0e6b205 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -325,6 +325,8 @@
DerivedSources/WebCore/JSHTMLTitleElement.h \
DerivedSources/WebCore/JSHTMLTrackElement.cpp \
DerivedSources/WebCore/JSHTMLTrackElement.h \
+ DerivedSources/WebCore/JSHTMLUnknownElement.cpp \
+ DerivedSources/WebCore/JSHTMLUnknownElement.h \
DerivedSources/WebCore/JSHTMLUListElement.cpp \
DerivedSources/WebCore/JSHTMLUListElement.h \
DerivedSources/WebCore/JSHTMLVideoElement.cpp \
@@ -1789,6 +1791,7 @@
Source/WebCore/html/HTMLTitleElement.h \
Source/WebCore/html/HTMLTrackElement.cpp \
Source/WebCore/html/HTMLTrackElement.h \
+ Source/WebCore/html/HTMLUnknownElement.h \
Source/WebCore/html/HTMLUListElement.cpp \
Source/WebCore/html/HTMLUListElement.h \
Source/WebCore/html/HTMLVideoElement.cpp \
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index 16844b7..095d141 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -414,6 +414,7 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSDocument.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSElement.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLElement.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSNode.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSNodeList.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSRange.h',
@@ -1311,6 +1312,7 @@
'html/HTMLTitleElement.idl',
'html/HTMLTrackElement.idl',
'html/HTMLUListElement.idl',
+ 'html/HTMLUnknownElement.idl',
'html/HTMLVideoElement.idl',
'html/ImageData.idl',
'html/MediaError.idl',
@@ -5630,6 +5632,7 @@
'html/HTMLTrackElement.h',
'html/HTMLUListElement.cpp',
'html/HTMLUListElement.h',
+ 'html/HTMLUnknownElement.h',
'html/HTMLVideoElement.cpp',
'html/HTMLVideoElement.h',
'html/HTMLViewSourceDocument.cpp',
@@ -7494,6 +7497,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLTitleElement.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUListElement.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUListElement.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.cpp',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLUnknownElement.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLVideoElement.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHTMLVideoElement.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSHashChangeEvent.cpp',
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index e5dd3e9..5c7446a 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -6658,10 +6658,66 @@
</FileConfiguration>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElement.h"
>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElementWrapperFactory.cpp"
>
<FileConfiguration
@@ -6714,6 +6770,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLUnknownElement.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSHTMLElementWrapperFactory.h"
>
</File>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 0ba8464..90c78f8 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1671,6 +1671,8 @@
6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */; };
6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */; };
6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */; };
+ 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */; };
+ 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; };
6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */; };
6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */; };
6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */; };
@@ -8302,6 +8304,8 @@
6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLGetInfo.cpp; path = canvas/WebGLGetInfo.cpp; sourceTree = "<group>"; };
6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLGetInfo.h; path = canvas/WebGLGetInfo.h; sourceTree = "<group>"; };
+ 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLUnknownElement.cpp; sourceTree = "<group>"; };
+ 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLUnknownElement.h; sourceTree = "<group>"; };
6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CanvasContextAttributes.cpp; path = canvas/CanvasContextAttributes.cpp; sourceTree = "<group>"; };
6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanvasContextAttributes.h; path = canvas/CanvasContextAttributes.h; sourceTree = "<group>"; };
6E4E91A910F7FB3100A2779C /* WebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLContextAttributes.cpp; path = canvas/WebGLContextAttributes.cpp; sourceTree = "<group>"; };
@@ -16850,6 +16854,8 @@
A80E7B020A19D606007FB8C5 /* JSHTMLTitleElement.h */,
1A85B20E0A1B258700D8C87C /* JSHTMLUListElement.cpp */,
1A85B20F0A1B258700D8C87C /* JSHTMLUListElement.h */,
+ 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */,
+ 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */,
E446140E0CD6826900FADA75 /* JSHTMLVideoElement.cpp */,
E446140F0CD6826900FADA75 /* JSHTMLVideoElement.h */,
A77979240D6B9E64003851B9 /* JSImageData.cpp */,
@@ -21988,6 +21994,7 @@
A80E7E9D0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h in Headers */,
A80E7B0C0A19D606007FB8C5 /* JSHTMLTitleElement.h in Headers */,
1A85B2110A1B258700D8C87C /* JSHTMLUListElement.h in Headers */,
+ 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */,
E44614170CD6826900FADA75 /* JSHTMLVideoElement.h in Headers */,
C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */,
81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */,
@@ -24966,6 +24973,7 @@
A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */,
A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
1A85B2100A1B258700D8C87C /* JSHTMLUListElement.cpp in Sources */,
+ 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */,
E44614160CD6826900FADA75 /* JSHTMLVideoElement.cpp in Sources */,
C585A67C11D4FB08004C3E4B /* JSIDBAny.cpp in Sources */,
C585A65E11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp in Sources */,
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index d6c0fe0..65a068c 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -3180,6 +3180,7 @@
return 1 if $type eq 'HTMLCanvasElement';
return 1 if $type eq 'HTMLDocument';
return 1 if $type eq 'HTMLElement';
+ return 1 if $type eq 'HTMLUnknownElement';
return 1 if $type eq 'HTMLFormElement';
return 1 if $type eq 'HTMLTableCaptionElement';
return 1 if $type eq 'HTMLTableSectionElement';
diff --git a/Source/WebCore/dom/make_names.pl b/Source/WebCore/dom/make_names.pl
index f258e91..6dda719 100755
--- a/Source/WebCore/dom/make_names.pl
+++ b/Source/WebCore/dom/make_names.pl
@@ -146,7 +146,8 @@
'namespaceURI' => '',
'guardFactoryWith' => '',
'tagsNullNamespace' => 0,
- 'attrsNullNamespace' => 0
+ 'attrsNullNamespace' => 0,
+ 'fallbackInterfaceName' => ''
);
}
@@ -268,14 +269,12 @@
return $tagName eq $parameters{namespace} . "Element";
}
-# Build a direct mapping from the tags to the Element to create, excluding
-# Element that have not constructor.
+# Build a direct mapping from the tags to the Element to create.
sub buildConstructorMap
{
my %tagConstructorMap = ();
for my $tagName (keys %enabledTags) {
my $interfaceName = $enabledTags{$tagName}{interfaceName};
- next if (usesDefaultWrapper($interfaceName));
if ($enabledTags{$tagName}{mapToTagName}) {
die "Cannot handle multiple mapToTagName for $tagName\n" if $enabledTags{$enabledTags{$tagName}{mapToTagName}}{mapToTagName};
@@ -605,6 +604,7 @@
print F "#include \"${wrapperFactoryType}${JSInterfaceName}.h\"\n";
}
+ print F "#include \"${wrapperFactoryType}$parameters{fallbackInterfaceName}.h\"\n";
}
sub printElementIncludes
@@ -623,6 +623,7 @@
print F "#include \"${interfaceName}.h\"\n";
}
+ print F "#include \"$parameters{fallbackInterfaceName}.h\"\n";
}
sub printConditionalElementIncludes
@@ -762,6 +763,7 @@
print F "}\n";
+
print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}ElementFactory::create$parameters{namespace}Element(const QualifiedName& qName, Document* document";
print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
print F ", bool createdByParser)\n{\n";
@@ -798,7 +800,7 @@
print F " return function(qName, document, createdByParser);\n";
}
-print F " return $parameters{namespace}Element::create(qName, document);\n";
+print F " return $parameters{fallbackInterfaceName}::create(qName, document);\n";
print F <<END
}
@@ -885,7 +887,7 @@
for my $tagName (sort keys %enabledTags) {
# Avoid defining the same wrapper method twice.
my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};
- next if defined($tagsSeen{$JSInterfaceName}) || usesDefaultJSWrapper($tagName);
+ next if defined($tagsSeen{$JSInterfaceName}) || (usesDefaultJSWrapper($tagName) && ($parameters{fallbackInterfaceName} eq $parameters{namespace} . "Element"));
$tagsSeen{$JSInterfaceName} = 1;
my $conditional = $enabledTags{$tagName}{conditional};
@@ -932,7 +934,16 @@
END
;
- } else {
+ } elsif (${JSInterfaceName} eq "HTMLElement") {
+ print F <<END
+static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
+{
+ return V8$parameters{namespace}Element::wrap(element);
+}
+
+END
+;
+ } else {
print F <<END
static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
{
@@ -1046,7 +1057,7 @@
for my $tag (sort keys %enabledTags) {
# Do not add the name to the map if it does not have a JS wrapper constructor or uses the default wrapper.
- next if usesDefaultJSWrapper($tag, \%enabledTags);
+ next if (usesDefaultJSWrapper($tag, \%enabledTags) && ($parameters{fallbackInterfaceName} eq $parameters{namespace} . "Element"));
my $conditional = $enabledTags{$tag}{conditional};
if ($conditional) {
@@ -1071,13 +1082,13 @@
if ($wrapperFactoryType eq "JS") {
print F <<END
return createWrapperFunction(exec, globalObject, element);
- return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
+ return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{fallbackInterfaceName}, element.get());
END
;
} elsif ($wrapperFactoryType eq "V8") {
print F <<END
return createWrapperFunction(element);
- return V8$parameters{namespace}Element::wrap(element, forceNewObject);
+ return V8$parameters{fallbackInterfaceName}::wrap(static_cast<$parameters{fallbackInterfaceName}*>(element), forceNewObject);
END
;
}
diff --git a/Source/WebCore/html/HTMLTagNames.in b/Source/WebCore/html/HTMLTagNames.in
index 2ea3f38..1e1b24b 100644
--- a/Source/WebCore/html/HTMLTagNames.in
+++ b/Source/WebCore/html/HTMLTagNames.in
@@ -1,6 +1,7 @@
namespace="HTML"
namespacePrefix="xhtml"
namespaceURI="http://www.w3.org/1999/xhtml"
+fallbackInterfaceName="HTMLUnknownElement"
a interfaceName=HTMLAnchorElement
abbr interfaceName=HTMLElement
diff --git a/Source/WebCore/html/HTMLUnknownElement.h b/Source/WebCore/html/HTMLUnknownElement.h
new file mode 100644
index 0000000..b1259c5
--- /dev/null
+++ b/Source/WebCore/html/HTMLUnknownElement.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011 Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HTMLUnknownElement_h
+#define HTMLUnknownElement_h
+
+#include "HTMLElement.h"
+
+namespace WebCore {
+
+class HTMLUnknownElement : public HTMLElement {
+public:
+ static PassRefPtr<HTMLUnknownElement> create(const QualifiedName& tagName, Document* document)
+ {
+ return adoptRef(new HTMLUnknownElement(tagName, document));
+ }
+
+private:
+ HTMLUnknownElement(const QualifiedName& tagName, Document* document)
+ : HTMLElement(tagName, document)
+ {
+ }
+};
+
+} // namespace
+
+#endif
diff --git a/Source/WebCore/html/HTMLUnknownElement.idl b/Source/WebCore/html/HTMLUnknownElement.idl
new file mode 100644
index 0000000..9e4f90a
--- /dev/null
+++ b/Source/WebCore/html/HTMLUnknownElement.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011 Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+
+ interface HTMLUnknownElement : HTMLElement {
+ };
+
+}
diff --git a/Source/WebCore/mathml/mathtags.in b/Source/WebCore/mathml/mathtags.in
index b2dcb93..3a2db35 100644
--- a/Source/WebCore/mathml/mathtags.in
+++ b/Source/WebCore/mathml/mathtags.in
@@ -1,6 +1,7 @@
namespace="MathML"
namespaceURI="http://www.w3.org/1998/Math/MathML"
guardFactoryWith="ENABLE(MATHML)"
+fallbackInterfaceName="MathMLElement"
math
mfrac interfaceName=MathMLInlineContainerElement
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index 62f1c30..4cae763 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -482,6 +482,7 @@
attribute HTMLCollectionConstructor HTMLCollection;
attribute HTMLAllCollectionConstructor HTMLAllCollection;
+ attribute HTMLUnknownElementConstructor HTMLUnknownElement;
attribute [CustomGetter] HTMLImageElementConstructor Image; // Usable with new operator
attribute [CustomGetter] HTMLOptionElementConstructor Option; // Usable with new operator
diff --git a/Source/WebCore/svg/svgtags.in b/Source/WebCore/svg/svgtags.in
index c09572e..bd00eae 100644
--- a/Source/WebCore/svg/svgtags.in
+++ b/Source/WebCore/svg/svgtags.in
@@ -1,6 +1,7 @@
namespace="SVG"
namespaceURI="http://www.w3.org/2000/svg"
guardFactoryWith="ENABLE(SVG)"
+fallbackInterfaceName="SVGElement"
a
#if ENABLE_SVG_FONTS