| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <link rel="stylesheet" href="../resources/live-pseudo-selectors.css"> | 4 <link rel="stylesheet" href="../resources/live-pseudo-selectors.css"> |
| 5 <script src="../../../resources/js-test.js"></script> | 5 <script src="../../../resources/js-test.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="console"></div> | 9 <div id="console"></div> |
| 10 <script> | 10 <script> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 el.value = 'abc'; | 79 el.value = 'abc'; |
| 80 shouldBe(elBackground, 'validColor'); | 80 shouldBe(elBackground, 'validColor'); |
| 81 el.value = ''; | 81 el.value = ''; |
| 82 shouldBe(elBackground, 'invalidColor'); | 82 shouldBe(elBackground, 'invalidColor'); |
| 83 | 83 |
| 84 debug('Change the value by key input:'); | 84 debug('Change the value by key input:'); |
| 85 el = makeInvalid(); | 85 el = makeInvalid(); |
| 86 el.focus(); | 86 el.focus(); |
| 87 eventSender.keyDown('a'); | 87 eventSender.keyDown('a'); |
| 88 shouldBe(elBackground, 'validColor'); | 88 shouldBe(elBackground, 'validColor'); |
| 89 eventSender.keyDown('backspace', []); | 89 eventSender.keyDown('Backspace', []); |
| 90 shouldBe(elBackground, 'invalidColor'); | 90 shouldBe(elBackground, 'invalidColor'); |
| 91 | 91 |
| 92 // -------------------------------- | 92 // -------------------------------- |
| 93 // Constraints change | 93 // Constraints change |
| 94 // -------------------------------- | 94 // -------------------------------- |
| 95 debug('Change required:'); | 95 debug('Change required:'); |
| 96 el = makeInvalid(); | 96 el = makeInvalid(); |
| 97 el.required = false; | 97 el.required = false; |
| 98 shouldBe(elBackground, 'validColor'); | 98 shouldBe(elBackground, 'validColor'); |
| 99 el.required = true; | 99 el.required = true; |
| 100 shouldBe(elBackground, 'invalidColor'); | 100 shouldBe(elBackground, 'invalidColor'); |
| 101 | 101 |
| 102 debug('Change maxlength:'); | 102 debug('Change maxlength:'); |
| 103 el = makeInvalid(); | 103 el = makeInvalid(); |
| 104 el.value = '1234567890'; | 104 el.value = '1234567890'; |
| 105 shouldBe(elBackground, 'validColor'); | 105 shouldBe(elBackground, 'validColor'); |
| 106 // Make the value dirty by deleting the last character. | 106 // Make the value dirty by deleting the last character. |
| 107 el.focus(); | 107 el.focus(); |
| 108 el.setSelectionRange(10, 10); | 108 el.setSelectionRange(10, 10); |
| 109 eventSender.keyDown('backspace'); | 109 eventSender.keyDown('Backspace'); |
| 110 el.maxLength = 5; | 110 el.maxLength = 5; |
| 111 shouldBe(elBackground, 'invalidColor'); | 111 shouldBe(elBackground, 'invalidColor'); |
| 112 el.maxLength = 10; | 112 el.maxLength = 10; |
| 113 shouldBe(elBackground, 'validColor'); | 113 shouldBe(elBackground, 'validColor'); |
| 114 </script> | 114 </script> |
| 115 </body> | 115 </body> |
| 116 </html> | 116 </html> |
| OLD | NEW |