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

Side by Side Diff: LayoutTests/fast/forms/resources/select-live-pseudo-selectors.js

Issue 236753004: Re-land "Improve support for :read-only and :read-write pseudoclasses". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied."); 1 description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.");
2 2
3 // Setup for static elements. 3 // Setup for static elements.
4 var form = document.createElement('form'); 4 var form = document.createElement('form');
5 document.body.appendChild(form); 5 document.body.appendChild(form);
6 var nonForm = document.createElement('div'); 6 var nonForm = document.createElement('div');
7 document.body.appendChild(nonForm); 7 document.body.appendChild(nonForm);
8 8
9 function mouseDownOnSelect(selId, index, modifier) { 9 function mouseDownOnSelect(selId, index, modifier) {
10 var sl = document.getElementById(selId); 10 var sl = document.getElementById(selId);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 function backgroundOf(el) { 53 function backgroundOf(el) {
54 if (typeof(el) == 'string') 54 if (typeof(el) == 'string')
55 el = document.getElementById(el); 55 el = document.getElementById(el);
56 return document.defaultView.getComputedStyle(el, null).getPropertyValue('bac kground-color'); 56 return document.defaultView.getComputedStyle(el, null).getPropertyValue('bac kground-color');
57 } 57 }
58 58
59 var elBackground = 'backgroundOf(el)'; 59 var elBackground = 'backgroundOf(el)';
60 var invalidColor = 'rgb(255, 0, 0)'; 60 var invalidColor = 'rgb(255, 0, 0)';
61 var normalColor = 'rgb(255, 255, 255)'; 61 var normalColor = 'rgb(255, 255, 255)';
62 var disabledColor = 'rgb(0, 0, 0)'; 62 var disabledColor = 'rgb(0, 0, 0)';
63 var readOnlyColor = 'rgb(0, 255, 0)'
64 var transparentColor = 'rgba(0, 0, 0, 0)'; 63 var transparentColor = 'rgba(0, 0, 0, 0)';
65 var validColor = 'rgb(0, 0, 255)'; 64 var validColor = 'rgb(0, 0, 255)';
66 65
67 // -------------------------------- 66 // --------------------------------
68 // willValidate change 67 // willValidate change
69 // -------------------------------- 68 // --------------------------------
70 var el = makeInvalid(); 69 var el = makeInvalid();
71 var o1 = appendOption('', el); 70 var o1 = appendOption('', el);
72 var o2 = appendOption('X', el); 71 var o2 = appendOption('X', el);
73 o1.selected = true; 72 o1.selected = true;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // -------------------------------- 205 // --------------------------------
207 debug('Change required:'); 206 debug('Change required:');
208 el = makeInvalid(); 207 el = makeInvalid();
209 o1 = appendOption('', el); 208 o1 = appendOption('', el);
210 o2 = appendOption('X', el); 209 o2 = appendOption('X', el);
211 o1.selected = true; 210 o1.selected = true;
212 el.required = false; 211 el.required = false;
213 shouldBe(elBackground, 'validColor'); 212 shouldBe(elBackground, 'validColor');
214 el.required = true; 213 el.required = true;
215 shouldBe(elBackground, 'invalidColor'); 214 shouldBe(elBackground, 'invalidColor');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698