Diff
Copied: branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message-expected.txt (from rev 121019, trunk/LayoutTests/fast/forms/date/input-date-validation-message-expected.txt) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message-expected.txt (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message-expected.txt 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,21 @@
+Test for validationMessage IDL attribute for <input type=date>
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+No message
+PASS testIt("", "", "") is ""
+Value missing
+PASS testIt("", "", "") is "value missing"
+Type mismatch
+PASS testIt("foo", "", "") is ""
+Range overflow
+PASS testIt("1982-11-02", "", "1970-12-31") is "range overflow"
+Range underflow
+PASS testIt("1982-11-02", "1990-05-25", "1990-12-24") is "range underflow"
+Step mismatch
+PASS testIt("1982-11-02", "", "", "123") is "step mismatch"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message.html (from rev 121019, trunk/LayoutTests/fast/forms/date/input-date-validation-message.html) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message.html (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/date/input-date-validation-message.html 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('Test for validationMessage IDL attribute for <input type=date>');
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+parent.innerHTML = '<input type=date id=date maxlength=1 pattern=x>';
+var input = document.getElementById('date');
+
+function testIt(value, min, max, step)
+{
+ input.setAttribute("max", max);
+ input.setAttribute("min", min);
+ input.setAttribute("step", step);
+ input.setAttribute("value", value);
+ return input.validationMessage;
+}
+
+debug('No message')
+shouldBeEqualToString('testIt("", "", "")', '');
+
+debug('Value missing')
+input.setAttribute("required", "");
+shouldBeEqualToString('testIt("", "", "")', 'value missing');
+input.removeAttribute("required");
+
+debug('Type mismatch');
+shouldBeEqualToString('testIt("foo", "", "")', '');
+
+debug('Range overflow')
+shouldBeEqualToString('testIt("1982-11-02", "", "1970-12-31")', 'range overflow');
+
+debug('Range underflow')
+shouldBeEqualToString('testIt("1982-11-02", "1990-05-25", "1990-12-24")', 'range underflow');
+
+debug('Step mismatch')
+shouldBeEqualToString('testIt("1982-11-02", "", "", "123")', 'step mismatch');
+
+</script>
+<script src=""
+</body>
+</html>
Copied: branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message-expected.txt (from rev 121019, trunk/LayoutTests/fast/forms/number/input-number-validation-message-expected.txt) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message-expected.txt (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message-expected.txt 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,21 @@
+Test for validationMessage IDL attribute for <input type=number>
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+No message
+PASS testIt("", "", "") is ""
+Value missing
+PASS testIt("", "", "") is "value missing"
+Type mismatch
+PASS testIt("foo", "", "") is ""
+Range overflow
+PASS testIt("200", "", "100") is "range overflow"
+Range underflow
+PASS testIt("10", "50", "100") is "range underflow"
+Step mismatch
+PASS testIt("55", "0", "100", "10") is "step mismatch"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message.html (from rev 121019, trunk/LayoutTests/fast/forms/number/input-number-validation-message.html) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message.html (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/number/input-number-validation-message.html 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('Test for validationMessage IDL attribute for <input type=number>');
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+parent.innerHTML = '<input type=number id=number maxlength=1 pattern=x>';
+var input = document.getElementById('number');
+
+function testIt(value, min, max, step)
+{
+ input.setAttribute("max", max);
+ input.setAttribute("min", min);
+ input.setAttribute("step", step);
+ input.setAttribute("value", value);
+ return input.validationMessage;
+}
+
+debug('No message')
+shouldBeEqualToString('testIt("", "", "")', '');
+
+debug('Value missing')
+input.setAttribute("required", "");
+shouldBeEqualToString('testIt("", "", "")', 'value missing');
+input.removeAttribute("required");
+
+debug('Type mismatch');
+shouldBeEqualToString('testIt("foo", "", "")', '');
+
+debug('Range overflow')
+shouldBeEqualToString('testIt("200", "", "100")', 'range overflow');
+
+debug('Range underflow')
+shouldBeEqualToString('testIt("10", "50", "100")', 'range underflow');
+
+debug('Step mismatch')
+shouldBeEqualToString('testIt("55", "0", "100", "10")', 'step mismatch');
+
+</script>
+<script src=""
+</body>
+</html>
Copied: branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message-expected.txt (from rev 121019, trunk/LayoutTests/fast/forms/range/input-range-validation-message-expected.txt) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message-expected.txt (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message-expected.txt 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,21 @@
+Test for validationMessage IDL attribute for <input type=range>
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+No message
+PASS testIt("", "", "") is ""
+Value missing
+PASS testIt("", "", "") is ""
+Type mismatch
+PASS testIt("foo", "", "") is ""
+Range overflow
+PASS testIt("200", "", "100") is ""
+Range underflow
+PASS testIt("10", "50", "100") is ""
+Step mismatch
+PASS testIt("55", "0", "100", "10") is ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message.html (from rev 121019, trunk/LayoutTests/fast/forms/range/input-range-validation-message.html) (0 => 121399)
--- branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message.html (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/forms/range/input-range-validation-message.html 2012-06-28 03:22:40 UTC (rev 121399)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('Test for validationMessage IDL attribute for <input type=range>');
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+parent.innerHTML = '<input type=range id=range maxlength=1 pattern=x>';
+var input = document.getElementById('range');
+
+function testIt(value, min, max, step)
+{
+ input.setAttribute("max", max);
+ input.setAttribute("min", min);
+ input.setAttribute("step", step);
+ input.setAttribute("value", value);
+ return input.validationMessage;
+}
+
+debug('No message')
+shouldBeEqualToString('testIt("", "", "")', '');
+
+debug('Value missing')
+input.setAttribute("required", "");
+shouldBeEqualToString('testIt("", "", "")', '');
+input.removeAttribute("required");
+
+debug('Type mismatch');
+shouldBeEqualToString('testIt("foo", "", "")', '');
+
+debug('Range overflow')
+shouldBeEqualToString('testIt("200", "", "100")', '');
+
+debug('Range underflow')
+shouldBeEqualToString('testIt("10", "50", "100")', '');
+
+debug('Step mismatch')
+shouldBeEqualToString('testIt("55", "0", "100", "10")', '');
+
+</script>
+<script src=""
+</body>
+</html>
Modified: branches/chromium/1180/Source/WebCore/html/InputType.cpp (121398 => 121399)
--- branches/chromium/1180/Source/WebCore/html/InputType.cpp 2012-06-28 02:17:40 UTC (rev 121398)
+++ branches/chromium/1180/Source/WebCore/html/InputType.cpp 2012-06-28 03:22:40 UTC (rev 121399)
@@ -374,7 +374,7 @@
if (numericValue < stepRange.minimum())
return validationMessageRangeUnderflowText(serialize(stepRange.minimum()));
- if (numericValue < stepRange.maximum())
+ if (numericValue > stepRange.maximum())
return validationMessageRangeOverflowText(serialize(stepRange.maximum()));
if (stepRange.stepMismatch(numericValue)) {