Bug 836850. Allow a single C++ class to implement multiple WebIDL interfaces. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 08 Feb 2013 12:20:11 +0000
changeset 131160 d32064860f36bbc48e34ceb712f08860d2ad7ed9
parent 131159 845e50f1ca7618975160db36b6130582b4576d88
child 131161 7cfb020b01ac8e1ffc83626750c63507703a0ee3
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs836850
milestone21.0a1
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 836850. Allow a single C++ class to implement multiple WebIDL interfaces. r=peterv
content/html/content/src/HTMLSharedListElement.cpp
content/html/content/src/HTMLSharedListElement.h
content/html/content/src/nsGenericHTMLElement.h
content/html/content/test/Makefile.in
content/html/content/test/test_dl_attributes_reflection.html
content/html/content/test/test_li_attributes_reflection.html
content/html/content/test/test_ol_attributes_reflection.html
content/html/content/test/test_ul_attributes_reflection.html
dom/bindings/Bindings.conf
dom/bindings/Codegen.py
dom/bindings/Configuration.py
dom/tests/browser/browser_bug396843.js
dom/tests/mochitest/bugs/test_bug396843.html
parser/htmlparser/public/nsHTMLTagList.h
--- a/content/html/content/src/HTMLSharedListElement.cpp
+++ b/content/html/content/src/HTMLSharedListElement.cpp
@@ -11,19 +11,17 @@
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
-NS_IMPL_NS_NEW_HTML_ELEMENT(OList)
-NS_IMPL_NS_NEW_HTML_ELEMENT(DList)
-NS_IMPL_NS_NEW_HTML_ELEMENT(UList)
+NS_IMPL_NS_NEW_HTML_ELEMENT(SharedList)
 DOMCI_DATA(HTMLOListElement, mozilla::dom::HTMLSharedListElement)
 DOMCI_DATA(HTMLDListElement, mozilla::dom::HTMLSharedListElement)
 DOMCI_DATA(HTMLUListElement, mozilla::dom::HTMLSharedListElement)
 
 namespace mozilla {
 namespace dom {
 
 HTMLSharedListElement::~HTMLSharedListElement()
@@ -59,19 +57,17 @@ NS_INTERFACE_TABLE_HEAD(HTMLSharedListEl
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLOListElement, ol)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDListElement, dl)
   NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLUListElement, ul)
 
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_GETTER(GetClassInfoInternal)
 NS_HTML_CONTENT_INTERFACE_MAP_END
 
 
-NS_IMPL_ELEMENT_CLONE(HTMLOListElement)
-NS_IMPL_ELEMENT_CLONE(HTMLDListElement)
-NS_IMPL_ELEMENT_CLONE(HTMLUListElement)
+NS_IMPL_ELEMENT_CLONE(HTMLSharedListElement)
 
 
 NS_IMPL_BOOL_ATTR(HTMLSharedListElement, Compact, compact)
 NS_IMPL_INT_ATTR_DEFAULT_VALUE(HTMLSharedListElement, Start, start, 1)
 NS_IMPL_STRING_ATTR(HTMLSharedListElement, Type, type)
 NS_IMPL_BOOL_ATTR(HTMLSharedListElement, Reversed, reversed)
 
 // Shared with nsHTMLSharedElement.cpp
@@ -169,27 +165,23 @@ HTMLSharedListElement::GetAttributeMappi
       mNodeInfo->Equals(nsGkAtoms::ul)) {
     return &MapAttributesIntoRule;
   }
 
   return nsGenericHTMLElement::GetAttributeMappingFunction();
 }
 
 JSObject*
-HTMLDListElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
+HTMLSharedListElement::WrapNode(JSContext *aCx, JSObject *aScope,
+                                bool *aTriedToWrap)
 {
-  return HTMLDListElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
-}
-
-JSObject*
-HTMLOListElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
-{
-  return HTMLOListElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
-}
-
-JSObject*
-HTMLUListElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
-{
+  if (mNodeInfo->Equals(nsGkAtoms::ol)) {
+    return HTMLOListElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+  }
+  if (mNodeInfo->Equals(nsGkAtoms::dl)) {
+    return HTMLDListElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+  }
+  MOZ_ASSERT(mNodeInfo->Equals(nsGkAtoms::ul));
   return HTMLUListElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/content/html/content/src/HTMLSharedListElement.h
+++ b/content/html/content/src/HTMLSharedListElement.h
@@ -50,16 +50,17 @@ public:
   // fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT
 
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
   virtual nsXPCClassInfo* GetClassInfo()
   {
     return static_cast<nsXPCClassInfo*>(GetClassInfoInternal());
   }
   nsIClassInfo* GetClassInfoInternal();
 
   virtual nsIDOMNode* AsDOMNode()
   {
@@ -96,54 +97,15 @@ public:
   }
   void SetCompact(bool aCompact, mozilla::ErrorResult& rv)
   {
     SetHTMLBoolAttr(nsGkAtoms::compact, aCompact, rv);
   }
 
 protected:
   virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
-                             bool *aTriedToWrap) MOZ_OVERRIDE = 0;
-};
-
-class HTMLDListElement MOZ_FINAL : public HTMLSharedListElement
-{
-public:
-  HTMLDListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : HTMLSharedListElement(aNodeInfo)
-  {
-  }
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-protected:
-  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
-                             bool *aTriedToWrap) MOZ_OVERRIDE;
-};
-
-class HTMLOListElement MOZ_FINAL : public HTMLSharedListElement
-{
-public:
-  HTMLOListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : HTMLSharedListElement(aNodeInfo)
-  {
-  }
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-protected:
-  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
-                             bool *aTriedToWrap) MOZ_OVERRIDE;
-};
-
-class HTMLUListElement MOZ_FINAL : public HTMLSharedListElement
-{
-public:
-  HTMLUListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : HTMLSharedListElement(aNodeInfo)
-  {
-  }
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-protected:
-  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
                              bool *aTriedToWrap) MOZ_OVERRIDE;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_HTMLSharedListElement_h
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -1887,31 +1887,31 @@ NS_NewHTML##_elementName##Element(alread
 
 // Here, we expand 'NS_DECLARE_NS_NEW_HTML_ELEMENT()' by hand.
 // (Calling the macro directly (with no args) produces compiler warnings.)
 nsGenericHTMLElement*
 NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                   mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
 
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Shared)
+NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedObject)
 
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Anchor)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Area)
 #if defined(MOZ_MEDIA)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Audio)
 #endif
 NS_DECLARE_NS_NEW_HTML_ELEMENT(BR)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Body)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Button)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Canvas)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Mod)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(DataList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Div)
-NS_DECLARE_NS_NEW_HTML_ELEMENT(DList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(FieldSet)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Font)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Form)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Frame)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(FrameSet)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(HR)
 NS_DECLARE_NS_NEW_HTML_ELEMENT_AS_SHARED(Head)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Heading)
