Commit 26d4a7e3 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-12-01 Kent Tamura <tkent@chromium.org>

        Reviewed by Darin Adler.

        Change [Reflect] to [ConvertNullToNullString, Reflect] for min, max,
        pattern and step attributes of HTMLInputElement.
        https://bugs.webkit.org/show_bug.cgi?id=31708

        * fast/forms/input-minmax-expected.txt:
        * fast/forms/input-pattern-expected.txt: Added.
        * fast/forms/input-pattern.html: Added.
        * fast/forms/input-step-expected.txt:
        * fast/forms/script-tests/input-minmax.js: Add tests for null/undefined/non-string.
        * fast/forms/script-tests/input-pattern.js: Added.
        * fast/forms/script-tests/input-step.js: Change the result for null.
2009-12-01  Kent Tamura  <tkent@chromium.org>

        Reviewed by Darin Adler.

        Change [Reflect] to [ConvertNullToNullString, Reflect] for min, max,
        pattern and step attributes of HTMLInputElement.
        https://bugs.webkit.org/show_bug.cgi?id=31708

        * html/HTMLInputElement.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d1b4e8fd
2009-12-01 Kent Tamura <tkent@chromium.org>
Reviewed by Darin Adler.
Change [Reflect] to [ConvertNullToNullString, Reflect] for min, max,
pattern and step attributes of HTMLInputElement.
https://bugs.webkit.org/show_bug.cgi?id=31708
* fast/forms/input-minmax-expected.txt:
* fast/forms/input-pattern-expected.txt: Added.
* fast/forms/input-pattern.html: Added.
* fast/forms/input-step-expected.txt:
* fast/forms/script-tests/input-minmax.js: Add tests for null/undefined/non-string.
* fast/forms/script-tests/input-pattern.js: Added.
* fast/forms/script-tests/input-step.js: Change the result for null.
2009-12-01 Chris Fleizach <cfleizach@apple.com>
 
