2010-12-10 Dai Mikurube <dmikurube@google.com>

        Reviewed by Kent Tamura.

        Refactor by merging tests for ValidityState (patternMismatch and customError)
        https://bugs.webkit.org/show_bug.cgi?id=50802

        * fast/forms/ValidityState-customError-expected.txt: Added.
        * fast/forms/ValidityState-customError.html: Added.
        * fast/forms/ValidityState-customError-001-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
        * fast/forms/ValidityState-customError-001.html: Removed. Merged to ValidityState-customError.html.
        * fast/forms/ValidityState-customError-002-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
        * fast/forms/ValidityState-customError-002.html: Removed. Merged to ValidityState-customError.html.
        * fast/forms/ValidityState-customError-003-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
        * fast/forms/ValidityState-customError-003.html: Removed. Merged to ValidityState-customError.html.
        * fast/forms/ValidityState-customError-004-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
        * fast/forms/ValidityState-customError-004.html: Removed. Merged to ValidityState-customError.html.
        * fast/forms/ValidityState-patternMismatch-expected.txt: Added.
        * fast/forms/ValidityState-patternMismatch.html: Added.
        * fast/forms/ValidityState-patternMismatch-001-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-001.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-002-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-002.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-003-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-003.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-004-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-004.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-005-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-005.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-006-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-006.html: Removed. Merged to ValidityState-patternMismatch.html.
        * fast/forms/ValidityState-patternMismatch-007-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
        * fast/forms/ValidityState-patternMismatch-007.html: Removed. Merged to ValidityState-patternMismatch.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1778ddbf
2010-12-10 Dai Mikurube <dmikurube@google.com>
Reviewed by Kent Tamura.
Refactor by merging tests for ValidityState (patternMismatch and customError)
https://bugs.webkit.org/show_bug.cgi?id=50802
* fast/forms/ValidityState-customError-expected.txt: Added.
* fast/forms/ValidityState-customError.html: Added.
* fast/forms/ValidityState-customError-001-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
* fast/forms/ValidityState-customError-001.html: Removed. Merged to ValidityState-customError.html.
* fast/forms/ValidityState-customError-002-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
* fast/forms/ValidityState-customError-002.html: Removed. Merged to ValidityState-customError.html.
* fast/forms/ValidityState-customError-003-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
* fast/forms/ValidityState-customError-003.html: Removed. Merged to ValidityState-customError.html.
* fast/forms/ValidityState-customError-004-expected.txt: Removed. Merged to ValidityState-customError-expected.txt.
* fast/forms/ValidityState-customError-004.html: Removed. Merged to ValidityState-customError.html.
* fast/forms/ValidityState-patternMismatch-expected.txt: Added.
* fast/forms/ValidityState-patternMismatch.html: Added.
* fast/forms/ValidityState-patternMismatch-001-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-001.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-002-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-002.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-003-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-003.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-004-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-004.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-005-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-005.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-006-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-006.html: Removed. Merged to ValidityState-patternMismatch.html.
* fast/forms/ValidityState-patternMismatch-007-expected.txt: Removed. Merged to ValidityState-patternMismatch-expected.txt.
* fast/forms/ValidityState-patternMismatch-007.html: Removed. Merged to ValidityState-patternMismatch.html.
2010-12-10 Joone Hur <joone@kldp.org>
Reviewed by Eric Seidel.
......
<html>
<head>
<title>setCustomValidity and customError</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
for (i = 0; i < v.length; i++) {
v[i].setCustomValidity("Custom validation message");
log(v[i].validity.customError ? "SUCCESS" : "FAILURE");
}
}
</script>
</head>
<body onload="test()">
<fieldset name="victim"></fieldset>
<button name="victim"></button>
<select name="victim"></select>
<textarea name="victim"></textarea>
<input name="victim" />
<hr>
<ol id="console"></ol>
</body>
</html>
<html>
<head>
<title>setCustomValidity and customError 2</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
for (i = 0; i < v.length; i++)
v[i].setCustomValidity("Custom validation message");
for (i = 0; i < v.length; i++) {
v[i].setCustomValidity("");
log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
}
}
</script>
</head>
<body onload="test()">
<fieldset name="victim"></fieldset>
<button name="victim"></button>
<select name="victim"></select>
<textarea name="victim"></textarea>
<input name="victim" />
<hr>
<ol id="console"></ol>
</body>
</html>
<html>
<head>
<title>setCustomValidity and customError 2</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
for (i = 0; i < v.length; i++)
log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
}
</script>
</head>
<body onload="test()">
<fieldset name="victim"></fieldset>
<button name="victim"></button>
<select name="victim"></select>
<textarea name="victim"></textarea>
<input name="victim" />
<hr>
<ol id="console"></ol>
</body>
</html>
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
<html>
<head>
<title>setCustomValidity and customError 4</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
// Blank
for (i = 0; i < v.length; i++) {
v[i].setCustomValidity("Custom string");
v[i].setCustomValidity();
log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
v[i].setCustomValidity("one", "two", "three");
log(v[i].validity.customError ? "SUCCESS" : "FAILURE");
v[i].setCustomValidity(null);
log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
v[i].setCustomValidity("Custom string");
v[i].setCustomValidity(undefined);
log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
}
}
</script>
</head>
<body onload="test()">
<fieldset name="victim"></fieldset>
<button name="victim"></button>
<select name="victim"></select>
<textarea name="victim"></textarea>
<input name="victim" />
<hr>
<ol id="console"></ol>
</body>
</html>
This test checks validity.customError.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Set some value for customError.
PASS customErrorFor("fieldset-set") is true
PASS customErrorFor("button-set") is true
PASS customErrorFor("button-button-set") is true
PASS customErrorFor("button-reset-set") is true
PASS customErrorFor("select-set") is true
PASS customErrorFor("textarea-set") is true
PASS customErrorFor("input-set") is true
PASS customErrorFor("input-submit-set") is true
Set some value for customError, and clear it.
PASS customErrorFor("fieldset-set-and-empty") is false
PASS customErrorFor("button-set-and-empty") is false
PASS customErrorFor("button-button-set-and-empty") is false
PASS customErrorFor("button-reset-set-and-empty") is false
PASS customErrorFor("select-set-and-empty") is false
PASS customErrorFor("textarea-set-and-empty") is false
PASS customErrorFor("input-set-and-empty") is false
PASS customErrorFor("input-submit-set-and-empty") is false
Not any changes for customError.
PASS customErrorFor("fieldset-no-changes") is false
PASS customErrorFor("button-no-changes") is false
PASS customErrorFor("button-button-no-changes") is false
PASS customErrorFor("button-reset-no-changes") is false
PASS customErrorFor("select-no-changes") is false
PASS customErrorFor("textarea-no-changes") is false
PASS customErrorFor("input-no-changes") is false
PASS customErrorFor("input-submit-no-changes") is false
Many changes for customError:
Set some value, and set with no arguments.
PASS customErrorFor("fieldset-many-changes") is false
PASS customErrorFor("button-many-changes") is false
PASS customErrorFor("button-button-many-changes") is false
PASS customErrorFor("button-reset-many-changes") is false
PASS customErrorFor("select-many-changes") is false
PASS customErrorFor("textarea-many-changes") is false
PASS customErrorFor("input-many-changes") is false
PASS customErrorFor("input-submit-many-changes") is false
Set with three arguments.
PASS customErrorFor("fieldset-many-changes") is true
PASS customErrorFor("button-many-changes") is true
PASS customErrorFor("button-button-many-changes") is true
PASS customErrorFor("button-reset-many-changes") is true
PASS customErrorFor("select-many-changes") is true
PASS customErrorFor("textarea-many-changes") is true
PASS customErrorFor("input-many-changes") is true
PASS customErrorFor("input-submit-many-changes") is true
Set null.
PASS customErrorFor("fieldset-many-changes") is false
PASS customErrorFor("button-many-changes") is false
PASS customErrorFor("button-button-many-changes") is false
PASS customErrorFor("button-reset-many-changes") is false
PASS customErrorFor("select-many-changes") is false
PASS customErrorFor("textarea-many-changes") is false
PASS customErrorFor("input-many-changes") is false
PASS customErrorFor("input-submit-many-changes") is false
Set some value, and set undefined.
PASS customErrorFor("fieldset-many-changes") is false
PASS customErrorFor("button-many-changes") is false
PASS customErrorFor("button-button-many-changes") is false
PASS customErrorFor("button-reset-many-changes") is false
PASS customErrorFor("select-many-changes") is false
PASS customErrorFor("textarea-many-changes") is false
PASS customErrorFor("input-many-changes") is false
PASS customErrorFor("input-submit-many-changes") is false
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>
<fieldset name="set" id="fieldset-set"></fieldset>
<button name="set" id="button-set"></button>
<button name="set" id="button-button-set" type="button"></button>
<button name="set" id="button-reset-set" type="reset"></button>
<select name="set" id="select-set"></select>
<textarea name="set" id="textarea-set"></textarea>
<input name="set" id="input-set" />
<input name="set" id="input-submit-set" type="submit" />
<fieldset name="set-and-empty" id="fieldset-set-and-empty"></fieldset>
<button name="set-and-empty" id="button-set-and-empty"></button>
<button name="set-and-empty" id="button-button-set-and-empty" type="button"></button>
<button name="set-and-empty" id="button-reset-set-and-empty" type="reset"></button>
<select name="set-and-empty" id="select-set-and-empty"></select>
<textarea name="set-and-empty" id="textarea-set-and-empty"></textarea>
<input name="set-and-empty" id="input-set-and-empty" />
<input name="set-and-empty" id="input-submit-set-and-empty" type="submit" />
<fieldset name="no-changes" id="fieldset-no-changes"></fieldset>
<button name="no-changes" id="button-no-changes"></button>
<button name="no-changes" id="button-button-no-changes" type="button"></button>
<button name="no-changes" id="button-reset-no-changes" type="reset"></button>
<select name="no-changes" id="select-no-changes"></select>
<textarea name="no-changes" id="textarea-no-changes"></textarea>
<input name="no-changes" id="input-no-changes" />
<input name="no-changes" id="input-submit-no-changes" type="submit" />
<fieldset name="many-changes" id="fieldset-many-changes"></fieldset>
<button name="many-changes" id="button-many-changes"></button>
<button name="many-changes" id="button-button-many-changes" type="button"></button>
<button name="many-changes" id="button-reset-many-changes" type="reset"></button>
<select name="many-changes" id="select-many-changes"></select>
<textarea name="many-changes" id="textarea-many-changes"></textarea>
<input name="many-changes" id="input-many-changes" />
<input name="many-changes" id="input-submit-many-changes" type="submit" />
<script language="JavaScript" type="text/javascript">
function customErrorFor(id) {
return document.getElementById(id).validity.customError;
}
description("This test checks validity.customError.");
debug('Set some value for customError.');
v = document.getElementsByName("set");
for (i = 0; i < v.length; i++)
v[i].setCustomValidity("Custom validation message");
shouldBeTrue('customErrorFor("fieldset-set")');
shouldBeTrue('customErrorFor("button-set")');
shouldBeTrue('customErrorFor("button-button-set")');
shouldBeTrue('customErrorFor("button-reset-set")');
shouldBeTrue('customErrorFor("select-set")');
shouldBeTrue('customErrorFor("textarea-set")');
shouldBeTrue('customErrorFor("input-set")');
shouldBeTrue('customErrorFor("input-submit-set")');
debug('');
debug('Set some value for customError, and clear it.');
v = document.getElementsByName("set-and-empty");
for (i = 0; i < v.length; i++)
v[i].setCustomValidity("Custom validation message");
for (i = 0; i < v.length; i++)
v[i].setCustomValidity("");
shouldBeFalse('customErrorFor("fieldset-set-and-empty")');
shouldBeFalse('customErrorFor("button-set-and-empty")');
shouldBeFalse('customErrorFor("button-button-set-and-empty")');
shouldBeFalse('customErrorFor("button-reset-set-and-empty")');
shouldBeFalse('customErrorFor("select-set-and-empty")');
shouldBeFalse('customErrorFor("textarea-set-and-empty")');
shouldBeFalse('customErrorFor("input-set-and-empty")');
shouldBeFalse('customErrorFor("input-submit-set-and-empty")');
debug('');
debug('Not any changes for customError.');
shouldBeFalse('customErrorFor("fieldset-no-changes")');
shouldBeFalse('customErrorFor("button-no-changes")');
shouldBeFalse('customErrorFor("button-button-no-changes")');
shouldBeFalse('customErrorFor("button-reset-no-changes")');
shouldBeFalse('customErrorFor("select-no-changes")');
shouldBeFalse('customErrorFor("textarea-no-changes")');
shouldBeFalse('customErrorFor("input-no-changes")');
shouldBeFalse('customErrorFor("input-submit-no-changes")');
debug('');
debug('Many changes for customError:');
debug('Set some value, and set with no arguments.');
v = document.getElementsByName("many-changes");
for (i = 0; i < v.length; i++) {
v[i].setCustomValidity("Custom string");
v[i].setCustomValidity();
}
shouldBeFalse('customErrorFor("fieldset-many-changes")');
shouldBeFalse('customErrorFor("button-many-changes")');
shouldBeFalse('customErrorFor("button-button-many-changes")');
shouldBeFalse('customErrorFor("button-reset-many-changes")');
shouldBeFalse('customErrorFor("select-many-changes")');
shouldBeFalse('customErrorFor("textarea-many-changes")');
shouldBeFalse('customErrorFor("input-many-changes")');
shouldBeFalse('customErrorFor("input-submit-many-changes")');
debug('Set with three arguments.');
for (i = 0; i < v.length; i++)
v[i].setCustomValidity("one", "two", "three");
shouldBeTrue('customErrorFor("fieldset-many-changes")');
shouldBeTrue('customErrorFor("button-many-changes")');
shouldBeTrue('customErrorFor("button-button-many-changes")');
shouldBeTrue('customErrorFor("button-reset-many-changes")');
shouldBeTrue('customErrorFor("select-many-changes")');
shouldBeTrue('customErrorFor("textarea-many-changes")');
shouldBeTrue('customErrorFor("input-many-changes")');
shouldBeTrue('customErrorFor("input-submit-many-changes")');
debug('Set null.');
for (i = 0; i < v.length; i++)
v[i].setCustomValidity(null);
shouldBeFalse('customErrorFor("fieldset-many-changes")');
shouldBeFalse('customErrorFor("button-many-changes")');
shouldBeFalse('customErrorFor("button-button-many-changes")');
shouldBeFalse('customErrorFor("button-reset-many-changes")');
shouldBeFalse('customErrorFor("select-many-changes")');
shouldBeFalse('customErrorFor("textarea-many-changes")');
shouldBeFalse('customErrorFor("input-many-changes")');
shouldBeFalse('customErrorFor("input-submit-many-changes")');
debug('Set some value, and set undefined.');
for (i = 0; i < v.length; i++) {
v[i].setCustomValidity("Custom string");
v[i].setCustomValidity(undefined);
}
shouldBeFalse('customErrorFor("fieldset-many-changes")');
shouldBeFalse('customErrorFor("button-many-changes")');
shouldBeFalse('customErrorFor("button-button-many-changes")');
shouldBeFalse('customErrorFor("button-reset-many-changes")');
shouldBeFalse('customErrorFor("select-many-changes")');
shouldBeFalse('customErrorFor("textarea-many-changes")');
shouldBeFalse('customErrorFor("input-many-changes")');
shouldBeFalse('customErrorFor("input-submit-many-changes")');
debug('');
var successfullyParsed = true;
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
There is an input type text with pattern attribute set to [0-9][A-Z]{3}, checking its validity.patternMismatch flag.
SUCCESS
<html>
<head>
<title>basic patternMismatch test</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
log(!v[0].validity.patternMismatch ? "SUCCESS" : "FAILURE");
}
</script>
</head>
<body onload="test()">
<p>There is an input type text with pattern attribute set to [0-9][A-Z]{3}, checking its validity.patternMismatch flag.</p>
<input name="victim" pattern="[0-9][A-Z]{3}" value="0AAA"/>
<hr>
<ol id="console"></ol>
</body>
</html>
There is an input type text with no pattern attribute.
SUCCESS
<html>
<head>
<title>basic patternMismatch test 2</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
log(!v[0].validity.patternMismatch ? "SUCCESS" : "FAILURE");
}
</script>
</head>
<body onload="test()">
<p>There is an input type text with no pattern attribute.</p>
<input name="victim" />
<hr>
<ol id="console"></ol>
</body>
</html>
IP Address: Email address:
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
<html>
<head>
<title>basic patternMismatch test 3</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
for (i = 0; i < v.length; i++)
log(!v[i].validity.patternMismatch ? "SUCCESS" : "FAILURE");
}
</script>
</head>
<body onload="test()">
IP Address:
<input name="victim" type="text" pattern="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b" value="127.0.0.1" />
Email address:
<input name="victim" type="text" pattern="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" value="someone@somewhere.com" />
<input name="victim" type="text" pattern="\b(word1|word2|word3)(?:\W+\w+){1,6}?\W+(word1|word2|word3)\b" value="word1 near word2" />
<input name="victim" type="text" pattern=".{5,}" value="12345" />
<input name="victim" type="text" pattern=".{5,}" value="*(@$!" />
<input name="victim" type="text" pattern=".{5,}" value="*(@^$!" />
<input name="victim" type="text" pattern="0|1|2|3|4|5|6|7|8|" value="3" />
<input name="victim" type="text" pattern="^(foo).*" value="foo"/>
<input name="victim" type="text" pattern="^(foo).*" value="fooo"/>
<input name="victim" type="text" pattern="\w" value="f"/>
<input name="victim" type="text" pattern="\." value="."/>
<input name="victim" type="text" pattern="\)\(" value=")("/>
<input name="victim" type="text" pattern="ab" value="ab"/>
<input name="victim" type="text" pattern="^ab" value="ab"/>
<input name="victim" type="text" pattern="^\(" value="("/>
<input name="victim" type="text" pattern="...\)\(..." value="aaa)(bbb"/>
<input name="victim" type="text" pattern="^" value=""/>
<input name="victim" type="text" pattern="$" value=""/>
<input name="victim" type="text" pattern="foobar" value=""/>
<hr>
<ol id="console"></ol>
</body>
</html>
<html>
<head>
<title>basic patternMismatch test 4</title>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
v = document.getElementsByName("victim");
log(v[0].validity.patternMismatch ? "SUCCESS" : "FAILURE");