@@ -1924,17 +1924,16 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(Label)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Legend)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Link)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Map)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Menu)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(MenuItem)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Meta)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Meter)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Object)
-NS_DECLARE_NS_NEW_HTML_ELEMENT(OList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(OptGroup)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Option)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Output)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Paragraph)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Pre)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Progress)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Script)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Select)
@@ -1949,17 +1948,16 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(TableCol)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Table)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(TableRow)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(TableSection)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Tbody)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(TextArea)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Tfoot)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Thead)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Title)
-NS_DECLARE_NS_NEW_HTML_ELEMENT(UList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Unknown)
 #if defined(MOZ_MEDIA)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Video)
 #endif
 
 inline nsISupports*
 ToSupports(nsGenericHTMLElement* aHTMLElement)
 {
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -253,16 +253,18 @@ MOCHITEST_FILES = \
 		file_fullscreen-hidden.html \
 		file_fullscreen-navigation.html \
 		file_fullscreen-esc-exit.html \
 		file_fullscreen-esc-exit-inner.html \
 		file_fullscreen-rollback.html \
 		file_fullscreen-svg-element.html \
 		test_li_attributes_reflection.html \
 		test_ol_attributes_reflection.html \
+		test_dl_attributes_reflection.html \
+		test_ul_attributes_reflection.html \
 		test_bug651956.html \
 		test_bug694503.html \
 		test_object_plugin_nav.html \
 		test_bug742030.html \
 		test_bug742549.html \
 		test_bug745685.html \
 		test_input_file_picker.html \
 		test_bug763626.html \
copy from content/html/content/test/test_li_attributes_reflection.html
copy to content/html/content/test/test_dl_attributes_reflection.html
--- a/content/html/content/test/test_li_attributes_reflection.html
+++ b/content/html/content/test/test_dl_attributes_reflection.html
@@ -1,28 +1,27 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-  <title>Test for HTMLLIElement attributes reflection</title>
+  <title>Test for HTMLDListElement attributes reflection</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="reflect.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script type="application/javascript">
 
-/** Test for HTMLLIElement attributes reflection **/
+/** Test for HTMLDListElement attributes reflection **/
 
-// .value
-reflectInt({
-  element: document.createElement("li"),
-  attribute: "value",
-  nonNegative: false,
+// .compact
+reflectBoolean({
+  element: document.createElement("dl"),
+  attribute: "compact"
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/test_li_attributes_reflection.html
+++ b/content/html/content/test/test_li_attributes_reflection.html
@@ -17,12 +17,18 @@
 
 // .value
 reflectInt({
   element: document.createElement("li"),
   attribute: "value",
   nonNegative: false,
 });
 
+// .type
+reflectString({
+  element: document.createElement("li"),
+  attribute: "type"
+});
+
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/test_ol_attributes_reflection.html
+++ b/content/html/content/test/test_ol_attributes_reflection.html
@@ -24,17 +24,27 @@ reflectBoolean({
 // .start
 reflectInt({
   element: document.createElement("ol"),
   attribute: "start",
   nonNegative: false,
   defaultValue: 1,
 });
 
-// TODO: .type (String)
+// .type
+reflectString({
+  element: document.createElement("ol"),
+  attribute: "type"
+});
+
+// .compact
+reflectBoolean({
+  element: document.createElement("ol"),
+  attribute: "compact",
+})
 
 // Additional tests for ol.start behavior when li elements are added
 var ol = document.createElement("ol");
 var li = document.createElement("li");
 li.value = 42;
 ol.appendChild(li);
 is(ol.start, 1, "ol.start with one li child, li.value = 42:");
 li.value = -42;
copy from content/html/content/test/test_li_attributes_reflection.html
copy to content/html/content/test/test_ul_attributes_reflection.html
--- a/content/html/content/test/test_li_attributes_reflection.html
+++ b/content/html/content/test/test_ul_attributes_reflection.html
@@ -1,28 +1,33 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-  <title>Test for HTMLLIElement attributes reflection</title>
+  <title>Test for HTMLUListElement attributes reflection</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="reflect.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script type="application/javascript">
 
-/** Test for HTMLLIElement attributes reflection **/
+/** Test for HTMLUListElement attributes reflection **/
 
-// .value
-reflectInt({
-  element: document.createElement("li"),
-  attribute: "value",
-  nonNegative: false,
+// .compact
+reflectBoolean({
+  element: document.createElement("ul"),
+  attribute: "compact"
+});
+
+// .type
+reflectString({
+  element: document.createElement("ul"),
+  attribute: "type"
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -368,17 +368,17 @@ DOMInterfaces = {
     ]
 },
 
 'HTMLDivElement': {
   'hasInstanceInterface': 'nsIDOMHTMLDivElement',
 },
 
 'HTMLDListElement': {
-    'headerFile' : 'mozilla/dom/HTMLSharedListElement.h'
+    'nativeType' : 'mozilla::dom::HTMLSharedListElement'
 },
 
 'HTMLDocument': {
     'nativeType': 'nsHTMLDocument',
     'register': False,
     'hasXPConnectImpls': True,
     'hasInstanceInterface': 'nsIDOMHTMLDocument',
     'resultNotAddRefed': [ 'body', 'head', 'images', 'embeds', 'plugins',
@@ -435,17 +435,17 @@ DOMInterfaces = {
     'hasInstanceInterface': 'nsIDOMHTMLMeterElement',
 },
 
 'HTMLModElement': {
     'hasInstanceInterface': 'nsIDOMHTMLModElement',
 },
 
 'HTMLOListElement': {
-    'headerFile' : 'mozilla/dom/HTMLSharedListElement.h',
+    'nativeType' : 'mozilla::dom::HTMLSharedListElement',
     'hasInstanceInterface': 'nsIDOMHTMLOListElement'
 },
 
 'HTMLOptionsCollection': {
     'nativeType': 'nsHTMLOptionCollection',
     'headerFile': 'nsHTMLSelectElement.h',
     'resultNotAddRefed': [ 'item' ],
     'binaryNames': {
@@ -506,17 +506,17 @@ DOMInterfaces = {
 'HTMLStyleElement': {
     'hasInstanceInterface': 'nsIDOMHTMLStyleElement',
     'resultNotAddRefed': [
         'sheet'
     ]
 },
 
 'HTMLUListElement': {
-    'headerFile' : 'mozilla/dom/HTMLSharedListElement.h'
+    'nativeType' : 'mozilla::dom::HTMLSharedListElement'
 },
 
 'IID': [
 {
     'nativeType': 'nsIJSID',
     'headerFile': 'xpcjsid.h',
 },
 {
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -6956,20 +6956,20 @@ class CGBindingRoot(CGThing):
                 if t.unroll().isCallback())
 
         forwardDeclares = CGList(forwardDeclares)
 
         descriptorsWithPrototype = filter(lambda d: d.interface.hasInterfacePrototypeObject(),
                                           descriptors)
         traitsClasses = [CGPrototypeTraitsClass(d) for d in descriptorsWithPrototype]
 
-        # We must have a 1:1 mapping here, skip for prototypes that have more
-        # than one concrete class implementation.
+        # We must have a 1:1 mapping here, skip for prototypes which
+        # share an implementation with other prototypes.
         traitsClasses.extend([CGPrototypeIDMapClass(d) for d in descriptorsWithPrototype
-                              if d.uniqueImplementation])
+                              if d.unsharedImplementation])
 
         # Wrap all of that in our namespaces.
         if len(traitsClasses) > 0:
             traitsClasses = CGNamespace.build(['mozilla', 'dom'],
                                      CGWrapper(CGList(traitsClasses),
                                                declarePre='\n'),
                                                declareOnly=True)
             traitsClasses = CGWrapper(traitsClasses, declarePost='\n')
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -48,23 +48,22 @@ class Configuration:
                 entry = [entry]
             elif len(entry) == 1 and entry[0].get("workers", False):
                 # List with only a workers descriptor means we should
                 # infer a mainthread descriptor.  If you want only
                 # workers bindings, don't use a list here.
                 entry.append({})
             self.descriptors.extend([Descriptor(self, iface, x) for x in entry])
 
-        # Mark the descriptors for which only a single nativeType implements
-        # an interface.
+        # Mark the descriptors for which the nativeType corresponds to exactly
+        # one interface.
         for descriptor in self.descriptors:
-            intefaceName = descriptor.interface.identifier.name
-            otherDescriptors = [d for d in self.descriptors
-                                if d.interface.identifier.name == intefaceName]
-            descriptor.uniqueImplementation = len(otherDescriptors) == 1
+            descriptor.unsharedImplementation = all(
+                d.nativeType != descriptor.nativeType or d == descriptor
+                for d in self.descriptors)
 
         self.enums = [e for e in parseData if e.isEnum()]
 
         # Figure out what our main-thread and worker dictionaries and callbacks
         # are.
         mainTypes = set()
         for descriptor in self.getDescriptors(workers=False, isExternal=False):
             mainTypes |= set(getFlatTypes(getTypesFromDescriptor(descriptor)))
--- a/dom/tests/browser/browser_bug396843.js
+++ b/dom/tests/browser/browser_bug396843.js
@@ -37,17 +37,17 @@ function test() {
         HTML_TAG("code", "Span")
         HTML_TAG("col", "TableCol")
         HTML_TAG("colgroup", "TableCol")
         HTML_TAG("dd", "Span")
         HTML_TAG("del", "Mod")
         HTML_TAG("dfn", "Span")
         HTML_TAG("dir", "Shared")
         HTML_TAG("div", "Div")
-        HTML_TAG("dl", "DList")
+        HTML_TAG("dl", "SharedList")
         HTML_TAG("dt", "Span")
         HTML_TAG("em", "Span")
         HTML_TAG("embed", "SharedObject")
         HTML_TAG("fieldset", "FieldSet")
         HTML_TAG("font", "Font")
         HTML_TAG("form", "Form")
         HTML_TAG("frame", "Frame")
         HTML_TAG("frameset", "FrameSet")
@@ -79,17 +79,17 @@ function test() {
         HTML_TAG("menu", "Shared")
         HTML_TAG("meta", "Meta")
         HTML_TAG("multicol", "Span")
         HTML_TAG("nobr", "Span")
         HTML_TAG("noembed", "Div")
         HTML_TAG("noframes", "Div")
         HTML_TAG("noscript", "Div")
         HTML_TAG("object", "Object")
-        HTML_TAG("ol", "OList")
+        HTML_TAG("ol", "SharedList")
         HTML_TAG("optgroup", "OptGroup")
         HTML_TAG("option", "Option")
         HTML_TAG("p", "Paragraph")
         HTML_TAG("param", "Shared")
         HTML_TAG("plaintext", "Span")
         HTML_TAG("pre", "Pre")
         HTML_TAG("q", "Shared")
         HTML_TAG("s", "Span")
@@ -110,17 +110,17 @@ function test() {
         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("ul", "UList")
+        HTML_TAG("ul", "SharedList")
         HTML_TAG("var", "Span")
         HTML_TAG("wbr", "Shared")
         HTML_TAG("xmp", "Span")
 
         function SVG_TAG(name) {
             allNodes.push(doc.createElementNS("http://www.w3.org/2000/svg", name));
         }
 
--- a/dom/tests/mochitest/bugs/test_bug396843.html
+++ b/dom/tests/mochitest/bugs/test_bug396843.html
@@ -55,17 +55,17 @@ HTML_TAG("cite", "Span")
 HTML_TAG("code", "Span")
 HTML_TAG("col", "TableCol")
 HTML_TAG("colgroup", "TableCol")
 HTML_TAG("dd", "Span")
 HTML_TAG("del", "Mod")
 HTML_TAG("dfn", "Span")
 HTML_TAG("dir", "Shared")
 HTML_TAG("div", "Div")
-HTML_TAG("dl", "DList")
+HTML_TAG("dl", "SharedList")
 HTML_TAG("dt", "Span")
 HTML_TAG("em", "Span")
 HTML_TAG("embed", "SharedObject")
 HTML_TAG("fieldset", "FieldSet")
 HTML_TAG("font", "Font")
 HTML_TAG("form", "Form")
 HTML_TAG("frame", "Frame")
 HTML_TAG("frameset", "FrameSet")
@@ -97,17 +97,17 @@ HTML_TAG("marquee", "Div")
 HTML_TAG("menu", "Shared")
 HTML_TAG("meta", "Meta")
 HTML_TAG("multicol", "Span")
 HTML_TAG("nobr", "Span")
 HTML_TAG("noembed", "Div")
 HTML_TAG("noframes", "Div")
 HTML_TAG("noscript", "Div")
 HTML_TAG("object", "Object")
-HTML_TAG("ol", "OList")
+HTML_TAG("ol", "SharedList")
 HTML_TAG("optgroup", "OptGroup")
 HTML_TAG("option", "Option")
 HTML_TAG("p", "Paragraph")
 HTML_TAG("param", "Shared")
 HTML_TAG("plaintext", "Span")
 HTML_TAG("pre", "Pre")
 HTML_TAG("q", "Shared")
 HTML_TAG("s", "Span")
@@ -128,17 +128,17 @@ 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("ul", "UList")
+HTML_TAG("ul", "SharedList")
 HTML_TAG("var", "Span")
 HTML_TAG("wbr", "Shared")
 HTML_TAG("xmp", "Span")
 
 function SVG_TAG(name) {
   allNodes.push(document.createElementNS("http://www.w3.org/2000/svg", name));
 }
 
--- a/parser/htmlparser/public/nsHTMLTagList.h
+++ b/parser/htmlparser/public/nsHTMLTagList.h
@@ -65,17 +65,17 @@ HTML_HTMLELEMENT_TAG(code)
 HTML_TAG(col, TableCol)
 HTML_TAG(colgroup, TableCol)
 HTML_TAG(datalist, DataList)
 HTML_HTMLELEMENT_TAG(dd)
 HTML_TAG(del, Mod)
 HTML_HTMLELEMENT_TAG(dfn)
 HTML_TAG(dir, Shared)
 HTML_TAG(div, Div)
-HTML_TAG(dl, DList)
+HTML_TAG(dl, SharedList)
 HTML_HTMLELEMENT_TAG(dt)
 HTML_HTMLELEMENT_TAG(em)
 HTML_TAG(embed, SharedObject)
 HTML_TAG(fieldset, FieldSet)
 HTML_HTMLELEMENT_TAG(figcaption)
 HTML_HTMLELEMENT_TAG(figure)
 HTML_TAG(font, Font)
 HTML_HTMLELEMENT_TAG(footer)
@@ -116,17 +116,17 @@ HTML_TAG(meta, Meta)
 HTML_TAG(meter, Meter)
 HTML_TAG(multicol, Span)
 HTML_HTMLELEMENT_TAG(nav)
 HTML_HTMLELEMENT_TAG(nobr)
 HTML_HTMLELEMENT_TAG(noembed)
 HTML_HTMLELEMENT_TAG(noframes)
 HTML_HTMLELEMENT_TAG(noscript)
 HTML_TAG(object, Object)
-HTML_TAG(ol, OList)
+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_HTMLELEMENT_TAG(plaintext)
 HTML_TAG(pre, Pre)
 HTML_TAG(progress, Progress)
@@ -152,17 +152,17 @@ 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_HTMLELEMENT_TAG(tt)
 HTML_HTMLELEMENT_TAG(u)
-HTML_TAG(ul, UList)
+HTML_TAG(ul, SharedList)
 HTML_HTMLELEMENT_TAG(var)
 #if defined(MOZ_MEDIA)
 HTML_TAG(video, Video)
 #endif
 HTML_HTMLELEMENT_TAG(wbr)
 HTML_HTMLELEMENT_TAG(xmp)