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

Unified Diff: LayoutTests/fast/forms/fieldset-pseudo-valid-style.html

Issue 703473003: Fix bug where form/fieldset :valid/:invalid won't be recalculated upon control's willValidate change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update a css layout test now that number of SubtreeStyleChange went down Created 6 years, 1 month 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/fieldset-pseudo-valid-style.html
diff --git a/LayoutTests/fast/forms/fieldset-pseudo-valid-style.html b/LayoutTests/fast/forms/fieldset-pseudo-valid-style.html
index 1edcadae742b87bb71a10d7c09c7073c1e035523..8929f603cf1e97e247a8678c0a4d92c2fabfbc0d 100644
--- a/LayoutTests/fast/forms/fieldset-pseudo-valid-style.html
+++ b/LayoutTests/fast/forms/fieldset-pseudo-valid-style.html
@@ -29,7 +29,7 @@ var subValidColor = 'rgb(0, 127, 0)';
var parent = document.createElement('div');
document.body.appendChild(parent);
-debug('Removing and adding required text inputs and modifying ther value by a DOM tree mutation:');
+debug('Removing and adding required text inputs and modifying their value by a DOM tree mutation:');
parent.innerHTML = '<fieldset id=fieldset1><input type=text id=input1 required><input type=text id=input2 required value=a><input type=submit id=sub1></fieldset>';
var fieldset1 = $('fieldset1');
var input1 = $('input1');
@@ -47,6 +47,21 @@ shouldBe('input2.setAttribute("value", ""); backgroundOf(fieldset1)', 'invalidCo
shouldBe('backgroundOf(sub1)', 'subInvalidColor');
debug('')
+debug('Disabling and marking inputs readonly by a DOM tree mutation:');
+parent.innerHTML = '<fieldset id=fieldset1><input type=text id=input1 required><input type=text id=input2 required value=a><input type=submit id=sub1></fieldset>';
+var fieldset1 = $('fieldset1');
+var input1 = $('input1');
+var sub1 = $('sub1');
+shouldBe('backgroundOf(fieldset1)', 'invalidColor');
+shouldBe('backgroundOf(sub1)', 'subInvalidColor');
+shouldBe('input1.disabled=1; backgroundOf(fieldset1)', 'validColor');
+shouldBe('backgroundOf(sub1)', 'subValidColor');
+shouldBe('input1.disabled=0; backgroundOf(fieldset1)', 'invalidColor');
+shouldBe('backgroundOf(sub1)', 'subInvalidColor');
+shouldBe('input1.setAttribute("readonly", "1"); backgroundOf(fieldset1)', 'validColor');
+shouldBe('backgroundOf(sub1)', 'subValidColor');
+debug('')
+
debug('Adding a required text input that is not a direct child of the fieldset:');
parent.innerHTML = '<fieldset id=fieldset1></fieldset>';
var fieldset1 = $('fieldset1');

Powered by Google App Engine
This is Rietveld 408576698