From b19d8dfb731fee48bb4f40a6eea270f388bc1374 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Tue, 22 Jun 2010 02:02:07 +0200 Subject: [PATCH] Bug 568515 - xmp and plaintext element should be considered as HTMLElement, not HTMLSpanElement, r=sicking --- .../html/content/src/nsHTMLSpanElement.cpp | 26 ------------------- content/html/content/test/test_bug389797.html | 4 +-- parser/htmlparser/public/nsHTMLTagList.h | 4 +-- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/content/html/content/src/nsHTMLSpanElement.cpp b/content/html/content/src/nsHTMLSpanElement.cpp index 675616ad683c..974ac84cb3b7 100644 --- a/content/html/content/src/nsHTMLSpanElement.cpp +++ b/content/html/content/src/nsHTMLSpanElement.cpp @@ -61,9 +61,6 @@ public: // nsIDOMHTMLElement NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::) - virtual nsresult GetInnerHTML(nsAString& aInnerHTML); - virtual nsresult SetInnerHTML(const nsAString& aInnerHTML); - virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; }; @@ -98,29 +95,6 @@ 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 diff --git a/content/html/content/test/test_bug389797.html b/content/html/content/test/test_bug389797.html index 306e9a888224..23a3cc9fc5de 100644 --- a/content/html/content/test/test_bug389797.html +++ b/content/html/content/test/test_bug389797.html @@ -198,7 +198,7 @@ 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"); @@ -228,7 +228,7 @@ 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 + ">"; diff --git a/parser/htmlparser/public/nsHTMLTagList.h b/parser/htmlparser/public/nsHTMLTagList.h index d74771c4f083..820020af7bfe 100644 --- a/parser/htmlparser/public/nsHTMLTagList.h +++ b/parser/htmlparser/public/nsHTMLTagList.h @@ -149,7 +149,7 @@ 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) @@ -185,7 +185,7 @@ HTML_TAG(var, Span) 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