Bug 388980. Backing out because it broke tests.

This commit is contained in:
roc+@cs.cmu.edu 2007-10-02 15:12:20 -07:00
parent ebb040acda
commit ea2328d52d
3 changed files with 3 additions and 37 deletions

View File

@ -285,7 +285,8 @@ nsHTMLEditor::Init(nsIDOMDocument *aDoc, nsIPresShell *aPresShell,
result = nsPlaintextEditor::Init(aDoc, aPresShell, aRoot, aSelCon, aFlags);
if (NS_FAILED(result)) { return result; }
UpdateCSSAwareForFlags(aFlags);
// the HTML Editor is CSS-aware only in the case of Composer
mCSSAware = (0 == aFlags);
// disable Composer-only features
if (aFlags & eEditorMailMask)
@ -416,20 +417,12 @@ nsHTMLEditor::GetFlags(PRUint32 *aFlags)
return mRules->GetFlags(aFlags);
}
void
nsHTMLEditor::UpdateCSSAwareForFlags(PRUint32 aFlags)
{
mCSSAware = ((aFlags & (eEditorNoCSSMask | eEditorMailMask)) == 0);
}
NS_IMETHODIMP
nsHTMLEditor::SetFlags(PRUint32 aFlags)
{
if (!mRules) { return NS_ERROR_NULL_POINTER; }
UpdateCSSAwareForFlags(aFlags);
mCSSAware = ((aFlags & (eEditorNoCSSMask | eEditorMailMask)) == 0);
return mRules->SetFlags(aFlags);
}
@ -5451,27 +5444,6 @@ nsHTMLEditor::SetIsCSSEnabled(PRBool aIsCSSPrefChecked)
{
err = mHTMLCSSUtils->SetCSSEnabled(aIsCSSPrefChecked);
}
// Disable the eEditorNoCSSMask flag if we're enabling StyleWithCSS.
if (NS_SUCCEEDED(err)) {
PRUint32 flags = 0;
err = GetFlags(&flags);
NS_ENSURE_SUCCESS(err, err);
if (aIsCSSPrefChecked) {
// Turn off NoCSS as we're enabling CSS
if (flags & eEditorNoCSSMask) {
flags -= eEditorNoCSSMask;
}
} else {
// Turn on NoCSS, as we're disabling CSS.
if (!(flags & eEditorNoCSSMask)) {
flags += eEditorNoCSSMask;
}
}
err = SetFlags(flags);
NS_ENSURE_SUCCESS(err, err);
}
return err;
}

View File

@ -450,11 +450,6 @@ protected:
virtual void RemoveEventListeners();
// Sets mCSSAware to correspond to aFlags. This toggles whether CSS is
// used to style elements in the editor. Note that the editor is only CSS
// aware by default in Composer and in the mail editor.
void UpdateCSSAwareForFlags(PRUint32 aFlags);
/** returns the layout object (nsIFrame in the real world) for aNode
* @param aNode the content to get a frame for
* @param aLayoutObject the "primary frame" for aNode, if one exists. May be null

View File

@ -374,7 +374,6 @@ fails == 386310-1d.html 386310-1-ref.html
== 387876-2.html 387876-2-ref.html
== 387876-3a.html 387876-3-ref.html
== 387876-3b.html 387876-3-ref.html
== 388980-1.html 388980-1-ref.html
== 389636-1.html about:blank # assertion test
== 389924-1a.html 389924-1-ref.html
== 389924-1b.html 389924-1-ref.html