Bug 569397 - Eagerly initialize the input controls with spellcheck="true"; r=roc ui-r=faaborg approval2.0=benjamin

This commit is contained in:
Ehsan Akhgari
2010-06-02 22:39:29 -04:00
parent ed398af2c1
commit a258f73433
4 changed files with 30 additions and 2 deletions

View File

@@ -119,6 +119,7 @@
#include "nsFocusManager.h"
#include "nsTextEditRules.h"
#include "nsIFontMetrics.h"
#include "nsIDOMNSHTMLElement.h"
#include "mozilla/FunctionTimer.h"
@@ -443,8 +444,17 @@ nsTextControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
rv = UpdateValueDisplay(PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
if (!IsSingleLineTextControl()) {
// textareas are eagerly initialized
// textareas are eagerly initialized
PRBool initEagerly = !IsSingleLineTextControl();
if (!initEagerly) {
nsCOMPtr<nsIDOMNSHTMLElement> element = do_QueryInterface(txtCtrl);
if (element) {
// so are input text controls with spellcheck=true
element->GetSpellcheck(&initEagerly);
}
}
if (initEagerly) {
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Someone forgot a script blocker?");