Changeset 113511 in webkit
- Timestamp:
- Apr 6, 2012 3:48:44 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r113509 r113511 1 2012-04-06 Ilya Sherman <isherman@chromium.org> 2 3 Allow site authors to override autofilled fields' colors. 4 https://bugs.webkit.org/show_bug.cgi?id=66032 5 http://code.google.com/p/chromium/issues/detail?id=46543 6 7 Reviewed by Simon Fraser. 8 9 * fast/forms/input-autofilled-expected.txt: 10 * fast/forms/input-autofilled.html: 11 1 12 2012-04-06 Dirk Pranke <dpranke@chromium.org> 2 13 -
trunk/LayoutTests/fast/forms/input-autofilled-expected.txt
r81155 r113511 1 1 This tests that foreground and background colors properly change for autofilled inputs. It can only be run using DumpRenderTree. 2 3 PASS computedStyleUnstyled.color == originalForegroundUnstyled is true 4 PASS computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled is false 5 PASS computedStyleStyled.color == originalForegroundStyled is true 6 PASS computedStyleStyled.backgroundColor == originalBackgroundStyled is true 7 PASS computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector is false 8 PASS computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector is false 9 PASS computedStyleUnstyled.color == originalForegroundUnstyled is true 10 PASS computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled is true 11 PASS computedStyleStyled.color == originalForegroundStyled is true 12 PASS computedStyleStyled.backgroundColor == originalBackgroundStyled is true 13 PASS computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector is true 14 PASS computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector is true 2 15 3 PASS4 -
trunk/LayoutTests/fast/forms/input-autofilled.html
r81155 r113511 8 8 } 9 9 10 var tf = document.getElementById('tf'); 11 var computedStyle = document.defaultView.getComputedStyle(tf); 12 var originalForeground = computedStyle.color; 13 var originalBackground = computedStyle.backgroundColor; 10 var unstyled = document.getElementById('unstyled'); 11 var styled = document.getElementById('styled'); 12 var styledWithSelector = document.getElementById('styledWithSelector'); 13 computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled); 14 originalForegroundUnstyled = computedStyleUnstyled.color; 15 originalBackgroundUnstyled = computedStyleUnstyled.backgroundColor; 16 computedStyleStyled = document.defaultView.getComputedStyle(styled); 17 originalForegroundStyled = computedStyleStyled.color; 18 originalBackgroundStyled = computedStyleStyled.backgroundColor; 19 computedStyleStyledWithSelector = document.defaultView.getComputedStyle(styledWithSelector); 20 originalForegroundStyledWithSelector = computedStyleStyledWithSelector.color; 21 originalBackgroundStyledWithSelector = computedStyleStyledWithSelector.backgroundColor; 14 22 15 23 if (window.layoutTestController) { 16 layoutTestController.setAutofilled(tf, true); 24 layoutTestController.setAutofilled(unstyled, true); 25 layoutTestController.setAutofilled(styled, true); 26 layoutTestController.setAutofilled(styledWithSelector, true); 17 27 } 18 28 19 // Both the foreground and background colors should change. 20 computedStyle = document.defaultView.getComputedStyle(tf); 21 var autofilledForeground = computedStyle.color; 22 var autofilledBackground = computedStyle.backgroundColor; 23 if (autofilledForeground == originalForeground) { 24 testFailed('Foreground color did not change when autofilled.'); 25 return; 26 } 27 if (autofilledBackground == originalBackground) { 28 testFailed('Background color did not change when autofilled.'); 29 return; 30 } 29 // For the unstyled element, the background color should change. The foreground color should not change, 30 // as the default foreground color for an autofilled input is the same as for a non-autofilled input. 31 // For the styled element, the author-specified style should take precedence, so neither color should change. 32 // For the element styled with the :-webkit-autofill selector, both the foreground and the background colors 33 // should change. 34 computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled); 35 computedStyleStyled = document.defaultView.getComputedStyle(styled); 36 computedStyleStyledWithSelector = document.defaultView.getComputedStyle(styledWithSelector); 37 shouldBeTrue("computedStyleUnstyled.color == originalForegroundUnstyled"); 38 shouldBeFalse("computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled"); 39 shouldBeTrue("computedStyleStyled.color == originalForegroundStyled"); 40 shouldBeTrue("computedStyleStyled.backgroundColor == originalBackgroundStyled"); 41 shouldBeFalse("computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector"); 42 shouldBeFalse("computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector"); 31 43 32 44 if (window.layoutTestController) { 33 layoutTestController.setAutofilled(tf, false); 45 layoutTestController.setAutofilled(unstyled, false); 46 layoutTestController.setAutofilled(styled, false); 47 layoutTestController.setAutofilled(styledWithSelector, false); 34 48 } 35 49 36 50 // Colors should be restored. 37 computedStyle = document.defaultView.getComputedStyle(tf); 38 if (computedStyle.color != originalForeground) { 39 testFailed('Foreground color did not revert when un-autofilled.'); 40 return; 41 } 42 if (computedStyle.backgroundColor != originalBackground) { 43 testFailed('Background color did not revert when un-autofilled.'); 44 return; 45 } 46 47 testPassed(''); 51 computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled); 52 computedStyleStyled = document.defaultView.getComputedStyle(styled); 53 shouldBeTrue("computedStyleUnstyled.color == originalForegroundUnstyled"); 54 shouldBeTrue("computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled"); 55 shouldBeTrue("computedStyleStyled.color == originalForegroundStyled"); 56 shouldBeTrue("computedStyleStyled.backgroundColor == originalBackgroundStyled"); 57 shouldBeTrue("computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector"); 58 shouldBeTrue("computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector"); 48 59 } 49 60 </script> 50 61 51 62 <style> 52 #tf { 53 color: #FFFFFF; 54 background-color: #FFFFFF; 63 #styled { 64 color: #00FF00; 65 background-color: #00FF00; 66 } 67 68 #styledWithSelector:-webkit-autofill { 69 color: #00FF00; 70 background-color: #00FF00; 55 71 } 56 72 </style> … … 59 75 This tests that foreground and background colors properly change for autofilled inputs. It can only be run using DumpRenderTree.<br> 60 76 <form name="fm"> 61 <input type="text" id="tf" value="Field value" /> 77 <input type="text" id="unstyled" value="Field value" /> 78 <input type="text" id="styled" value="Field value" /> 79 <input type="text" id="styledWithSelector" value="Field value" /> 62 80 </form> 63 81 <div id="console"></div> -
trunk/Source/WebCore/ChangeLog
r113510 r113511 1 2012-04-06 Ilya Sherman <isherman@chromium.org> 2 3 Allow site authors to override autofilled fields' colors. 4 https://bugs.webkit.org/show_bug.cgi?id=66032 5 http://code.google.com/p/chromium/issues/detail?id=46543 6 7 Reviewed by Simon Fraser. 8 9 * css/html.css: 10 (input:-webkit-autofill): Remove !important declarations. 11 1 12 2012-04-05 Enrica Casucci <enrica@apple.com> 2 13 -
trunk/Source/WebCore/css/html.css
r113320 r113511 538 538 539 539 input:-webkit-autofill { 540 background-color: #FAFFBD !important;541 background-image: none !important;542 color: #000000 !important;540 background-color: #FAFFBD; 541 background-image: none; 542 color: #000000; 543 543 } 544 544
Note: See TracChangeset
for help on using the changeset viewer.