| Index: LayoutTests/fast/forms/input-autofilled.html
|
| diff --git a/LayoutTests/fast/forms/input-autofilled.html b/LayoutTests/fast/forms/input-autofilled.html
|
| index e7f8aacfde47583c9b064bc030df51011bc48e89..b0543e23a7ffd8116b7b8338def20d93f33a777b 100644
|
| --- a/LayoutTests/fast/forms/input-autofilled.html
|
| +++ b/LayoutTests/fast/forms/input-autofilled.html
|
| @@ -13,9 +13,11 @@
|
|
|
| var field = document.getElementById('field');
|
| var textarea = document.getElementById('textarea');
|
| + var select = document.getElementById('select');
|
|
|
| var computedStyleField = document.defaultView.getComputedStyle(field);
|
| var computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
|
| + var computedStyleSelect = document.defaultView.getComputedStyle(select);
|
| var originalForeground = computedStyleField.color;
|
| var originalBackground = computedStyleField.backgroundColor;
|
|
|
| @@ -31,11 +33,13 @@
|
| if (window.internals) {
|
| window.internals.setAutofilled(field, true);
|
| window.internals.setAutofilled(textarea, true);
|
| + window.internals.setAutofilled(select, true);
|
| }
|
|
|
| // Both the foreground and background colors should change.
|
| computedStyleField = document.defaultView.getComputedStyle(field);
|
| computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
|
| + computedStyleSelect = document.defaultView.getComputedStyle(select);
|
| if (computedStyleField.color == originalForeground) {
|
| testFailed('Foreground color for <input> element did not change when autofilled.');
|
| return;
|
| @@ -52,15 +56,25 @@
|
| testFailed('Background color for <textarea> element did not change when autofilled.');
|
| return;
|
| }
|
| + if (computedStyleSelect.color == originalForeground) {
|
| + testFailed('Foreground color for <select> element did not change when autofilled.');
|
| + return;
|
| + }
|
| + if (computedStyleSelect.backgroundColor == originalBackground) {
|
| + testFailed('Background color for <select> element did not change when autofilled.');
|
| + return;
|
| + }
|
|
|
| if (window.internals) {
|
| window.internals.setAutofilled(field, false);
|
| window.internals.setAutofilled(textarea, false);
|
| + window.internals.setAutofilled(select, false);
|
| }
|
|
|
| // Colors should be restored.
|
| computedStyleField = document.defaultView.getComputedStyle(field);
|
| computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
|
| + computedStyleSelect = document.defaultView.getComputedStyle(select);
|
| if (computedStyleField.color != originalForeground) {
|
| testFailed('Foreground color for <input> element did not revert when un-autofilled.');
|
| return;
|
| @@ -77,23 +91,32 @@
|
| testFailed('Background color for <textarea> element did not revert when un-autofilled.');
|
| return;
|
| }
|
| + if (computedStyleSelect.color != originalForeground) {
|
| + testFailed('Foreground color for <select> element did not revert when un-autofilled.');
|
| + return;
|
| + }
|
| + if (computedStyleSelect.backgroundColor != originalBackground) {
|
| + testFailed('Background color for <select> element did not revert when un-autofilled.');
|
| + return;
|
| + }
|
|
|
| testPassed('');
|
| }
|
| </script>
|
|
|
| <style>
|
| - #field, #textarea {
|
| + #field, #textarea, #select {
|
| color: #FFFFFF;
|
| background-color: #FFFFFF;
|
| }
|
| </style>
|
| </head>
|
| <body onload="test()">
|
| - This tests that foreground and background colors properly change for autofilled inputs. It can only be run using the test harness.<br>
|
| + This tests that foreground and background colors properly change for autofilled inputs or select options. It can only be run using the test harness.<br>
|
| <form name="fm">
|
| <input type="text" id="field" value="Field value">
|
| <textarea id="textarea"></textarea>
|
| + <select id="select"></select>
|
| </form>
|
| <div id="console"></div>
|
| </body>
|
|
|