Title: [86926] trunk/Source/WebCore
- Revision
- 86926
- Author
- [email protected]
- Date
- 2011-05-19 23:37:01 -0700 (Thu, 19 May 2011)
Log Message
2011-05-19 Naoki Takano <[email protected]>
Reviewed by Kent Tamura.
Fix a problem that updating HTMLInputElement::value sets the cursor to a wrong position.
https://bugs.webkit.org/show_bug.cgi?id=61163
Manual test input-number-localization.html.
Because we can't assume any number formats in various WebKit ports.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue): The cursor must be the last position of visibleValue(), not m_value.
* manual-tests/input-number-localization.html: Added manual test to check the cursor correctly moved to the last poisition of the input.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (86925 => 86926)
--- trunk/Source/WebCore/ChangeLog 2011-05-20 06:25:39 UTC (rev 86925)
+++ trunk/Source/WebCore/ChangeLog 2011-05-20 06:37:01 UTC (rev 86926)
@@ -1,3 +1,17 @@
+2011-05-19 Naoki Takano <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ Fix a problem that updating HTMLInputElement::value sets the cursor to a wrong position.
+ https://bugs.webkit.org/show_bug.cgi?id=61163
+
+ Manual test input-number-localization.html.
+ Because we can't assume any number formats in various WebKit ports.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setValue): The cursor must be the last position of visibleValue(), not m_value.
+ * manual-tests/input-number-localization.html: Added manual test to check the cursor correctly moved to the last poisition of the input.
+
2011-05-19 Jer Noble <[email protected]>
Reviewed by Maciej Stachowiak.
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (86925 => 86926)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2011-05-20 06:25:39 UTC (rev 86925)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2011-05-20 06:37:01 UTC (rev 86926)
@@ -943,7 +943,7 @@
setNeedsValidityCheck();
if (isTextField()) {
- unsigned max = m_value.length();
+ unsigned max = visibleValue().length();
if (document()->focusedNode() == this)
WebCore::setSelectionRange(this, max, max);
else
Modified: trunk/Source/WebCore/manual-tests/input-number-localization.html (86925 => 86926)
--- trunk/Source/WebCore/manual-tests/input-number-localization.html 2011-05-20 06:25:39 UTC (rev 86925)
+++ trunk/Source/WebCore/manual-tests/input-number-localization.html 2011-05-20 06:37:01 UTC (rev 86926)
@@ -21,6 +21,11 @@
<div><input type=number id=target step=any _oninput_="handleInput()"></div>
<div>Standard format: <output id=output></output></div>
+<p>Input test: Type the number text "1234" into the the followin number field.
+The number string will be "1,234" and the cursor position must be the last position.
+</p>
+<div><input type="number" _onkeyup_="this.value=this.value" /></div>
+
<script>
function handleInput() {
document.getElementById('output').value = document.getElementById('target').value;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes