Bug 253564 - Plain text (text/plain, text/javascript, text/css, etc) documents should word-wrap. r=bz

This commit is contained in:
Jared Wein
2013-03-06 23:45:08 -05:00
parent 7b20eaf61b
commit 5c55a24656
11 changed files with 91 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
#include "nsNodeUtils.h"
#include "nsIFrame.h"
#include "mozilla/Likely.h"
#include "mozilla/Preferences.h"
class nsPresContext;
@@ -722,11 +723,23 @@ nsHtml5TreeBuilder::StartPlainTextViewSource(const nsAutoString& aTitle)
nsHtml5ViewSourceUtils::NewBodyAttributes(),
false);
StartPlainText();
StartPlainTextBody();
}
void
nsHtml5TreeBuilder::StartPlainText()
{
if (mozilla::Preferences::GetBool("plain_text.wrap_long_lines", true)) {
startTag(nsHtml5ElementName::ELT_LINK,
nsHtml5PlainTextUtils::NewLinkAttributes(),
false);
}
StartPlainTextBody();
}
void
nsHtml5TreeBuilder::StartPlainTextBody()
{
startTag(nsHtml5ElementName::ELT_PRE,
nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES,