Bug 573357 - Use the HTMLElement interface for more elements. r=jonas
authorMs2ger <ms2ger@gmail.com>
Wed, 30 Jun 2010 23:11:45 +0200
changeset 46458 dacfa73ea4201729d2eca6a99d340f8125b673dd
parent 46457 2c778979f15a4e89c3119cf5d1e09cc6568fb711
child 46459 d96f5d83187600947c10e28f64b6b0ca5b39896c
push id14199
push usermak77@bonardo.net
push dateWed, 30 Jun 2010 21:12:34 +0000
treeherdermozilla-central@dacfa73ea420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonas
bugs573357
milestone2.0b2pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 573357 - Use the HTMLElement interface for more elements. r=jonas
content/html/content/src/nsHTMLSharedElement.cpp
content/html/content/test/test_bug389797.html
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
parser/htmlparser/public/nsHTMLTagList.h
--- a/content/html/content/src/nsHTMLSharedElement.cpp
+++ b/content/html/content/src/nsHTMLSharedElement.cpp
@@ -146,17 +146,16 @@ nsHTMLSharedElement::~nsHTMLSharedElemen
 }
 
 
 NS_IMPL_ADDREF_INHERITED(nsHTMLSharedElement, nsGenericElement)
 NS_IMPL_RELEASE_INHERITED(nsHTMLSharedElement, nsGenericElement)
 
 
 DOMCI_DATA(HTMLParamElement, nsHTMLSharedElement)
