Convert *-appearance-pseudo-classes.html to dumpAsText tests
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2012 08:59:11 +0000 (08:59 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2012 08:59:11 +0000 (08:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103602

Reviewed by Kentaro Hara.

fast/forms/*/*-appearance-pseudo-classes.html doesn't need to be a pixel
test because "how css properties are applied" is tested in
fast/forms/*/*-appearance-basic.html. Checking querySelectorAll result
is enough to check pseudo classes support, and we can convert the test
to a dumpAsText test. We imporve test coverage in the new dumpAsText tests.

Also, this patch adds missing datetimelocal-pseudo-classes.html.

* fast/forms/date/date-pseudo-classes-expected.txt:
* fast/forms/date/date-pseudo-classes.html: Add :in-range -> :out-of-range cases.
* fast/forms/datetimelocal/datetimelocal-pseudo-classes-expected.txt: Added.
* fast/forms/datetimelocal/datetimelocal-pseudo-classes.html: Added.
* fast/forms/month/month-appearance-pseudo-classes-expected.txt: Removed.
* fast/forms/month/month-appearance-pseudo-classes.html: Removed.
* fast/forms/month/month-pseudo-classes-expected.txt: Added.
* fast/forms/month/month-pseudo-classes.html: Added.
* fast/forms/time/time-appearance-pseudo-classes-expected.txt: Removed.
* fast/forms/time/time-appearance-pseudo-classes.html: Removed.
* fast/forms/time/time-pseudo-classes-expected.txt: Added.
* fast/forms/time/time-pseudo-classes.html: Added.
* fast/forms/week/week-appearance-pseudo-classes-expected.txt: Removed.
* fast/forms/week/week-appearance-pseudo-classes.html: Removed.
* fast/forms/week/week-pseudo-classes-expected.txt: Added.
* fast/forms/week/week-pseudo-classes.html: Added.
* platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/date/date-pseudo-classes-expected.txt
LayoutTests/fast/forms/date/date-pseudo-classes.html
LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes.html [new file with mode: 0644]
LayoutTests/fast/forms/month/month-appearance-pseudo-classes-expected.txt [deleted file]
LayoutTests/fast/forms/month/month-appearance-pseudo-classes.html [deleted file]
LayoutTests/fast/forms/month/month-pseudo-classes-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/month/month-pseudo-classes.html [new file with mode: 0644]
LayoutTests/fast/forms/time/time-appearance-pseudo-classes-expected.txt [deleted file]
LayoutTests/fast/forms/time/time-appearance-pseudo-classes.html [deleted file]
LayoutTests/fast/forms/time/time-pseudo-classes-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/time/time-pseudo-classes.html [new file with mode: 0644]
LayoutTests/fast/forms/week/week-appearance-pseudo-classes-expected.txt [deleted file]
LayoutTests/fast/forms/week/week-appearance-pseudo-classes.html [deleted file]
LayoutTests/fast/forms/week/week-pseudo-classes-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/week/week-pseudo-classes.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png [deleted file]

index 6d13ac4..9f65a70 100644 (file)
@@ -1,3 +1,50 @@
+2012-11-29  Kent Tamura  <tkent@chromium.org>
+
+        Convert *-appearance-pseudo-classes.html to dumpAsText tests
+        https://bugs.webkit.org/show_bug.cgi?id=103602
+
+        Reviewed by Kentaro Hara.
+
+        fast/forms/*/*-appearance-pseudo-classes.html doesn't need to be a pixel
+        test because "how css properties are applied" is tested in
+        fast/forms/*/*-appearance-basic.html. Checking querySelectorAll result
+        is enough to check pseudo classes support, and we can convert the test
+        to a dumpAsText test. We imporve test coverage in the new dumpAsText tests.
+
+        Also, this patch adds missing datetimelocal-pseudo-classes.html.
+
+        * fast/forms/date/date-pseudo-classes-expected.txt:
+        * fast/forms/date/date-pseudo-classes.html: Add :in-range -> :out-of-range cases.
+        * fast/forms/datetimelocal/datetimelocal-pseudo-classes-expected.txt: Added.
+        * fast/forms/datetimelocal/datetimelocal-pseudo-classes.html: Added.
+        * fast/forms/month/month-appearance-pseudo-classes-expected.txt: Removed.
+        * fast/forms/month/month-appearance-pseudo-classes.html: Removed.
+        * fast/forms/month/month-pseudo-classes-expected.txt: Added.
+        * fast/forms/month/month-pseudo-classes.html: Added.
+        * fast/forms/time/time-appearance-pseudo-classes-expected.txt: Removed.
+        * fast/forms/time/time-appearance-pseudo-classes.html: Removed.
+        * fast/forms/time/time-pseudo-classes-expected.txt: Added.
+        * fast/forms/time/time-pseudo-classes.html: Added.
+        * fast/forms/week/week-appearance-pseudo-classes-expected.txt: Removed.
+        * fast/forms/week/week-appearance-pseudo-classes.html: Removed.
+        * fast/forms/week/week-pseudo-classes-expected.txt: Added.
+        * fast/forms/week/week-pseudo-classes.html: Added.
+        * platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png: Removed.
+        * platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png: Removed.
+
 2012-11-29  Alexander Pavlov  <apavlov@chromium.org>
 
         [Chromium] Unreviewed, mark fast/regions tests failing after r136045 as failing, since they are actually reftests.
index 66b1e41..70209f9 100644 (file)
@@ -15,6 +15,9 @@ PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is true
 PASS matchedNodesContainId(container, ":read-only", "readonly") is true
 PASS matchedNodesContainId(container, ":required", "required") is true
 PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is false
+PASS matchedNodesContainId(container, ":in-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is false
+PASS matchedNodesContainId(container, ":out-of-range", "inrange") is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
index bff3351..d9aa2d2 100644 (file)
@@ -28,8 +28,14 @@ shouldBeTrue('matchedNodesContainId(container, ":in-range", "badvalue")');
 shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "outofrange")');
 shouldBeTrue('matchedNodesContainId(container, ":read-only", "readonly")');
 shouldBeTrue('matchedNodesContainId(container, ":required", "required")');
+// Make the id=outofrange element in-range state.
 document.getElementById('outofrange').value = '1500-01-01';
 shouldBeFalse('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "outofrange")');
+// Make the id=inrange element out-of-range state.
+document.getElementById('inrange').value = '1500-01-01';
+shouldBeFalse('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "inrange")');
 container.remove();
 </script>
 <script src="../../js/resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes-expected.txt b/LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes-expected.txt
new file mode 100644 (file)
index 0000000..70209f9
--- /dev/null
@@ -0,0 +1,24 @@
+Test if an input field matches to various pseudo classes
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS matchedNodesContainId(container, ":enabled", "enabled") is true
+PASS matchedNodesContainId(container, ":valid", "enabled") is true
+PASS matchedNodesContainId(container, ":optional", "enabled") is true
+PASS matchedNodesContainId(container, ":read-write", "enabled") is true
+PASS matchedNodesContainId(container, ":disabled", "disabled") is true
+PASS matchedNodesContainId(container, ":invalid", "invalid") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is true
+PASS matchedNodesContainId(container, ":in-range", "badvalue") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":read-only", "readonly") is true
+PASS matchedNodesContainId(container, ":required", "required") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is false
+PASS matchedNodesContainId(container, ":in-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is false
+PASS matchedNodesContainId(container, ":out-of-range", "inrange") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes.html b/LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes.html
new file mode 100644 (file)
index 0000000..5d007b8
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../resources/common-pseudo-classes.js"></script>
+
+<div id="container">
+<input type="datetime-local" value="1234-12-11T12:34" id="enabled">
+<input type="datetime-local" value="12340-10-01T12:34" id="disabled" disabled>
+<input type="datetime-local" value="123456-12-11T12:34" min="123456-12-11T00:00" step="1800" id="invalid">
+<input type="datetime-local" value="123456-12-11T12:34" min="123456-12-01T00:00" max="123456-12-31T00:00" id="inrange">
+<input type="datetime-local" value="ABC" min="123456-12-01T00:00" max="123456-12-31T00:00" id="badvalue">
+<input type="datetime-local" value="0710-03-10T00:00" min="1000-01-01T00:00" max="1999-12-31T23:59" id="outofrange">
+<input type="datetime-local" value="1999-12-31T12:34" readonly id="readonly">
+<input type="datetime-local" value="1999-12-31T12:34" required id="required">
+</div>
+
+<script>
+description('Test if an input field matches to various pseudo classes');
+var container = document.getElementById('container');
+shouldBeTrue('matchedNodesContainId(container, ":enabled", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":valid", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":optional", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":read-write", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":disabled", "disabled")');
+shouldBeTrue('matchedNodesContainId(container, ":invalid", "invalid")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "badvalue")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":read-only", "readonly")');
+shouldBeTrue('matchedNodesContainId(container, ":required", "required")');
+// Make the id=outofrange element in-range state.
+document.getElementById('outofrange').value = '1500-01-01T00:00';
+shouldBeFalse('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "outofrange")');
+// Make the id=inrange element out-of-range state.
+document.getElementById('inrange').value = '1500-01-01T00:00';
+shouldBeFalse('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "inrange")');
+container.remove();
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/fast/forms/month/month-appearance-pseudo-classes-expected.txt b/LayoutTests/fast/forms/month/month-appearance-pseudo-classes-expected.txt
deleted file mode 100644 (file)
index 21e9f30..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Input Type "month"
-
-Pseudo Classes
-
-:enabled, :valid       
-:disabled      
-:invalid       
-:in-range      
-:out-of-range  
-:read-only     
diff --git a/LayoutTests/fast/forms/month/month-appearance-pseudo-classes.html b/LayoutTests/fast/forms/month/month-appearance-pseudo-classes.html
deleted file mode 100644 (file)
index b38582f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
-<head>
-<style type="text/css">
-:disabled { color: gray; }
-:enabled { color: blue; }
-:invalid { color: pink; }
-:in-range { font-weight: bold; }
-:out-of-range { color: red; }
-:read-only { color: yellow; }
-:valid { color: green; }
-</style>
-</head>
-<body>
-<h1>Input Type "month"</h1>
-<h2>Pseudo Classes</h2>
-<table>
-<tr><th>:enabled, :valid</th><td><input type="month" value="1982-11"></td></tr>
-<tr><th>:disabled</th><td><input type="month" value="1982-11" disabled></td></tr>
-<tr><th>:invalid</th><td><input type="month" value="1982-11" min="1982-10" step="2"></td></tr>
-<tr><th>:in-range</th><td><input type="month" value="1982-11" min="1982-01" max="1982-12"></td></tr>
-<tr><th>:out-of-range</th><td><input type="month" value="1982-11" min="1981-01" max="1981-12"></td></tr>
-<tr><th>:read-only</th><td><input type="month" value="1982-11" readonly></td></tr>
-</table>
-</body>
-<script>
-if (window.testRunner)
-    testRunner.dumpAsText(true);
-</script>
-</html>
diff --git a/LayoutTests/fast/forms/month/month-pseudo-classes-expected.txt b/LayoutTests/fast/forms/month/month-pseudo-classes-expected.txt
new file mode 100644 (file)
index 0000000..70209f9
--- /dev/null
@@ -0,0 +1,24 @@
+Test if an input field matches to various pseudo classes
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS matchedNodesContainId(container, ":enabled", "enabled") is true
+PASS matchedNodesContainId(container, ":valid", "enabled") is true
+PASS matchedNodesContainId(container, ":optional", "enabled") is true
+PASS matchedNodesContainId(container, ":read-write", "enabled") is true
+PASS matchedNodesContainId(container, ":disabled", "disabled") is true
+PASS matchedNodesContainId(container, ":invalid", "invalid") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is true
+PASS matchedNodesContainId(container, ":in-range", "badvalue") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":read-only", "readonly") is true
+PASS matchedNodesContainId(container, ":required", "required") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is false
+PASS matchedNodesContainId(container, ":in-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is false
+PASS matchedNodesContainId(container, ":out-of-range", "inrange") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/month/month-pseudo-classes.html b/LayoutTests/fast/forms/month/month-pseudo-classes.html
new file mode 100644 (file)
index 0000000..f1abd4a
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../resources/common-pseudo-classes.js"></script>
+
+<div id="container">
+<input type="month" value="1982-11" id="enabled">
+<input type="month" value="1982-11" id="disabled" disabled>
+<input type="month" value="1982-11" min="1982-10" step="2" id="invalid">
+<input type="month" value="1982-11" min="1982-01" max="1982-12" id="inrange">
+<input type="month" value="ABC" min="1982-01" max="1982-12" id="badvalue">
+<input type="month" value="1982-11" min="1981-01" max="1981-12" id="outofrange">
+<input type="month" value="1982-11" readonly id="readonly">
+<input type="month" value="1982-11" required id="required">
+</div>
+
+<script>
+description('Test if an input field matches to various pseudo classes');
+var container = document.getElementById('container');
+shouldBeTrue('matchedNodesContainId(container, ":enabled", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":valid", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":optional", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":read-write", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":disabled", "disabled")');
+shouldBeTrue('matchedNodesContainId(container, ":invalid", "invalid")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "badvalue")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":read-only", "readonly")');
+shouldBeTrue('matchedNodesContainId(container, ":required", "required")');
+// Make the id=outofrange element in-range state.
+document.getElementById('outofrange').value = '1981-11';
+shouldBeFalse('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "outofrange")');
+// Make the id=inrange element out-of-range state.
+document.getElementById('inrange').value = '1983-01';
+shouldBeFalse('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "inrange")');
+container.remove();
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/fast/forms/time/time-appearance-pseudo-classes-expected.txt b/LayoutTests/fast/forms/time/time-appearance-pseudo-classes-expected.txt
deleted file mode 100644 (file)
index e195bcc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Input Type "time"
-
-Pseudo Classes
-
-:enabled, :valid       
-:disabled      
-:invalid       
-:in-range      
-:out-of-range  
-:read-only     
diff --git a/LayoutTests/fast/forms/time/time-appearance-pseudo-classes.html b/LayoutTests/fast/forms/time/time-appearance-pseudo-classes.html
deleted file mode 100644 (file)
index 951b9c4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
-<head>
-<style type="text/css">
-:disabled { color: gray; }
-:enabled { color: blue; }
-:invalid { color: pink; }
-:in-range { font-weight: bold; }
-:out-of-range { color: red; }
-:read-only { color: yellow; }
-:valid { color: green; }
-</style>
-</head>
-<body>
-<h1>Input Type "time"</h1>
-<h2>Pseudo Classes</h2>
-<table>
-<tr><th>:enabled, :valid</th><td><input type="time" value="12:34:00"></td></tr>
-<tr><th>:disabled</th><td><input type="time" value="12:34:00" disabled></td></tr>
-<tr><th>:invalid</th><td><input type="time" value="12:34:00" min="11:00:00" step="3600"></td></tr>
-<tr><th>:in-range</th><td><input type="time" value="12:34:00" min="12:00:00" max="13:00:00"></td></tr>
-<tr><th>:out-of-range</th><td><input type="time" value="12:34:00" min="13:00:00" max="14:00:00"></td></tr>
-<tr><th>:read-only</th><td><input type="time" value="12:34:00" readonly></td></tr>
-</table>
-</body>
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText(true);
-}
-</script>
-</html>
diff --git a/LayoutTests/fast/forms/time/time-pseudo-classes-expected.txt b/LayoutTests/fast/forms/time/time-pseudo-classes-expected.txt
new file mode 100644 (file)
index 0000000..70209f9
--- /dev/null
@@ -0,0 +1,24 @@
+Test if an input field matches to various pseudo classes
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS matchedNodesContainId(container, ":enabled", "enabled") is true
+PASS matchedNodesContainId(container, ":valid", "enabled") is true
+PASS matchedNodesContainId(container, ":optional", "enabled") is true
+PASS matchedNodesContainId(container, ":read-write", "enabled") is true
+PASS matchedNodesContainId(container, ":disabled", "disabled") is true
+PASS matchedNodesContainId(container, ":invalid", "invalid") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is true
+PASS matchedNodesContainId(container, ":in-range", "badvalue") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":read-only", "readonly") is true
+PASS matchedNodesContainId(container, ":required", "required") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is false
+PASS matchedNodesContainId(container, ":in-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is false
+PASS matchedNodesContainId(container, ":out-of-range", "inrange") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/time/time-pseudo-classes.html b/LayoutTests/fast/forms/time/time-pseudo-classes.html
new file mode 100644 (file)
index 0000000..713a462
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../resources/common-pseudo-classes.js"></script>
+
+<div id="container">
+<input type="time" value="12:34:00" id="enabled">
+<input type="time" value="12:34:00" id="disabled" disabled>
+<input type="time" value="12:34:00" min="11:00:00" step="3600" id="invalid">
+<input type="time" value="12:34:00" min="12:00:00" max="13:00:00" id="inrange">
+<input type="time" value="ABC" min="12:00:00" max="13:00:00" id="badvalue">
+<input type="time" value="12:34:00" min="13:00:00" max="14:00:00" id="outofrange">
+<input type="time" value="12:34:56" readonly id="readonly">
+<input type="time" value="12:34:56" required id="required">
+</div>
+
+<script>
+description('Test if an input field matches to various pseudo classes');
+var container = document.getElementById('container');
+shouldBeTrue('matchedNodesContainId(container, ":enabled", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":valid", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":optional", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":read-write", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":disabled", "disabled")');
+shouldBeTrue('matchedNodesContainId(container, ":invalid", "invalid")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "badvalue")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":read-only", "readonly")');
+shouldBeTrue('matchedNodesContainId(container, ":required", "required")');
+// Make the id=outofrange element in-range state.
+document.getElementById('outofrange').value = '13:34:00';
+shouldBeFalse('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "outofrange")');
+// Make the id=inrange element out-of-range state.
+document.getElementById('inrange').value = '13:34:00';
+shouldBeFalse('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "inrange")');
+container.remove();
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/fast/forms/week/week-appearance-pseudo-classes-expected.txt b/LayoutTests/fast/forms/week/week-appearance-pseudo-classes-expected.txt
deleted file mode 100644 (file)
index 2d68c3e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Input Type "week"
-
-Pseudo Classes
-
-:enabled, :valid       
-:disabled      
-:invalid       
-:in-range      
-:out-of-range  
-:read-only     
diff --git a/LayoutTests/fast/forms/week/week-appearance-pseudo-classes.html b/LayoutTests/fast/forms/week/week-appearance-pseudo-classes.html
deleted file mode 100644 (file)
index b2c5e76..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
-<head>
-<style type="text/css">
-:disabled { color: gray; }
-:enabled { color: blue; }
-:invalid { color: pink; }
-:in-range { font-weight: bold; }
-:out-of-range { color: red; }
-:read-only { color: yellow; }
-:valid { color: green; }
-</style>
-</head>
-<body>
-<h1>Input Type "week"</h1>
-<h2>Pseudo Classes</h2>
-<table>
-<tr><th>:enabled, :valid</th><td><input type="week" value="1982-W25"></td></tr>
-<tr><th>:disabled</th><td><input type="week" value="1982-W25" disabled></td></tr>
-<tr><th>:invalid</th><td><input type="week" value="1982-W25" min="1982-W10" step="2"></td></tr>
-<tr><th>:in-range</th><td><input type="week" value="1982-W25" min="1982-W01" max="1982-W30"></td></tr>
-<tr><th>:out-of-range</th><td><input type="week" value="1982-W25" min="1981-W01" max="1981-W12"></td></tr>
-<tr><th>:read-only</th><td><input type="week" value="1982-W25" readonly></td></tr>
-</table>
-</body>
-<script>
-if (window.testRunner)
-    testRunner.dumpAsText(true);
-</script>
-</html>
diff --git a/LayoutTests/fast/forms/week/week-pseudo-classes-expected.txt b/LayoutTests/fast/forms/week/week-pseudo-classes-expected.txt
new file mode 100644 (file)
index 0000000..70209f9
--- /dev/null
@@ -0,0 +1,24 @@
+Test if an input field matches to various pseudo classes
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS matchedNodesContainId(container, ":enabled", "enabled") is true
+PASS matchedNodesContainId(container, ":valid", "enabled") is true
+PASS matchedNodesContainId(container, ":optional", "enabled") is true
+PASS matchedNodesContainId(container, ":read-write", "enabled") is true
+PASS matchedNodesContainId(container, ":disabled", "disabled") is true
+PASS matchedNodesContainId(container, ":invalid", "invalid") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is true
+PASS matchedNodesContainId(container, ":in-range", "badvalue") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":read-only", "readonly") is true
+PASS matchedNodesContainId(container, ":required", "required") is true
+PASS matchedNodesContainId(container, ":out-of-range", "outofrange") is false
+PASS matchedNodesContainId(container, ":in-range", "outofrange") is true
+PASS matchedNodesContainId(container, ":in-range", "inrange") is false
+PASS matchedNodesContainId(container, ":out-of-range", "inrange") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/week/week-pseudo-classes.html b/LayoutTests/fast/forms/week/week-pseudo-classes.html
new file mode 100644 (file)
index 0000000..2264916
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../resources/common-pseudo-classes.js"></script>
+
+<div id="container">
+<input type="week" value="1982-W25" id="enabled">
+<input type="week" value="1982-W25" id="disabled" disabled>
+<input type="week" value="1982-W25" min="1982-W10" step="2" id="invalid">
+<input type="week" value="1982-W25" min="1982-W01" max="1982-W30" id="inrange">
+<input type="week" value="ABC" min="1982-W01" max="1982-W30" id="badvalue">
+<input type="week" value="1982-W25" min="1981-W01" max="1981-W12" id="outofrange">
+<input type="week" value="1982-W25" readonly id="readonly">
+<input type="week" value="1982-W25" required id="required">
+</div>
+
+<script>
+description('Test if an input field matches to various pseudo classes');
+var container = document.getElementById('container');
+shouldBeTrue('matchedNodesContainId(container, ":enabled", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":valid", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":optional", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":read-write", "enabled")');
+shouldBeTrue('matchedNodesContainId(container, ":disabled", "disabled")');
+shouldBeTrue('matchedNodesContainId(container, ":invalid", "invalid")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "badvalue")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":read-only", "readonly")');
+shouldBeTrue('matchedNodesContainId(container, ":required", "required")');
+// Make the id=outofrange element in-range state.
+document.getElementById('outofrange').value = '1981-W10';
+shouldBeFalse('matchedNodesContainId(container, ":out-of-range", "outofrange")');
+shouldBeTrue('matchedNodesContainId(container, ":in-range", "outofrange")');
+// Make the id=inrange element out-of-range state.
+document.getElementById('inrange').value = '1981-W10';
+shouldBeFalse('matchedNodesContainId(container, ":in-range", "inrange")');
+shouldBeTrue('matchedNodesContainId(container, ":out-of-range", "inrange")');
+container.remove();
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 98bbf43..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/forms/month/month-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index a116e56..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/forms/time/time-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 8e5b41e..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/forms/week/week-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 038430a..0000000
Binary files a/LayoutTests/platform/chromium-mac-lion/fast/forms/month/month-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index b24c4ff..0000000
Binary files a/LayoutTests/platform/chromium-mac-lion/fast/forms/time/time-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index c32655b..0000000
Binary files a/LayoutTests/platform/chromium-mac-lion/fast/forms/week/week-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 9285e36..0000000
Binary files a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/month/month-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 6eedce9..0000000
Binary files a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/time/time-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 4bfae0b..0000000
Binary files a/LayoutTests/platform/chromium-mac-snowleopard/fast/forms/week/week-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index c3169c4..0000000
Binary files a/LayoutTests/platform/chromium-mac/fast/forms/month/month-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 300c10a..0000000
Binary files a/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 881589f..0000000
Binary files a/LayoutTests/platform/chromium-mac/fast/forms/week/week-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index eed1a69..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/forms/month/month-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index f2ff2ee..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/forms/time/time-appearance-pseudo-classes-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png b/LayoutTests/platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png
deleted file mode 100644 (file)
index 2d3a8da..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/forms/week/week-appearance-pseudo-classes-expected.png and /dev/null differ