Bug 844127 - Replaced 'Span' with 'Unknown' and added tests for the same. r=bz

This commit is contained in:
Sunny 2013-03-12 16:36:49 -04:00
parent d78c0220ba
commit c16ed67e12
6 changed files with 60 additions and 19 deletions

View File

@ -343,6 +343,7 @@ MOCHITEST_FILES = \
test_style_attributes_reflection.html \ test_style_attributes_reflection.html \
test_bug629801.html \ test_bug629801.html \
test_bug839371.html \ test_bug839371.html \
test_element_prototype.html \
test_formData.html \ test_formData.html \
$(NULL) $(NULL)

View File

@ -112,7 +112,7 @@ HTML_TAG("aside", "");
HTML_TAG("b", ""); HTML_TAG("b", "");
HTML_TAG("base", "Base"); HTML_TAG("base", "Base");
HTML_TAG("bdo", ""); HTML_TAG("bdo", "");
HTML_TAG("bgsound", "Span"); HTML_TAG("bgsound", "Unknown");
HTML_TAG("big", ""); HTML_TAG("big", "");
HTML_TAG("blink", ""); HTML_TAG("blink", "");
HTML_TAG("blockquote", "Quote"); HTML_TAG("blockquote", "Quote");
@ -159,7 +159,7 @@ HTML_TAG("html", "Html");
HTML_TAG("i", ""); HTML_TAG("i", "");
HTML_TAG("iframe", "IFrame", [ "nsIDOMGetSVGDocument", "nsIDOMMozBrowserFrame" ], HTML_TAG("iframe", "IFrame", [ "nsIDOMGetSVGDocument", "nsIDOMMozBrowserFrame" ],
[ "nsIFrameLoaderOwner" ]); [ "nsIFrameLoaderOwner" ]);
HTML_TAG("image", "Span"); HTML_TAG("image", "");
HTML_TAG("img", "Image", [ "nsIImageLoadingContent" ], []); HTML_TAG("img", "Image", [ "nsIImageLoadingContent" ], []);
HTML_TAG("input", "Input", [], [ "imgINotificationObserver", HTML_TAG("input", "Input", [], [ "imgINotificationObserver",
"nsIImageLoadingContent", "nsIImageLoadingContent",
@ -179,7 +179,7 @@ HTML_TAG("marquee", "Div");
HTML_TAG("menu", "Menu"); HTML_TAG("menu", "Menu");
HTML_TAG("meta", "Meta"); HTML_TAG("meta", "Meta");
HTML_TAG("meter", "Meter"); HTML_TAG("meter", "Meter");
HTML_TAG("multicol", "Span"); HTML_TAG("multicol", "Unknown");
HTML_TAG("nav", "") HTML_TAG("nav", "")
HTML_TAG("nobr", ""); HTML_TAG("nobr", "");
HTML_TAG("noembed", ""); HTML_TAG("noembed", "");
@ -244,10 +244,18 @@ for (var tag of allTags) {
"Unexpected classname for " + tagName(tag)); "Unexpected classname for " + tagName(tag));
is(node instanceof window[classInfoString], true, is(node instanceof window[classInfoString], true,
tagName(tag) + " not an instance of " + classInfos[tag]); tagName(tag) + " not an instance of " + classInfos[tag]);
is(node instanceof HTMLUnknownElement, false,
tagName(tag) + " is an instance of HTMLUnknownElement"); if (classInfoString != 'HTMLUnknownElement') {
is(node instanceof SpecialPowers.Ci.nsIDOMHTMLUnknownElement, false, is(node instanceof HTMLUnknownElement, false,
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement"); tagName(tag) + " is an instance of HTMLUnknownElement");
is(node instanceof SpecialPowers.Ci.nsIDOMHTMLUnknownElement, false,
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement");
} else {
is(node instanceof HTMLUnknownElement, true,
tagName(tag) + " is an instance of HTMLUnknownElement");
is(node instanceof SpecialPowers.Ci.nsIDOMHTMLUnknownElement, true,
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement");
}
// Check that each node QIs to all the things we expect it to QI to // Check that each node QIs to all the things we expect it to QI to
for (var iface of interfaces[tag].concat(interfacesNonClassinfo[tag])) { for (var iface of interfaces[tag].concat(interfacesNonClassinfo[tag])) {

View File

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=844127
-->
<head>
<title>Test for Bug 844127</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=844127">Mozilla Bug 844127</a>
<script type="text/javascript">
/** Test for Bug 844127 **/
var a1 = document.createElement('bgsound');
var a2 = document.createElement('image');
var a3 = document.createElement('multicol');
var a4 = document.createElement('spacer');
var a5 = document.createElement('isindex');
is(Object.getPrototypeOf(a1), HTMLUnknownElement.prototype, "Prototype for bgsound should be correct");
is(Object.getPrototypeOf(a2), HTMLElement.prototype, "Prototype for image should be correct");
is(Object.getPrototypeOf(a3), HTMLUnknownElement.prototype, "Prototype for multicol should be correct");
is(Object.getPrototypeOf(a4), HTMLUnknownElement.prototype, "Prototype for spacer should be correct");
is(Object.getPrototypeOf(a5), HTMLUnknownElement.prototype, "Prototype for isindex should be correct");
</script>
</body>
</html>

View File

@ -62,11 +62,11 @@ function test() {
HTML_TAG("html", "Html") HTML_TAG("html", "Html")
HTML_TAG("i", "Span") HTML_TAG("i", "Span")
HTML_TAG("iframe", "IFrame") HTML_TAG("iframe", "IFrame")
HTML_TAG("image", "Span") HTML_TAG("image", "")
HTML_TAG("img", "Image") HTML_TAG("img", "Image")
HTML_TAG("input", "Input") HTML_TAG("input", "Input")
HTML_TAG("ins", "Mod") HTML_TAG("ins", "Mod")
HTML_TAG("isindex", "Shared") HTML_TAG("isindex", "Unknown")
HTML_TAG("kbd", "Span") HTML_TAG("kbd", "Span")
HTML_TAG("keygen", "Span") HTML_TAG("keygen", "Span")
HTML_TAG("label", "Label") HTML_TAG("label", "Label")
@ -78,7 +78,7 @@ function test() {
HTML_TAG("marquee", "Div") HTML_TAG("marquee", "Div")
HTML_TAG("menu", "Shared") HTML_TAG("menu", "Shared")
HTML_TAG("meta", "Meta") HTML_TAG("meta", "Meta")
HTML_TAG("multicol", "Span") HTML_TAG("multicol", "Unknown")
HTML_TAG("nobr", "Span") HTML_TAG("nobr", "Span")
HTML_TAG("noembed", "Div") HTML_TAG("noembed", "Div")
HTML_TAG("noframes", "Div") HTML_TAG("noframes", "Div")
@ -97,7 +97,7 @@ function test() {
HTML_TAG("script", "Script") HTML_TAG("script", "Script")
HTML_TAG("select", "Select") HTML_TAG("select", "Select")
HTML_TAG("small", "Span") HTML_TAG("small", "Span")
HTML_TAG("spacer", "Shared") HTML_TAG("spacer", "Unknown")
HTML_TAG("span", "Span") HTML_TAG("span", "Span")
HTML_TAG("strike", "Span") HTML_TAG("strike", "Span")
HTML_TAG("strong", "Span") HTML_TAG("strong", "Span")

View File

@ -41,7 +41,7 @@ HTML_TAG("b", "Span")
HTML_TAG("base", "Shared") HTML_TAG("base", "Shared")
HTML_TAG("basefont", "Span") HTML_TAG("basefont", "Span")
HTML_TAG("bdo", "Span") HTML_TAG("bdo", "Span")
HTML_TAG("bgsound", "Span") HTML_TAG("bgsound", "Unknown")
HTML_TAG("big", "Span") HTML_TAG("big", "Span")
HTML_TAG("blink", "Span") HTML_TAG("blink", "Span")
HTML_TAG("blockquote", "Shared") HTML_TAG("blockquote", "Shared")
@ -80,11 +80,11 @@ HTML_TAG("hr", "HR")
HTML_TAG("html", "Html") HTML_TAG("html", "Html")
HTML_TAG("i", "Span") HTML_TAG("i", "Span")
HTML_TAG("iframe", "IFrame") HTML_TAG("iframe", "IFrame")
HTML_TAG("image", "Span") HTML_TAG("image", "")
HTML_TAG("img", "Image") HTML_TAG("img", "Image")
HTML_TAG("input", "Input") HTML_TAG("input", "Input")
HTML_TAG("ins", "Mod") HTML_TAG("ins", "Mod")
HTML_TAG("isindex", "Shared") HTML_TAG("isindex", "Unknown")
HTML_TAG("kbd", "Span") HTML_TAG("kbd", "Span")
HTML_TAG("keygen", "Span") HTML_TAG("keygen", "Span")
HTML_TAG("label", "Label") HTML_TAG("label", "Label")
@ -96,7 +96,7 @@ HTML_TAG("map", "Map")
HTML_TAG("marquee", "Div") HTML_TAG("marquee", "Div")
HTML_TAG("menu", "Shared") HTML_TAG("menu", "Shared")
HTML_TAG("meta", "Meta") HTML_TAG("meta", "Meta")
HTML_TAG("multicol", "Span") HTML_TAG("multicol", "Unknown")
HTML_TAG("nobr", "Span") HTML_TAG("nobr", "Span")
HTML_TAG("noembed", "Div") HTML_TAG("noembed", "Div")
HTML_TAG("noframes", "Div") HTML_TAG("noframes", "Div")
@ -115,7 +115,7 @@ HTML_TAG("samp", "Span")
HTML_TAG("script", "Script") HTML_TAG("script", "Script")
HTML_TAG("select", "Select") HTML_TAG("select", "Select")
HTML_TAG("small", "Span") HTML_TAG("small", "Span")
HTML_TAG("spacer", "Shared") HTML_TAG("spacer", "Unknown")
HTML_TAG("span", "Span") HTML_TAG("span", "Span")
HTML_TAG("strike", "Span") HTML_TAG("strike", "Span")
HTML_TAG("strong", "Span") HTML_TAG("strong", "Span")

View File

@ -50,7 +50,7 @@ HTML_HTMLELEMENT_TAG(b)
HTML_TAG(base, Shared) HTML_TAG(base, Shared)
HTML_TAG(basefont, Span) HTML_TAG(basefont, Span)
HTML_HTMLELEMENT_TAG(bdo) HTML_HTMLELEMENT_TAG(bdo)
HTML_TAG(bgsound, Span) HTML_TAG(bgsound, Unknown)
HTML_HTMLELEMENT_TAG(big) HTML_HTMLELEMENT_TAG(big)
HTML_HTMLELEMENT_TAG(blink) HTML_HTMLELEMENT_TAG(blink)
HTML_TAG(blockquote, Shared) HTML_TAG(blockquote, Shared)
@ -96,7 +96,7 @@ HTML_TAG(hr, HR)
HTML_TAG(html, Shared) HTML_TAG(html, Shared)
HTML_HTMLELEMENT_TAG(i) HTML_HTMLELEMENT_TAG(i)
HTML_TAG(iframe, IFrame) HTML_TAG(iframe, IFrame)
HTML_TAG(image, Span) HTML_HTMLELEMENT_TAG(image)
HTML_TAG(img, Image) HTML_TAG(img, Image)
HTML_TAG(input, Input) HTML_TAG(input, Input)
HTML_TAG(ins, Mod) HTML_TAG(ins, Mod)
@ -115,7 +115,7 @@ HTML_TAG(menu, Menu)
HTML_TAG(menuitem, MenuItem) HTML_TAG(menuitem, MenuItem)
HTML_TAG(meta, Meta) HTML_TAG(meta, Meta)
HTML_TAG(meter, Meter) HTML_TAG(meter, Meter)
HTML_TAG(multicol, Span) HTML_TAG(multicol, Unknown)
HTML_HTMLELEMENT_TAG(nav) HTML_HTMLELEMENT_TAG(nav)
HTML_HTMLELEMENT_TAG(nobr) HTML_HTMLELEMENT_TAG(nobr)
HTML_HTMLELEMENT_TAG(noembed) HTML_HTMLELEMENT_TAG(noembed)