Bug 777529 - Don't spellcheck Unicode numbers; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-07-31 11:50:04 +03:00
parent c838798089
commit 5f2eb8fa49
6 changed files with 16 additions and 3 deletions

View File

@ -96,3 +96,5 @@ skip-if(Android) == 462758-grabbers-resizers.html 462758-grabbers-resizers-ref.h
== 694880-2.html 694880-ref.html
== 694880-3.html 694880-ref.html
== 388980-1.html 388980-1-ref.html
needs-focus == spellcheck-superscript-1.html spellcheck-superscript-1-ref.html
needs-focus != spellcheck-superscript-2.html spellcheck-superscript-2-ref.html

View File

@ -0,0 +1,3 @@
<!doctype html>
<textarea spellcheck=false>&sup1; &sup2; &sup3;</textarea>
<script>document.body.firstChild.focus()</script>

View File

@ -0,0 +1,3 @@
<!doctype html>
<textarea>&sup1; &sup2; &sup3;</textarea>
<script>document.body.firstChild.focus()</script>

View File

@ -0,0 +1,3 @@
<!doctype html>
<textarea>&sup1; &sup2; &sup3; mispeled</textarea>
<script>document.body.firstChild.focus()</script>

View File

@ -0,0 +1,3 @@
<!doctype html>
<textarea spellcheck=false>&sup1; &sup2; &sup3; mispeled</textarea>
<script>document.body.firstChild.focus()</script>

View File

@ -948,10 +948,9 @@ WordSplitState::ShouldSkipWord(PRInt32 aStart, PRInt32 aLength)
// check to see if the word contains a digit
for (PRInt32 i = aStart; i < last; i ++) {
PRUnichar ch = mDOMWordText[i];
// XXX Shouldn't this be something a lot more complex, Unicode-based?
if (ch >= '0' && ch <= '9')
if (unicode::GetGenCategory(mDOMWordText[i]) == nsIUGenCategory::kNumber) {
return true;
}
}
// not special