Bug 568515 - xmp and plaintext element should be considered as HTMLElement, not HTMLSpanElement, r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Tue, 22 Jun 2010 02:02:07 +0200
changeset 43929 11aa64d1d6121f90b5b3050dad8622f1ea83952c
parent 43928 b793c7686b4fa734872fb4ddbcc2364dd64e1e06
child 43930 7dd91f75d0ec8af504ef363222a05b912cab3fd7
child 43931 f5a0a14bf066094783daf899835b7b8b5873a868
push idunknown
push userunknown
push dateunknown
reviewerssicking
bugs568515
milestone1.9.3a6pre
Bug 568515 - xmp and plaintext element should be considered as HTMLElement, not HTMLSpanElement, r=sicking
content/html/content/src/nsHTMLSpanElement.cpp
content/html/content/test/test_bug389797.html
parser/htmlparser/public/nsHTMLTagList.h
--- a/content/html/content/src/nsHTMLSpanElement.cpp
+++ b/content/html/content/src/nsHTMLSpanElement.cpp
@@ -56,19 +56,16 @@ public:
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
-  virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
-  virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
-
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Span)
 
 
 nsHTMLSpanElement::nsHTMLSpanElement(nsINodeInfo *aNodeInfo)
@@ -93,39 +90,16 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLSpanElemen
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSpanElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLSpanElement)
 
 
 NS_IMPL_ELEMENT_CLONE(nsHTMLSpanElement)
 
 
-nsresult
-nsHTMLSpanElement::GetInnerHTML(nsAString& aInnerHTML)
-{
-  if (mNodeInfo->Equals(nsGkAtoms::xmp) ||
-      mNodeInfo->Equals(nsGkAtoms::plaintext)) {
-    nsContentUtils::GetNodeTextContent(this, PR_FALSE, aInnerHTML);
-    return NS_OK;
-  }
-
-  return nsGenericHTMLElement::GetInnerHTML(aInnerHTML);  
-}
-
-nsresult
-nsHTMLSpanElement::SetInnerHTML(const nsAString& aInnerHTML)
-{
-  if (mNodeInfo->Equals(nsGkAtoms::xmp) ||
-      mNodeInfo->Equals(nsGkAtoms::plaintext)) {
-    return nsContentUtils::SetNodeTextContent(this, aInnerHTML, PR_TRUE);
-  }
-
-  return nsGenericHTMLElement::SetInnerHTML(aInnerHTML);
-}
-
 // ------------------------------------------------------------------
 
 class nsHTMLUnknownElement : public nsHTMLSpanElement
 {
 public:
   nsHTMLUnknownElement(nsINodeInfo *aNodeInfo);
 
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
--- a/content/html/content/test/test_bug389797.html
+++ b/content/html/content/test/test_bug389797.html
@@ -193,17 +193,17 @@ HTML_TAG("noframes", "Div");
 HTML_TAG("noscript", "Div");
 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", "Span");
+HTML_TAG("plaintext", ""); // HTMLElement
 HTML_TAG("pre", "Pre");
 HTML_TAG("q", "Quote");
 HTML_TAG("s", "Span");
 HTML_TAG("samp", "Span");
 HTML_TAG("script", "Script", [], [ "nsIScriptLoaderObserver" ]);
 HTML_TAG("section", "") // HTMLElement
 HTML_TAG("select", "Select");
 HTML_TAG("small", "Span");
@@ -223,17 +223,17 @@ 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("var", "Span");
 HTML_TAG("wbr", "WBR");
-HTML_TAG("xmp", "Span");
+HTML_TAG("xmp", ""); // HTMLElement
 
 function tagName(aTag) {
   return "<" + aTag + ">";
 }
 
 for each (var tag in allTags) {
   var node = document.createElement(tag);
 
--- a/parser/htmlparser/public/nsHTMLTagList.h
+++ b/parser/htmlparser/public/nsHTMLTagList.h
@@ -144,17 +144,17 @@ HTML_TAG(noframes, Div)
 HTML_TAG(noscript, Div)
 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, Span)
+HTML_TAG(plaintext, ) // HTMLElement instance
 HTML_TAG(pre, Pre)
 HTML_TAG(q, Shared)
 HTML_TAG(s, Span)
 HTML_TAG(samp, Span)
 HTML_TAG(script, Script)
 HTML_TAG(section, ) // HTMLElement instance
 HTML_TAG(select, Select)
 HTML_TAG(small, Span)
@@ -180,17 +180,17 @@ HTML_TAG(tr, TableRow)
 HTML_TAG(tt, Span)
 HTML_TAG(u, Span)
 HTML_TAG(ul, SharedList)
 HTML_TAG(var, Span)
 #if defined(MOZ_MEDIA)
 HTML_TAG(video, Video)
 #endif
 HTML_TAG(wbr, Shared)
-HTML_TAG(xmp, Span)
+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)
 HTML_OTHER(newline)