Bug 598482 part 6 - Remove nsIPlaintextEditor::eEditorUseAsyncUpdatesMask because it doesn't have any effect anymore. r=roc
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1155,20 +1155,16 @@ nsTextEditorState::PrepareEditor(const n
if (IsSingleLineTextControl())
editorFlags |= nsIPlaintextEditor::eEditorSingleLineMask;
if (IsPasswordTextControl())
editorFlags |= nsIPlaintextEditor::eEditorPasswordMask;
// All nsTextControlFrames are widgets
editorFlags |= nsIPlaintextEditor::eEditorWidgetMask;
- // Use async reflow and painting for text widgets to improve
- // performance.
- editorFlags |= nsIPlaintextEditor::eEditorUseAsyncUpdatesMask;
-
// Spell check is diabled at creation time. It is enabled once
// the editor comes into focus.
editorFlags |= nsIPlaintextEditor::eEditorSkipSpellCheck;
bool shouldInitializeEditor = false;
nsCOMPtr<nsIEditor> newEditor; // the editor that we might create
nsresult rv = NS_OK;
if (!mEditor) {
@@ -1309,22 +1305,17 @@ nsTextEditorState::PrepareEditor(const n
}
// If we have a default value, insert it under the div we created
// above, but be sure to use the editor so that '*' characters get
// displayed for password fields, etc. SetValue() will call the
// editor for us.
if (!defaultValue.IsEmpty()) {
- // Avoid causing reentrant painting and reflowing by telling the editor
- // that we don't want it to force immediate view refreshes or force
- // immediate reflows during any editor calls.
-
- rv = newEditor->SetFlags(editorFlags |
- nsIPlaintextEditor::eEditorUseAsyncUpdatesMask);
+ rv = newEditor->SetFlags(editorFlags);
NS_ENSURE_SUCCESS(rv, rv);
// Now call SetValue() which will make the necessary editor calls to set
// the default value. Make sure to turn off undo before setting the default
// value, and turn it back on afterwards. This will make sure we can't undo
// past the default value.
rv = newEditor->EnableUndo(false);
@@ -1832,17 +1823,16 @@ nsTextEditorState::SetValue(const nsAStr
// get the flags, remove readonly and disabled, set the value,
// restore flags
PRUint32 flags, savedFlags;
mEditor->GetFlags(&savedFlags);
flags = savedFlags;
flags &= ~(nsIPlaintextEditor::eEditorDisabledMask);
flags &= ~(nsIPlaintextEditor::eEditorReadonlyMask);
- flags |= nsIPlaintextEditor::eEditorUseAsyncUpdatesMask;
flags |= nsIPlaintextEditor::eEditorDontEchoPassword;
mEditor->SetFlags(flags);
mTextListener->SettingValue(true);
// Also don't enforce max-length here
PRInt32 savedMaxLength;
plaintextEditor->GetMaxTextLength(&savedMaxLength);
--- a/editor/idl/nsIPlaintextEditor.idl
+++ b/editor/idl/nsIPlaintextEditor.idl
@@ -32,17 +32,17 @@
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
-[scriptable, uuid(05d312ef-8914-494e-91c9-2be8ed7f8e29)]
+[scriptable, uuid(07b6d070-ccea-4a00-84b4-f4b94dd9eb52)]
interface nsIPlaintextEditor : nsISupports
{
// XXX Why aren't these in nsIEditor?
// only plain text entry is allowed via events
const long eEditorPlaintextMask = 0x0001;
// enter key and CR-LF handled specially
const long eEditorSingleLineMask = 0x0002;
@@ -51,39 +51,37 @@ interface nsIPlaintextEditor : nsISuppor
// editing events are disabled. Editor may still accept focus.
const long eEditorReadonlyMask = 0x0008;
// all events are disabled (like scrolling). Editor will not accept focus.
const long eEditorDisabledMask = 0x0010;
// text input is limited to certain character types, use mFilter
const long eEditorFilterInputMask = 0x0020;
// use mail-compose editing rules
const long eEditorMailMask = 0x0040;
- // prevent immediate reflows and view refreshes
- const long eEditorUseAsyncUpdatesMask = 0x0080;
// allow the editor to set font: monospace on the root node
- const long eEditorEnableWrapHackMask = 0x0100;
+ const long eEditorEnableWrapHackMask = 0x0080;
// bit for widgets (form elements)
- const long eEditorWidgetMask = 0x0200;
+ const long eEditorWidgetMask = 0x0100;
// this HTML editor should not create css styles
- const long eEditorNoCSSMask = 0x0400;
+ const long eEditorNoCSSMask = 0x0200;
// whether HTML document specific actions are executed or not.
// e.g., if this flag is set, the editor doesn't handle Tab key.
// besides, anchors of HTML are not clickable.
- const long eEditorAllowInteraction = 0x0800;
+ const long eEditorAllowInteraction = 0x0400;
// when this is set, the characters in password editor are always masked.
// see bug 530367 for the detail.
- const long eEditorDontEchoPassword = 0x1000;
+ const long eEditorDontEchoPassword = 0x0800;
// when this flag is set, the internal direction of the editor is RTL.
// if neither of the direction flags are set, the direction is determined
// from the text control's content node.
- const long eEditorRightToLeft = 0x2000;
+ const long eEditorRightToLeft = 0x1000;
// when this flag is set, the internal direction of the editor is LTR.
- const long eEditorLeftToRight = 0x4000;
+ const long eEditorLeftToRight = 0x2000;
// when this flag is set, the editor's text content is not spell checked.
- const long eEditorSkipSpellCheck = 0x8000;
+ const long eEditorSkipSpellCheck = 0x4000;
/*
* The valid values for newlines handling.
* Can't change the values unless we remove
* use of the pref.
*/
const long eNewlinesPasteIntact = 0;
const long eNewlinesPasteToFirst = 1;
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -4245,29 +4245,17 @@ nsresult nsEditor::EndUpdateViewBatch()
nsRefPtr<nsCaret> caret;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (presShell)
caret = presShell->GetCaret();
StCaretHider caretHider(caret);
- PRUint32 flags = 0;
-
- GetFlags(&flags);
-
- // Turn view updating back on.
- PRUint32 updateFlag = NS_VMREFRESH_IMMEDIATE;
-
- // If we're doing async updates, use NS_VMREFRESH_DEFERRED here, so that
- // the reflows we caused will get processed before the invalidates.
- if (flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask) {
- updateFlag = NS_VMREFRESH_DEFERRED;
- }
- mBatch.EndUpdateViewBatch(updateFlag);
+ mBatch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
// Turn selection updating and notifications back on.
nsCOMPtr<nsISelection>selection;
GetSelection(getter_AddRefs(selection));
if (selection) {
nsCOMPtr<nsISelectionPrivate>selPrivate(do_QueryInterface(selection));
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -684,21 +684,16 @@ public:
return (mFlags & nsIPlaintextEditor::eEditorFilterInputMask) != 0;
}
bool IsMailEditor() const
{
return (mFlags & nsIPlaintextEditor::eEditorMailMask) != 0;
}
- bool UseAsyncUpdate() const
- {
- return (mFlags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask) != 0;
- }
-
bool IsWrapHackEnabled() const
{
return (mFlags & nsIPlaintextEditor::eEditorEnableWrapHackMask) != 0;
}
bool IsFormWidget() const
{
return (mFlags & nsIPlaintextEditor::eEditorWidgetMask) != 0;