mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 849422 Allow plain text document word-wrap to be turned on after the fact r=bz
This commit is contained in:
parent
674e5773f6
commit
239e82c1fa
@ -7,13 +7,16 @@
|
||||
#include "nsHtml5AttributeName.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
// static
|
||||
nsHtml5HtmlAttributes*
|
||||
nsHtml5PlainTextUtils::NewLinkAttributes()
|
||||
{
|
||||
nsHtml5HtmlAttributes* linkAttrs = new nsHtml5HtmlAttributes(0);
|
||||
nsString* rel = new nsString(NS_LITERAL_STRING("stylesheet"));
|
||||
nsString* rel = mozilla::Preferences::GetBool("plain_text.wrap_long_lines") ?
|
||||
new nsString(NS_LITERAL_STRING("stylesheet")) :
|
||||
new nsString(NS_LITERAL_STRING("alternate stylesheet"));
|
||||
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_REL, rel);
|
||||
nsString* type = new nsString(NS_LITERAL_STRING("text/css"));
|
||||
linkAttrs->addAttribute(nsHtml5AttributeName::ATTR_TYPE, type);
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsNodeUtils.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
class nsPresContext;
|
||||
|
||||
@ -729,11 +728,9 @@ nsHtml5TreeBuilder::StartPlainTextViewSource(const nsAutoString& aTitle)
|
||||
void
|
||||
nsHtml5TreeBuilder::StartPlainText()
|
||||
{
|
||||
if (mozilla::Preferences::GetBool("plain_text.wrap_long_lines", true)) {
|
||||
startTag(nsHtml5ElementName::ELT_LINK,
|
||||
nsHtml5PlainTextUtils::NewLinkAttributes(),
|
||||
false);
|
||||
}
|
||||
|
||||
StartPlainTextBody();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user