From 927dd89b53f9301964f77ae9bc6b53dd453f294b Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Fri, 17 Mar 2000 22:15:14 +0000 Subject: [PATCH] 31994: don't output text nodes inside select elements. r=slamm --- htmlparser/src/nsHTMLToTXTSinkStream.cpp | 4 +++- parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 0effffcce199..b79e429157e2 100644 --- a/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -765,7 +765,9 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode) } else if (type == eHTMLTag_text) { - Write(text); + // Bug 31994 says we shouldn't output the contents of SELECT elements. + if (mTagStackIndex <= 0 || (mTagStack[mTagStackIndex-1] != eHTMLTag_select)) + Write(text); } else if (type == eHTMLTag_entity) { diff --git a/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 0effffcce199..b79e429157e2 100644 --- a/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -765,7 +765,9 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode) } else if (type == eHTMLTag_text) { - Write(text); + // Bug 31994 says we shouldn't output the contents of SELECT elements. + if (mTagStackIndex <= 0 || (mTagStack[mTagStackIndex-1] != eHTMLTag_select)) + Write(text); } else if (type == eHTMLTag_entity) {