-DOMCI_DATA(HTMLWBRElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLIsIndexElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLBaseElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLSpacerElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLDirectoryElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLMenuElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLQuoteElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLHeadElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLHtmlElement, nsHTMLSharedElement)
@@ -175,17 +174,16 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLSharedElem
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDirectoryElement, dir)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLMenuElement, menu)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, q)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, blockquote)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLHeadElement, head)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLHtmlElement, html)
 
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLParamElement, param)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLWBRElement, wbr)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLIsIndexElement, isindex)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLBaseElement, base)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLSpacerElement, spacer)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLDirectoryElement, dir)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLMenuElement, menu)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLQuoteElement, q)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLQuoteElement, blockquote)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_IF_TAG(HTMLHeadElement, head)
--- a/content/html/content/test/test_bug389797.html
+++ b/content/html/content/test/test_bug389797.html
@@ -108,48 +108,48 @@ objectIfaces2.push("nsIImageLoadingConte
    spacer
    ul
    wbr
    head
    html
  */
 
 HTML_TAG("a", "Anchor", [ "nsIDOMNSHTMLAnchorElement2" ]);
-HTML_TAG("abbr", "Span");
-HTML_TAG("acronym", "Span");
-HTML_TAG("address", "Span");
+HTML_TAG("abbr", ""); // HTMLElement
+HTML_TAG("acronym", ""); // HTMLElement
+HTML_TAG("address", ""); // HTMLElement
 HTML_TAG("applet", "Applet", [], objectIfaces);
 HTML_TAG("area", "Area", [ "nsIDOMNSHTMLAreaElement2" ]);
 HTML_TAG("article", ""); // HTMLElement
 HTML_TAG("aside", ""); // HTMLElement
-HTML_TAG("b", "Span");
+HTML_TAG("b", ""); // HTMLElement
 HTML_TAG("base", "Base");
-HTML_TAG("bdo", "Span");
+HTML_TAG("bdo", ""); // HTMLElement
 HTML_TAG("bgsound", "Span");
-HTML_TAG("big", "Span");
-HTML_TAG("blink", "Span");
+HTML_TAG("big", ""); // HTMLElement
+HTML_TAG("blink", ""); // HTMLElement
 HTML_TAG("blockquote", "Quote");
 HTML_TAG("body", "Body");
 HTML_TAG("br", "BR");
 HTML_TAG("button", "Button");
 HTML_TAG("canvas", "Canvas");
 HTML_TAG("caption", "TableCaption");
-HTML_TAG("center", "Span");
-HTML_TAG("cite", "Span");
-HTML_TAG("code", "Span");
+HTML_TAG("center", ""); // HTMLElement
+HTML_TAG("cite", ""); // HTMLElement
+HTML_TAG("code", ""); // HTMLElement
 HTML_TAG("col", "TableCol");
 HTML_TAG("colgroup", "TableCol");
-HTML_TAG("dd", "Span");
+HTML_TAG("dd", ""); // HTMLElement
 HTML_TAG("del", "Del", [ "nsIDOMHTMLModElement" ]);
-HTML_TAG("dfn", "Span");
+HTML_TAG("dfn", ""); // HTMLElement
 HTML_TAG("dir", "Directory");
 HTML_TAG("div", "Div");
 HTML_TAG("dl", "DList");
-HTML_TAG("dt", "Span");
-HTML_TAG("em", "Span");
+HTML_TAG("dt", ""); // HTMLElement
+HTML_TAG("em", ""); // HTMLElement
 HTML_TAG("embed", "Embed", [ "nsIDOMGetSVGDocument" ], objectIfaces);
 HTML_TAG("fieldset", "FieldSet");
 HTML_TAG("figcaption", "") // HTMLElement
 HTML_TAG("figure", "") // HTMLElement
 HTML_TAG("font", "Font");
 HTML_TAG("footer", "") // HTMLElement
 HTML_TAG("form", "Form", [], [ "nsIWebProgressListener" ]);
 HTML_TAG("frame", "Frame", [], [ "nsIFrameLoaderOwner" ]);
@@ -160,82 +160,82 @@ HTML_TAG("h3", "Heading");
 HTML_TAG("h4", "Heading");
 HTML_TAG("h5", "Heading");
 HTML_TAG("h6", "Heading");
 HTML_TAG("head", "Head");
 HTML_TAG("header", "") // HTMLElement
 HTML_TAG("hgroup", "") // HTMLElement
 HTML_TAG("hr", "HR");
 HTML_TAG("html", "Html");
-HTML_TAG("i", "Span");
+HTML_TAG("i", ""); // HTMLElement
 HTML_TAG("iframe", "IFrame", [ "nsIDOMNSHTMLFrameElement", "nsIDOMGetSVGDocument" ],
                              [ "nsIFrameLoaderOwner" ]);
 HTML_TAG("image", "Span");
 HTML_TAG("img", "Image", [], [ "imgIDecoderObserver",
                                "nsIImageLoadingContent" ]);
 HTML_TAG("input", "Input", [], [ "imgIDecoderObserver",
                                  "nsIImageLoadingContent",
                                  "nsIDOMNSEditableElement" ]);
 HTML_TAG("ins", "Ins", [ "nsIDOMHTMLModElement" ]);
 HTML_TAG("isindex", "IsIndex");
-HTML_TAG("kbd", "Span");
+HTML_TAG("kbd", ""); // HTMLElement
 HTML_TAG("keygen", "Span");
 HTML_TAG("label", "Label");
 HTML_TAG("legend", "Legend");
 HTML_TAG("li", "LI");
 HTML_TAG("link", "Link", [ "nsIDOMLinkStyle" ]);
-HTML_TAG("listing", "Span");
+HTML_TAG("listing", ""); // HTMLElement
 HTML_TAG("map", "Map");
 HTML_TAG("mark", ""); // HTMLElement
 HTML_TAG("marquee", "Div");
 HTML_TAG("menu", "Menu");
 HTML_TAG("meta", "Meta");
 HTML_TAG("multicol", "Span");
 HTML_TAG("nav", "") // HTMLElement
-HTML_TAG("nobr", "Span");
-HTML_TAG("noembed", "Div");
-HTML_TAG("noframes", "Div");
-HTML_TAG("noscript", "Div");
+HTML_TAG("nobr", ""); // HTMLElement
+HTML_TAG("noembed", ""); // HTMLElement
+HTML_TAG("noframes", ""); // HTMLElement
+HTML_TAG("noscript", ""); // HTMLElement
 HTML_TAG("object", "Object", [ "nsIDOMGetSVGDocument" ],
                              objectIfaces.concat([ "nsIImageLoadingContent" ]));
 HTML_TAG("ol", "OList");
 HTML_TAG("optgroup", "OptGroup");
 HTML_TAG("option", "Option");
 HTML_TAG("p", "Paragraph");
 HTML_TAG("param", "Param");
 HTML_TAG("plaintext", ""); // HTMLElement
 HTML_TAG("pre", "Pre");
 HTML_TAG("q", "Quote");
-HTML_TAG("s", "Span");
-HTML_TAG("samp", "Span");
+HTML_TAG("s", ""); // HTMLElement
+HTML_TAG("samp", ""); // HTMLElement
 HTML_TAG("script", "Script", [], [ "nsIScriptLoaderObserver" ]);
 HTML_TAG("section", "") // HTMLElement
 HTML_TAG("select", "Select");
-HTML_TAG("small", "Span");
+HTML_TAG("small", ""); // HTMLElement
 HTML_TAG("spacer", "Spacer");
 HTML_TAG("span", "Span");
-HTML_TAG("strike", "Span");
-HTML_TAG("strong", "Span");
+HTML_TAG("strike", ""); // HTMLElement
+HTML_TAG("strong", ""); // HTMLElement
 HTML_TAG("style", "Style", [ "nsIDOMLinkStyle" ]);
-HTML_TAG("sub", "Span");
-HTML_TAG("sup", "Span");
+HTML_TAG("sub", ""); // HTMLElement
+HTML_TAG("sup", ""); // HTMLElement
 HTML_TAG("table", "Table");
 HTML_TAG("tbody", "TableSection");
 HTML_TAG("td", "TableCell");
 HTML_TAG("textarea", "TextArea", [], [ "nsIDOMNSEditableElement" ]);
 HTML_TAG("tfoot", "TableSection");
 HTML_TAG("th", "TableCell");
 HTML_TAG("thead", "TableSection");
 HTML_TAG("title", "Title");
 HTML_TAG("tr", "TableRow");
-HTML_TAG("tt", "Span");
-HTML_TAG("u", "Span");
+HTML_TAG("tt", ""); // HTMLElement
+HTML_TAG("u", ""); // HTMLElement
 HTML_TAG("ul", "UList");
-HTML_TAG("var", "Span");
-HTML_TAG("wbr", "WBR");
+HTML_TAG("var", ""); // HTMLElement
+HTML_TAG("wbr", ""); // HTMLElement
 HTML_TAG("xmp", ""); // HTMLElement
 
 function tagName(aTag) {
   return "<" + aTag + ">";
 }
 
 for each (var tag in allTags) {
   var node = document.createElement(tag);
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -848,18 +848,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(HTMLTextAreaElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(HTMLTitleElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(HTMLUListElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(HTMLUnknownElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(HTMLWBRElement, nsElementSH,
-                           ELEMENT_SCRIPTABLE_FLAGS)
 
   // CSS classes
   NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CSSCharsetRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -2692,21 +2690,16 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLUnknownElement, nsIDOMHTMLElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
     DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLWBRElement, nsIDOMHTMLElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
-    DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CSSCharsetRule, nsIDOMCSSCharsetRule)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCharsetRule)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -137,17 +137,16 @@ DOMCI_CLASS(HTMLTableCellElement)
 DOMCI_CLASS(HTMLTableColElement)
 DOMCI_CLASS(HTMLTableElement)
 DOMCI_CLASS(HTMLTableRowElement)
 DOMCI_CLASS(HTMLTableSectionElement)
 DOMCI_CLASS(HTMLTextAreaElement)
 DOMCI_CLASS(HTMLTitleElement)
 DOMCI_CLASS(HTMLUListElement)
 DOMCI_CLASS(HTMLUnknownElement)
-DOMCI_CLASS(HTMLWBRElement)
 
 // CSS classes
 DOMCI_CLASS(CSSStyleRule)
 DOMCI_CLASS(CSSCharsetRule)
 DOMCI_CLASS(CSSImportRule)
 DOMCI_CLASS(CSSMediaRule)
 DOMCI_CLASS(CSSNameSpaceRule)
 DOMCI_CLASS(CSSRuleList)
--- a/parser/htmlparser/public/nsHTMLTagList.h
+++ b/parser/htmlparser/public/nsHTMLTagList.h
@@ -61,52 +61,52 @@
   Entries *must* use only lowercase characters.
 
   Don't forget to update /editor/libeditor/html/nsHTMLEditUtils.cpp as well.
 
   ** Break these invariants and bad things will happen. **
 
  ******/
 HTML_TAG(a, Anchor)
-HTML_TAG(abbr, Span)
-HTML_TAG(acronym, Span)
-HTML_TAG(address, Span)
+HTML_TAG(abbr, ) // HTMLElement instance
+HTML_TAG(acronym, ) // HTMLElement instance
+HTML_TAG(address, ) // HTMLElement instance
 HTML_TAG(applet, SharedObject)
 HTML_TAG(area, Area)
 HTML_TAG(article, ) // HTMLElement instance
 HTML_TAG(aside, ) // HTMLElement instance
 #if defined(MOZ_MEDIA)
 HTML_TAG(audio, Audio)
 #endif
-HTML_TAG(b, Span)
+HTML_TAG(b, ) // HTMLElement instance
 HTML_TAG(base, Shared)
 HTML_TAG(basefont, Span)
-HTML_TAG(bdo, Span)
+HTML_TAG(bdo, ) // HTMLElement instance
 HTML_TAG(bgsound, Span)
-HTML_TAG(big, Span)
-HTML_TAG(blink, Span)
+HTML_TAG(big, ) // HTMLElement instance
+HTML_TAG(blink, ) // HTMLElement instance
 HTML_TAG(blockquote, Shared)
 HTML_TAG(body, Body)
 HTML_TAG(br, BR)
 HTML_TAG(button, Button)
 HTML_TAG(canvas, Canvas)
 HTML_TAG(caption, TableCaption)
-HTML_TAG(center, Span)
-HTML_TAG(cite, Span)
-HTML_TAG(code, Span)
+HTML_TAG(center, ) // HTMLElement instance
+HTML_TAG(cite, ) // HTMLElement instance
+HTML_TAG(code, ) // HTMLElement instance
 HTML_TAG(col, TableCol)
 HTML_TAG(colgroup, TableCol)
-HTML_TAG(dd, Span)
+HTML_TAG(dd, ) // HTMLElement instance
 HTML_TAG(del, Mod)
-HTML_TAG(dfn, Span)
+HTML_TAG(dfn, ) // HTMLElement instance
 HTML_TAG(dir, Shared)
 HTML_TAG(div, Div)
 HTML_TAG(dl, SharedList)
-HTML_TAG(dt, Span)
-HTML_TAG(em, Span)
+HTML_TAG(dt, ) // HTMLElement instance
+HTML_TAG(em, ) // HTMLElement instance
 HTML_TAG(embed, SharedObject)
 HTML_TAG(fieldset, FieldSet)
 HTML_TAG(figcaption, ) // HTMLElement instance
 HTML_TAG(figure, ) // HTMLElement instance
 HTML_TAG(font, Font)
 HTML_TAG(footer, ) // HTMLElement instance
 HTML_TAG(form, Form)
 HTML_TAG(frame, Frame)
@@ -117,84 +117,84 @@ HTML_TAG(h3, Heading)
 HTML_TAG(h4, Heading)
 HTML_TAG(h5, Heading)
 HTML_TAG(h6, Heading)
 HTML_TAG(head, Shared)
 HTML_TAG(header, ) // HTMLElement instance
 HTML_TAG(hgroup, ) // HTMLElement instance
 HTML_TAG(hr, HR)
 HTML_TAG(html, Shared)
-HTML_TAG(i, Span)
+HTML_TAG(i, ) // HTMLElement instance
 HTML_TAG(iframe, IFrame)
 HTML_TAG(image, Span)
 HTML_TAG(img, Image)
 HTML_TAG(input, Input)
 HTML_TAG(ins, Mod)
 HTML_TAG(isindex, Shared)
-HTML_TAG(kbd, Span)
+HTML_TAG(kbd, ) // HTMLElement instance
 HTML_TAG(keygen, Span)
 HTML_TAG(label, Label)
 HTML_TAG(legend, Legend)
 HTML_TAG(li, LI)
 HTML_TAG(link, Link)
-HTML_TAG(listing, Span)
+HTML_TAG(listing, ) // HTMLElement instance
 HTML_TAG(map, Map)
 HTML_TAG(mark, ) // HTMLElement instance
 HTML_TAG(marquee, Div)
 HTML_TAG(menu, Shared)
 HTML_TAG(meta, Meta)
 HTML_TAG(multicol, Span)
 HTML_TAG(nav, ) // HTMLElement instance
-HTML_TAG(nobr, Span)
-HTML_TAG(noembed, Div)
-HTML_TAG(noframes, Div)
-HTML_TAG(noscript, Div)
+HTML_TAG(nobr, ) // HTMLElement instance
+HTML_TAG(noembed, ) // HTMLElement instance
+HTML_TAG(noframes, ) // HTMLElement instance
+HTML_TAG(noscript, ) // HTMLElement instance
 HTML_TAG(object, Object)
 HTML_TAG(ol, SharedList)
 HTML_TAG(optgroup, OptGroup)
 HTML_TAG(option, Option)
 HTML_TAG(output, Output)
 HTML_TAG(p, Paragraph)
 HTML_TAG(param, Shared)
 HTML_TAG(plaintext, ) // HTMLElement instance
 HTML_TAG(pre, Pre)
 HTML_TAG(q, Shared)
-HTML_TAG(s, Span)
-HTML_TAG(samp, Span)
+HTML_TAG(s, ) // HTMLElement instance
+HTML_TAG(samp, ) // HTMLElement instance
 HTML_TAG(script, Script)
 HTML_TAG(section, ) // HTMLElement instance
 HTML_TAG(select, Select)
-HTML_TAG(small, Span)
+HTML_TAG(small, ) // HTMLElement instance
 #if defined(MOZ_MEDIA)
 HTML_TAG(source, Source)
 #endif
 HTML_TAG(spacer, Shared)
 HTML_TAG(span, Span)
-HTML_TAG(strike, Span)
-HTML_TAG(strong, Span)
+HTML_TAG(strike, ) // HTMLElement instance
+HTML_TAG(strong, ) // HTMLElement instance
 HTML_TAG(style, Style)
-HTML_TAG(sub, Span)
-HTML_TAG(sup, Span)
+HTML_TAG(sub, ) // HTMLElement instance
+HTML_TAG(sup, ) // HTMLElement instance
 HTML_TAG(table, Table)
 HTML_TAG(tbody, TableSection)
 HTML_TAG(td, TableCell)
 HTML_TAG(textarea, TextArea)
 HTML_TAG(tfoot, TableSection)
 HTML_TAG(th, TableCell)
 HTML_TAG(thead, TableSection)
 HTML_TAG(title, Title)
 HTML_TAG(tr, TableRow)
-HTML_TAG(tt, Span)
-HTML_TAG(u, Span)
+HTML_TAG(tt, ) // HTMLElement instance
+HTML_TAG(u, ) // HTMLElement instance
 HTML_TAG(ul, SharedList)
-HTML_TAG(var, Span)
+HTML_TAG(var, ) // HTMLElement instance
 #if defined(MOZ_MEDIA)
 HTML_TAG(video, Video)
 #endif
-HTML_TAG(wbr, Shared)
+HTML_TAG(wbr, ) // HTMLElement instance
 HTML_TAG(xmp, ) // HTMLElement instance
 
 
 /* These are not for tags. But they will be included in the nsHTMLTag
    enum anyway */
 
 HTML_OTHER(text)
 HTML_OTHER(whitespace)