Bug 221820 - Part 2: Make the editor initialization lazy (initialize only when needed); r=bzbarsky

This commit is contained in:
Ehsan Akhgari
2010-02-02 10:49:55 -05:00
parent d08ea00350
commit 6521460f37
4 changed files with 140 additions and 11 deletions

View File

@@ -275,17 +275,29 @@ protected:
* @return whether this control is scrollable
*/
PRBool IsScrollable() const;
/**
* Update the textnode under our anonymous div to show the new
* value. This should only be called when we have no editor yet.
* @throws NS_ERROR_UNEXPECTED if the div has no text content
*/
nsresult UpdateValueDisplay(PRBool aNotify,
PRBool aBeforeEditorInit = PR_FALSE,
const nsAString *aValue = nsnull);
/**
* Strip all \n, \r and nulls from the given string
* @param aString the string to remove newlines from [in/out]
*/
void RemoveNewlines(nsString &aString);
/**
* Get the maxlength attribute
* @param aMaxLength the value of the max length attr
* @returns PR_FALSE if attr not defined
*/
PRBool GetMaxLength(PRInt32* aMaxLength);
/**
* Find out whether an attribute exists on the content or not.
* @param aAtt the attribute to determine the existence of
@@ -299,9 +311,6 @@ protected:
* @param aPresContext the current pres context
*/
void PreDestroy();
/**
* Fire the onChange event.
*/
// Helper methods
/**
@@ -309,10 +318,12 @@ protected:
* @return the number of columns to use
*/
PRInt32 GetCols();
/**
* Get the column index to wrap at, or -1 if we shouldn't wrap
*/
PRInt32 GetWrapCols();
/**
* Get the rows attribute (if textarea) or a default
* @return the number of rows to use