зеркало из https://github.com/mozilla/gecko-dev.git
Bug 569397 - Eagerly initialize the input controls with spellcheck="true"; r=roc ui-r=faaborg approval2.0=benjamin
This commit is contained in:
Родитель
3abf2243f2
Коммит
48b4d58926
|
@ -119,6 +119,7 @@
|
||||||
#include "nsFocusManager.h"
|
#include "nsFocusManager.h"
|
||||||
#include "nsTextEditRules.h"
|
#include "nsTextEditRules.h"
|
||||||
#include "nsIFontMetrics.h"
|
#include "nsIFontMetrics.h"
|
||||||
|
#include "nsIDOMNSHTMLElement.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
#include "mozilla/FunctionTimer.h"
|
||||||
|
|
||||||
|
@ -443,8 +444,17 @@ nsTextControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
|
||||||
rv = UpdateValueDisplay(PR_FALSE);
|
rv = UpdateValueDisplay(PR_FALSE);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
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(),
|
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||||
"Someone forgot a script blocker?");
|
"Someone forgot a script blocker?");
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,4 @@ include xul/reftest.list
|
||||||
== emptypasswd-1.html emptypasswd-ref.html
|
== emptypasswd-1.html emptypasswd-ref.html
|
||||||
== emptypasswd-2.html emptypasswd-ref.html
|
== emptypasswd-2.html emptypasswd-ref.html
|
||||||
== caret_on_positioned.html caret_on_positioned-ref.html
|
== caret_on_positioned.html caret_on_positioned-ref.html
|
||||||
|
== spellcheck-1.html spellcheck-ref.html
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<input type="text" value="blahblahblah" spellcheck="true">
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<input type="text" value="blahblahblah" spellcheck="true">
|
||||||
|
<script>
|
||||||
|
var i = document.getElementsByTagName("input")[0];
|
||||||
|
i.focus(); // init the editor
|
||||||
|
i.blur(); // we actually don't need the focus
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче