Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
|
esprehn
2015/08/21 10:18:10
ditto
ramya.v
2015/08/25 10:24:45
Done.
| |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 <style> | |
| 6 target { | |
| 7 background-color: white; | |
| 8 } | |
| 9 :placeholder-shown + target { | |
| 10 background-color: rgb(1, 2, 3); | |
| 11 } | |
| 12 </style> | |
| 13 </head> | |
| 14 <body> | |
| 15 <div> | |
| 16 <input id="input-with-renderer"> | |
| 17 <target id="target1"></target> | |
| 18 <textarea id="textarea-with-renderer"></textarea> | |
| 19 <target id="target2"></target> | |
| 20 </div> | |
| 21 <div style="display:none;"> | |
| 22 <input id="input-without-renderer"> | |
| 23 <target id="target3"></target> | |
| 24 <textarea id="textarea-without-renderer"></textarea> | |
| 25 <target id="target4"></target> | |
| 26 </div> | |
| 27 </body> | |
| 28 <script> | |
| 29 description('Test style update of the :placeholder-shown pseudo class.'); | |
| 30 function testBackgroundColor(expectMatch) { | |
| 31 shouldBeEqualToString('getComputedStyle(document.getElementById("target1")). backgroundColor', expectMatch ? 'rgb(1, 2, 3)' : 'rgb(255, 255, 255)'); | |
| 32 shouldBeEqualToString('getComputedStyle(document.getElementById("target2")). backgroundColor', expectMatch ? 'rgb(1, 2, 3)' : 'rgb(255, 255, 255)'); | |
| 33 shouldBeEqualToString('getComputedStyle(document.getElementById("target3")). backgroundColor', expectMatch ? 'rgb(1, 2, 3)' : 'rgb(255, 255, 255)'); | |
| 34 shouldBeEqualToString('getComputedStyle(document.getElementById("target4")). backgroundColor', expectMatch ? 'rgb(1, 2, 3)' : 'rgb(255, 255, 255)'); | |
| 35 } | |
| 36 var inputCaseWithRenderer = document.getElementById("input-with-renderer"); | |
| 37 var textareaCaseWithRenderer = document.getElementById("textarea-with-renderer") ; | |
| 38 var inputCaseWithoutRenderer = document.getElementById("input-without-renderer") ; | |
| 39 var textareaCaseWithoutRenderer = document.getElementById("textarea-without-rend erer"); | |
| 40 function setAttribute(attribute, value) { | |
| 41 inputCaseWithRenderer.setAttribute(attribute, value); | |
| 42 textareaCaseWithRenderer.setAttribute(attribute, value); | |
| 43 inputCaseWithoutRenderer.setAttribute(attribute, value); | |
| 44 textareaCaseWithoutRenderer.setAttribute(attribute, value); | |
| 45 } | |
| 46 debug("Initial state is without placehoder."); | |
| 47 testBackgroundColor(false); | |
| 48 debug("Adding a placeholder, the targets should match the style."); | |
| 49 setAttribute("placeholder", "WebKit") | |
| 50 testBackgroundColor(true); | |
| 51 </script> | |
| 52 </html> | |
| OLD | NEW |