[Webkit-unassigned] [Bug 45730] API to support localized numbers for <input type=number>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 8 10:27:38 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45730





--- Comment #9 from Alexey Proskuryakov <ap at webkit.org>  2010-10-08 10:27:38 PST ---
 static bool isNumberCharacter(UChar ch)
 {
-    return ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E'
-        || (ch >= '0' && ch <= '9');
+    return isLocalizedNumberCharacter(ch) || ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E' || (ch >= '0' && ch <= '9');
 }

This is confusing. Where does the definition come from? For example, a comment before isLocalizedNumberCharacter() says that it includes both period and comma for U.S. locale. But this only forces period. Why?

+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -693,7 +693,7 @@ void RenderTextControlSingleLine::updateFromElement()
                 shouldUpdateValue = static_cast<HTMLTextFormControlElement*>(node())->supportsPlaceholder() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer();
             }
             if (shouldUpdateValue)
-                setInnerTextValue(inputElement()->value());
+                setInnerTextValue(inputElement()->visibleValue());
         }

What is this change expected to provide? It seems out of place in a bug that adds an API. ChangeLog comment doesn't explain the reason for this change.

The concept of "visibleValue" in general seems unclear. How is one supposed to perform DOM manipulation if rendered value is different from DOM value? E.g. what if JS code want to select part of the number in the input field?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list