Reviewed by Darin Adler.
......@@ -13,6 +13,31 @@ PASS input.getAttribute("min") is "foo"
PASS input.getAttribute("max") is "bar"
PASS input.getAttribute("min") is ""
PASS input.getAttribute("max") is ""
Setting null to min:
PASS input.min is ""
PASS input.getAttribute("min") is null
PASS input.min is "null"
Setting null to max:
PASS input.max is ""
PASS input.getAttribute("max") is null
PASS input.max is "null"
Setting undefined to min:
PASS input.min is "undefined"
PASS input.getAttribute("min") is "undefined"
PASS input.min is "undefined"
Setting undefined to max:
PASS input.max is "undefined"
PASS input.getAttribute("max") is "undefined"
PASS input.max is "undefined"
Setting non-string to min:
PASS input.min is "256"
PASS input.getAttribute("min") is "256"
PASS input.min is "256"
Setting non-string to max:
PASS input.max is "256"
PASS input.getAttribute("max") is "256"
PASS input.max is "256"
Check implicit min/max of type=range:
PASS input.min is ""
PASS input.max is ""
PASS successfullyParsed is true
......
Test the behavior of pattern attribute and pattern DOM property.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS input.pattern is ""
PASS input.getAttribute("pattern") is "foo"
PASS input.pattern is "bar"
PASS input.pattern is ""
PASS input.getAttribute("pattern") is null
PASS input.pattern is "null"
PASS input.pattern is "undefined"
PASS input.getAttribute("pattern") is "undefined"
PASS input.pattern is "undefined"
PASS input.pattern is "256"
PASS input.getAttribute("pattern") is "256"
PASS input.pattern is "256"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="script-tests/input-pattern.js"></script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -6,8 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS input.step is ""
PASS input.getAttribute("step") is "foo"
PASS input.step is "bar"
PASS input.step is "null"
PASS input.getAttribute("step") is "null"
PASS input.step is ""
PASS input.getAttribute("step") is null
PASS input.step is "null"
PASS input.step is "undefined"
PASS input.getAttribute("step") is "undefined"
......
......@@ -24,8 +24,54 @@ input.max = '';
shouldBe('input.getAttribute("min")', '""');
shouldBe('input.getAttribute("max")', '""');
// Null.
debug('Setting null to min:');
input.min = null;
shouldBe('input.min', '""');
shouldBe('input.getAttribute("min")', 'null');
input.setAttribute('min', null);
shouldBe('input.min', '"null"');
debug('Setting null to max:');
input.max = null;
shouldBe('input.max', '""');
shouldBe('input.getAttribute("max")', 'null');
input.setAttribute('max', null);
shouldBe('input.max', '"null"');
// Undefined.
debug('Setting undefined to min:');
input.min = undefined;
shouldBe('input.min', '"undefined"');
shouldBe('input.getAttribute("min")', '"undefined"');
input.setAttribute('min', undefined);
shouldBe('input.min', '"undefined"');
debug('Setting undefined to max:');
input.max = undefined;
shouldBe('input.max', '"undefined"');
shouldBe('input.getAttribute("max")', '"undefined"');
input.setAttribute('max', undefined);
shouldBe('input.max', '"undefined"');
// Non-string.
debug('Setting non-string to min:');
input.min = 256;
shouldBe('input.min', '"256"');
shouldBe('input.getAttribute("min")', '"256"');
input.setAttribute('min', 256);
shouldBe('input.min', '"256"');
debug('Setting non-string to max:');
input.max = 256;
shouldBe('input.max', '"256"');
shouldBe('input.getAttribute("max")', '"256"');
input.setAttribute('max', 256);
shouldBe('input.max', '"256"');
// The range type has the default minimum and the default maximum.
// But they aren't exposed by .min .max IDL attributes.
debug('Check implicit min/max of type=range:');
input.type = 'range';
input.setAttribute('min', '');
input.setAttribute('max', '');
......
description('Test the behavior of pattern attribute and pattern DOM property.');
var input = document.createElement('input');
input.type = 'text';
// No pattern attribute.
shouldBe('input.pattern', '""');
// Set a string value.
input.pattern = 'foo';
shouldBe('input.getAttribute("pattern")', '"foo"');
input.setAttribute('pattern', 'bar');
shouldBe('input.pattern', '"bar"');
// Null.
input.pattern = null;
shouldBe('input.pattern', '""');
shouldBe('input.getAttribute("pattern")', 'null');
input.setAttribute('pattern', null);
shouldBe('input.pattern', '"null"');
// Undefined.
input.pattern = undefined;
shouldBe('input.pattern', '"undefined"');
shouldBe('input.getAttribute("pattern")', '"undefined"');
input.setAttribute('pattern', undefined);
shouldBe('input.pattern', '"undefined"');
// Non-string.
input.pattern = 256;
shouldBe('input.pattern', '"256"');
shouldBe('input.getAttribute("pattern")', '"256"');
input.setAttribute('pattern', 256);
shouldBe('input.pattern', '"256"');
var successfullyParsed = true;
......@@ -14,8 +14,8 @@ shouldBe('input.step', '"bar"');
// Null.
input.step = null;
shouldBe('input.step', '"null"');
shouldBe('input.getAttribute("step")', '"null"');
shouldBe('input.step', '""');
shouldBe('input.getAttribute("step")', 'null');
input.setAttribute('step', null);
shouldBe('input.step', '"null"');
......
2009-12-01 Kent Tamura <tkent@chromium.org>
Reviewed by Darin Adler.
Change [Reflect] to [ConvertNullToNullString, Reflect] for min, max,
pattern and step attributes of HTMLInputElement.
https://bugs.webkit.org/show_bug.cgi?id=31708
* html/HTMLInputElement.idl:
2009-12-01 Chris Fleizach <cfleizach@apple.com>
 
Reviewed by Darin Adler.
......@@ -43,16 +43,16 @@ module html {
readonly attribute HTMLElement list;
#endif
#if !defined(LANGUAGE_COM) || !LANGUAGE_COM
attribute [Reflect] DOMString max;
attribute [ConvertNullToNullString, Reflect] DOMString max;
#endif
attribute long maxLength
setter raises(DOMException);
#if !defined(LANGUAGE_COM) || !LANGUAGE_COM
attribute [Reflect] DOMString min;
attribute [ConvertNullToNullString, Reflect] DOMString min;
#endif
attribute boolean multiple;
attribute [ConvertNullToNullString] DOMString name;
attribute [Reflect] DOMString pattern;
attribute [ConvertNullToNullString, Reflect] DOMString pattern;
attribute DOMString placeholder;
attribute boolean readOnly;
attribute boolean required;
......@@ -63,7 +63,7 @@ module html {
attribute unsigned long size; // Changed string -> long as part of DOM level 2
#endif
attribute [ConvertNullToNullString] DOMString src;
attribute [Reflect] DOMString step;
attribute [ConvertNullToNullString, Reflect] DOMString step;
attribute [ConvertNullToNullString, JSCCustomGetter] DOMString type; // readonly dropped as part of DOM level 2
attribute [ConvertNullToNullString] DOMString useMap;
attribute [ConvertNullToNullString] DOMString value;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment