Bug 574089 - Optimize ::GetInnerHTML, r=jst

This commit is contained in:
Olli Pettay
2010-06-26 23:39:56 +03:00
parent 683e28d8b1
commit e97c029e22
10 changed files with 191 additions and 60 deletions

View File

@@ -342,7 +342,7 @@ nsHTMLDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
// Make the content type default to "text/html", we are a HTML
// document, after all. Once we start getting data, this may be
// changed.
mContentType = "text/html";
SetContentTypeInternal(nsDependentCString("text/html"));
}
nsStyleSet::sheetType
@@ -2035,7 +2035,7 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
}
// This will be propagated to the parser when someone actually calls write()
mContentType = aContentType;
SetContentTypeInternal(aContentType);
mWriteState = eDocumentOpened;
@@ -2134,7 +2134,7 @@ nsHTMLDocument::Close()
++mWriteLevel;
rv = mParser->Parse(EmptyString(), mParser->GetRootContextKey(),
mContentType, PR_TRUE);
GetContentTypeInternal(), PR_TRUE);
--mWriteLevel;
// XXX Make sure that all the document.written content is
@@ -2234,11 +2234,11 @@ nsHTMLDocument::WriteCommon(const nsAString& aText,
// why pay that price when we don't need to?
if (aNewlineTerminate) {
rv = mParser->Parse(aText + new_line,
key, mContentType,
key, GetContentTypeInternal(),
(mWriteState == eNotWriting || (mWriteLevel > 1)));
} else {
rv = mParser->Parse(aText,
key, mContentType,
key, GetContentTypeInternal(),
(mWriteState == eNotWriting || (mWriteLevel > 1)));
}