mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
25660: don't copy JS comments onto plaintext clipboard. r=sfraser
This commit is contained in:
parent
2071865ff0
commit
6b70e2a224
@ -647,7 +647,7 @@ nsHTMLToTXTSinkStream::CloseContainer(const nsIParserNode& aNode)
|
||||
(type == eHTMLTag_pre) ||
|
||||
(type == eHTMLTag_blockquote)) {
|
||||
EnsureVerticalSpace(0);
|
||||
} else {
|
||||
} else if (type != eHTMLTag_script) {
|
||||
// All other blocks get 1 vertical space after them
|
||||
// in formatted mode, otherwise 0.
|
||||
// This is hard. Sometimes 0 is a better number, but
|
||||
@ -755,6 +755,11 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode)
|
||||
// Might be nice, eventually, to output just the selected element.
|
||||
return NS_OK;
|
||||
}
|
||||
else if (mTagStackIndex > 0 && mTagStack[mTagStackIndex-1] == eHTMLTag_script)
|
||||
{
|
||||
// Don't output the contents of <script> tags;
|
||||
return NS_OK;
|
||||
}
|
||||
else if (type == eHTMLTag_text)
|
||||
{
|
||||
// Bug 31994 says we shouldn't output the contents of SELECT elements.
|
||||
|
@ -647,7 +647,7 @@ nsHTMLToTXTSinkStream::CloseContainer(const nsIParserNode& aNode)
|
||||
(type == eHTMLTag_pre) ||
|
||||
(type == eHTMLTag_blockquote)) {
|
||||
EnsureVerticalSpace(0);
|
||||
} else {
|
||||
} else if (type != eHTMLTag_script) {
|
||||
// All other blocks get 1 vertical space after them
|
||||
// in formatted mode, otherwise 0.
|
||||
// This is hard. Sometimes 0 is a better number, but
|
||||
@ -755,6 +755,11 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode)
|
||||
// Might be nice, eventually, to output just the selected element.
|
||||
return NS_OK;
|
||||
}
|
||||
else if (mTagStackIndex > 0 && mTagStack[mTagStackIndex-1] == eHTMLTag_script)
|
||||
{
|
||||
// Don't output the contents of <script> tags;
|
||||
return NS_OK;
|
||||
}
|
||||
else if (type == eHTMLTag_text)
|
||||
{
|
||||
// Bug 31994 says we shouldn't output the contents of SELECT elements.
|
||||
|
Loading…
Reference in New Issue
Block a user