Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js

Issue 9805002: Revert 105710 - Introduce RadioButtonGroup class to keep track of the group members and required st… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js
===================================================================
--- LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js (revision 111481)
+++ LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js (working copy)
@@ -10,8 +10,11 @@
var inputs = document.getElementsByName('victim');
debug('No checked button:');
shouldBeTrue('inputs[0].validity.valueMissing');
-shouldBeTrue('inputs[1].validity.valueMissing');
-shouldBeTrue('inputs[2].validity.valueMissing');
+// The following result should be false because the element does not have
+// "required". It conforms to HTML5, and this behavior has no practical
+// problems.
+shouldBeFalse('inputs[1].validity.valueMissing');
+shouldBeFalse('inputs[2].validity.valueMissing');
debug('The second button has been checked:');
inputs[1].checked = true;
shouldBeFalse('inputs[0].validity.valueMissing');
@@ -28,7 +31,6 @@
shouldBeFalse('inputs[1].validity.valueMissing');
shouldBeFalse('inputs[2].validity.valueMissing');
-debug('');
debug('With form element');
parent.innerHTML = '<form>'
+ '<input name=victim type=radio required>'
@@ -38,8 +40,9 @@
inputs = document.getElementsByName('victim');
debug('No checked button:');
shouldBeTrue('inputs[0].validity.valueMissing');
-shouldBeTrue('inputs[1].validity.valueMissing');
-shouldBeTrue('inputs[2].validity.valueMissing');
+// The following result should be false.
+shouldBeFalse('inputs[1].validity.valueMissing');
+shouldBeFalse('inputs[2].validity.valueMissing');
debug('The first button has been checked:');
inputs[0].checked = true;
shouldBeFalse('inputs[0].validity.valueMissing');
@@ -55,22 +58,3 @@
shouldBeFalse('inputs[0].validity.valueMissing');
shouldBeFalse('inputs[1].validity.valueMissing');
shouldBeFalse('inputs[2].validity.valueMissing');
-
-debug('');
-debug('Not in a radio button group');
-var requiredButton = document.createElement('input');
-requiredButton.type = 'radio';
-requiredButton.name = 'victim';
-requiredButton.required = true;
-shouldBeFalse('requiredButton.validity.valueMissing');
-
-parent.innerHTML = '<input name=victim type=radio required><input name=victim type=radio>';
-requiredButton = document.getElementsByName('victim')[0];
-var button = document.getElementsByName('victim')[1];
-shouldBeTrue('requiredButton.validity.valueMissing');
-shouldBeTrue('button.validity.valueMissing');
-parent.removeChild(button);
-shouldBeFalse('button.validity.valueMissing');
-parent.removeChild(requiredButton);
-shouldBeFalse('requiredButton.validity.valueMissing');
-
« no previous file with comments | « LayoutTests/fast/forms/radio/radio-live-validation-style-expected.txt ('k') | LayoutTests/perf/adding-radio-buttons.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698