Move the methods for handling inline style and attribute style sheets up to

nsDocument.  Bug 230947, r+sr=jst


git-svn-id: svn://10.0.0.236/trunk@151678 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2004-01-22 03:35:09 +00:00
parent 3380184c21
commit 487c2df707
10 changed files with 64 additions and 171 deletions

View File

@@ -380,13 +380,7 @@ nsHTMLDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup)
mLoadFlags = nsIRequest::LOAD_NORMAL;
nsDocument::ResetToURI(aURI, aLoadGroup);
BaseResetToURI(aURI);
}
void
nsHTMLDocument::BaseResetToURI(nsIURI *aURI)
{
nsresult rv = NS_OK;
InvalidateHashTables();
@@ -403,38 +397,11 @@ nsHTMLDocument::BaseResetToURI(nsIURI *aURI)
mImageMaps.Clear();
mForms = nsnull;
if (aURI) {
if (!mAttrStyleSheet) {
rv = NS_NewHTMLStyleSheet(getter_AddRefs(mAttrStyleSheet), aURI, this);
}
else {
rv = mAttrStyleSheet->Reset(aURI);
}
if (NS_SUCCEEDED(rv)) {
// tell the world about our new style sheet
AddStyleSheet(mAttrStyleSheet, 0);
if (!mStyleAttrStyleSheet) {
rv = NS_NewHTMLCSSStyleSheet(getter_AddRefs(mStyleAttrStyleSheet),
aURI, this);
}
else {
rv = mStyleAttrStyleSheet->Reset(aURI);
}
if (NS_SUCCEEDED(rv)) {
// tell the world about our new style sheet
AddStyleSheet(mStyleAttrStyleSheet, 0);
}
}
}
NS_ASSERTION(!mWyciwygChannel,
"nsHTMLDocument::Reset() - Wyciwyg Channel still exists!");
mWyciwygChannel = nsnull;
mBaseTarget.Truncate();
// Make the content type default to "text/html", we are a HTML
// document, after all. Once we start getting data, this may be
// changed.
@@ -1233,18 +1200,6 @@ nsHTMLDocument::InternalGetNumberOfStyleSheets() const
return count;
}
void
nsHTMLDocument::GetBaseTarget(nsAString& aTarget) const
{
aTarget.Assign(mBaseTarget);
}
void
nsHTMLDocument::SetBaseTarget(const nsAString& aTarget)
{
mBaseTarget = aTarget;
}
NS_IMETHODIMP
nsHTMLDocument::SetReferrer(const nsAString& aReferrer)
{