зеркало из https://github.com/mozilla/gecko-dev.git
50821: don't force a bogus 3.2 doctype, and eliminate OutputNoDoctype flag. r=cmanske
This commit is contained in:
Родитель
2ac8b0a468
Коммит
3c2341c61c
|
@ -74,8 +74,8 @@ public:
|
|||
// (Probably not well tested for HTML output.)
|
||||
OutputFormatted = 2,
|
||||
|
||||
// Don't output the html doctype and gecko output system comment headers
|
||||
OutputNoDoctype = 4,
|
||||
// OutputNoDoctype is obsolete, flag 4 available for other uses
|
||||
//OutputNoDoctype = 4,
|
||||
|
||||
// No html head tags
|
||||
OutputBodyOnly = 8,
|
||||
|
|
|
@ -857,8 +857,7 @@ nsGenericHTMLElement::GetInnerHTML(nsAWritableString& aInnerHTML)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIHTMLContentSink> sink;
|
||||
rv = NS_New_HTML_ContentSinkStream(getter_AddRefs(sink), &aInnerHTML,
|
||||
nsIDocumentEncoder::OutputNoDoctype);
|
||||
rv = NS_New_HTML_ContentSinkStream(getter_AddRefs(sink), &aInnerHTML, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
parser->SetContentSink(sink);
|
||||
|
|
|
@ -24,6 +24,13 @@
|
|||
|
||||
// --------------------------- Output ---------------------------
|
||||
|
||||
|
||||
function EditorSerialize()
|
||||
{
|
||||
var s = new XMLSerializer();
|
||||
dump(s.serializeToString(editorShell.editorDocument) + "\n");
|
||||
}
|
||||
|
||||
function EditorGetText()
|
||||
{
|
||||
if (editorShell) {
|
||||
|
|
|
@ -50,7 +50,7 @@ var gEditModeBar;
|
|||
// Bummer! Can't get at enums from nsIDocumentEncoder.h
|
||||
var gOutputSelectionOnly = 1;
|
||||
var gOutputFormatted = 2;
|
||||
var gOutputNoDoctype = 4;
|
||||
//var gOutputNoDoctype = 4; // OutputNoDoctype has been obsoleted
|
||||
var gOutputBodyOnly = 8;
|
||||
var gOutputPreformatted = 16;
|
||||
var gOutputWrap = 32;
|
||||
|
@ -895,7 +895,7 @@ function SetEditMode(mode)
|
|||
{
|
||||
// Get the entire document's source string
|
||||
|
||||
var flags = gOutputNoDoctype | gOutputEncodeEntities;
|
||||
var flags = gOutputEncodeEntities;
|
||||
//
|
||||
var prettyPrint = gPrefs.GetBoolPref("editor.prettyprint");
|
||||
if (prettyPrint)
|
||||
|
|
|
@ -790,6 +790,8 @@
|
|||
oncommand="EditorGetHTML()"/>
|
||||
<menuitem value="&outputXIFCmd.label;"
|
||||
oncommand="EditorGetXIF()"/>
|
||||
<menuitem value="Dom Serializer"
|
||||
oncommand="EditorSerialize()"/>
|
||||
<menuseparator />
|
||||
<menuitem value="&pasteAsQuotationCmd.label;"
|
||||
accesskey="&editpastequotation.accesskey;"
|
||||
|
|
|
@ -54,8 +54,6 @@ static NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
|||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
static char* gHeaderComment = "<!-- This page was created by the Gecko output system. -->";
|
||||
static char* gDocTypeHeader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">";
|
||||
const int gTabSize=2;
|
||||
|
||||
static const nsString gMozDirty = NS_ConvertToString("_moz_dirty");
|
||||
|
@ -134,9 +132,6 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream,
|
|||
|
||||
mBodyOnly = (aFlags & nsIDocumentEncoder::OutputBodyOnly) ? PR_TRUE
|
||||
: PR_FALSE;
|
||||
mDoHeader = (!mBodyOnly) && (mDoFormat) &&
|
||||
((aFlags & nsIDocumentEncoder::OutputNoDoctype) ? PR_FALSE
|
||||
: PR_TRUE);
|
||||
mMaxColumn = 72;
|
||||
mFlags = aFlags;
|
||||
|
||||
|
@ -716,17 +711,6 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode)
|
|||
|
||||
if (IndentChildren(tag))
|
||||
mIndent++;
|
||||
|
||||
if (tag == eHTMLTag_head)
|
||||
{
|
||||
if(mDoHeader)
|
||||
{
|
||||
Write(gHeaderComment);
|
||||
Write(mLineBreak);
|
||||
Write(gDocTypeHeader);
|
||||
Write(mLineBreak);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode)
|
||||
|
|
|
@ -198,7 +198,6 @@ protected:
|
|||
nsCOMPtr<nsIURI> mURI;
|
||||
|
||||
PRBool mDoFormat;
|
||||
PRBool mDoHeader;
|
||||
PRBool mBodyOnly;
|
||||
PRBool mHasOpenHtmlTag;
|
||||
PRInt32 mPreLevel;
|
||||
|
|
|
@ -74,8 +74,8 @@ public:
|
|||
// (Probably not well tested for HTML output.)
|
||||
OutputFormatted = 2,
|
||||
|
||||
// Don't output the html doctype and gecko output system comment headers
|
||||
OutputNoDoctype = 4,
|
||||
// OutputNoDoctype is obsolete, flag 4 available for other uses
|
||||
//OutputNoDoctype = 4,
|
||||
|
||||
// No html head tags
|
||||
OutputBodyOnly = 8,
|
||||
|
|
|
@ -857,8 +857,7 @@ nsGenericHTMLElement::GetInnerHTML(nsAWritableString& aInnerHTML)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIHTMLContentSink> sink;
|
||||
rv = NS_New_HTML_ContentSinkStream(getter_AddRefs(sink), &aInnerHTML,
|
||||
nsIDocumentEncoder::OutputNoDoctype);
|
||||
rv = NS_New_HTML_ContentSinkStream(getter_AddRefs(sink), &aInnerHTML, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
parser->SetContentSink(sink);
|
||||
|
|
|
@ -1664,7 +1664,7 @@ void nsGfxTextControlFrame::GetTextControlFrameState(nsString& aValue)
|
|||
PRUint32 flags = 0;
|
||||
|
||||
if (PR_TRUE==IsPlainTextControl()) {
|
||||
flags |= nsIDocumentEncoder::OutputBodyOnly; // OutputNoDoctype if head info needed
|
||||
flags |= nsIDocumentEncoder::OutputBodyOnly;
|
||||
}
|
||||
|
||||
nsFormControlHelper::nsHTMLTextWrap wrapProp;
|
||||
|
|
|
@ -2892,7 +2892,7 @@ void nsGfxTextControlFrame2::GetTextControlFrameState(nsAWritableString& aValue)
|
|||
PRUint32 flags = nsIDocumentEncoder::OutputLFLineBreak;;
|
||||
|
||||
if (PR_TRUE==IsPlainTextControl()) {
|
||||
flags |= nsIDocumentEncoder::OutputBodyOnly; // OutputNoDoctype if head info needed
|
||||
flags |= nsIDocumentEncoder::OutputBodyOnly;
|
||||
}
|
||||
|
||||
nsFormControlHelper::nsHTMLTextWrap wrapProp;
|
||||
|
|
|
@ -54,8 +54,6 @@ static NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
|||
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
|
||||
|
||||
static char* gHeaderComment = "<!-- This page was created by the Gecko output system. -->";
|
||||
static char* gDocTypeHeader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">";
|
||||
const int gTabSize=2;
|
||||
|
||||
static const nsString gMozDirty = NS_ConvertToString("_moz_dirty");
|
||||
|
@ -134,9 +132,6 @@ nsHTMLContentSinkStream::Initialize(nsIOutputStream* aOutStream,
|
|||
|
||||
mBodyOnly = (aFlags & nsIDocumentEncoder::OutputBodyOnly) ? PR_TRUE
|
||||
: PR_FALSE;
|
||||
mDoHeader = (!mBodyOnly) && (mDoFormat) &&
|
||||
((aFlags & nsIDocumentEncoder::OutputNoDoctype) ? PR_FALSE
|
||||
: PR_TRUE);
|
||||
mMaxColumn = 72;
|
||||
mFlags = aFlags;
|
||||
|
||||
|
@ -716,17 +711,6 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode)
|
|||
|
||||
if (IndentChildren(tag))
|
||||
mIndent++;
|
||||
|
||||
if (tag == eHTMLTag_head)
|
||||
{
|
||||
if(mDoHeader)
|
||||
{
|
||||
Write(gHeaderComment);
|
||||
Write(mLineBreak);
|
||||
Write(gDocTypeHeader);
|
||||
Write(mLineBreak);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode)
|
||||
|
|
|
@ -198,7 +198,6 @@ protected:
|
|||
nsCOMPtr<nsIURI> mURI;
|
||||
|
||||
PRBool mDoFormat;
|
||||
PRBool mDoHeader;
|
||||
PRBool mBodyOnly;
|
||||
PRBool mHasOpenHtmlTag;
|
||||
PRInt32 mPreLevel;
|
||||
|
|
Загрузка…
Ссылка в новой задаче