Changeset 115706 in webkit


Ignore:
Timestamp:
Apr 30, 2012 8:21:54 PM (12 years ago)
Author:
isherman@chromium.org
Message:

Unreviewed, rolling out r113511.
http://trac.webkit.org/changeset/113511
https://bugs.webkit.org/show_bug.cgi?id=66032
https://bugs.webkit.org/show_bug.cgi?id=85150

Regression: Many autofilled form fields lack the default
autofill background even when authors don’t override the
autofill colors

Source/WebCore:

  • css/html.css:

(input:-webkit-autofill): Restore !important modifiers

LayoutTests:

  • fast/forms/input-autofilled-expected.txt:
  • fast/forms/input-autofilled.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115704 r115706  
     12012-04-30  Ilya Sherman  <isherman@chromium.org>
     2
     3        Unreviewed, rolling out r113511.
     4        http://trac.webkit.org/changeset/113511
     5        https://bugs.webkit.org/show_bug.cgi?id=66032
     6        https://bugs.webkit.org/show_bug.cgi?id=85150
     7
     8        Regression: Many autofilled form fields lack the default
     9        autofill background even when authors don’t override the
     10        autofill colors
     11
     12        * fast/forms/input-autofilled-expected.txt:
     13        * fast/forms/input-autofilled.html:
     14
    1152012-04-30  Keishi Hattori  <keishi@webkit.org>
    216
  • trunk/LayoutTests/fast/forms/input-autofilled-expected.txt

    r113511 r115706  
    11This 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
    152
     3PASS
     4
  • trunk/LayoutTests/fast/forms/input-autofilled.html

    r113511 r115706  
    88        }
    99
    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;
     10        var tf = document.getElementById('tf');
     11        var computedStyle = document.defaultView.getComputedStyle(tf);
     12        var originalForeground = computedStyle.color;
     13        var originalBackground = computedStyle.backgroundColor;
    2214
    2315        if (window.layoutTestController) {
    24             layoutTestController.setAutofilled(unstyled, true);
    25             layoutTestController.setAutofilled(styled, true);
    26             layoutTestController.setAutofilled(styledWithSelector, true);
     16            layoutTestController.setAutofilled(tf, true);
    2717        }
    2818
    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");
     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        }
    4331
    4432        if (window.layoutTestController) {
    45             layoutTestController.setAutofilled(unstyled, false);
    46             layoutTestController.setAutofilled(styled, false);
    47             layoutTestController.setAutofilled(styledWithSelector, false);
     33            layoutTestController.setAutofilled(tf, false);
    4834        }
    4935
    5036        // Colors should be restored.
    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");
     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('');
    5948    }
    6049    </script>
    6150
    6251    <style>
    63     #styled {
    64       color: #00FF00;
    65       background-color: #00FF00;
    66     }
    67    
    68     #styledWithSelector:-webkit-autofill {
    69       color: #00FF00;
    70       background-color: #00FF00;
     52    #tf {
     53      color: #FFFFFF;
     54      background-color: #FFFFFF;
    7155    }
    7256    </style>
     
    7559    This tests that foreground and background colors properly change for autofilled inputs.  It can only be run using DumpRenderTree.<br>
    7660    <form name="fm">
    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" />
     61        <input type="text" id="tf" value="Field value" />
    8062    </form>
    8163    <div id="console"></div>
  • trunk/Source/WebCore/ChangeLog

    r115705 r115706  
     12012-04-30  Ilya Sherman  <isherman@chromium.org>
     2
     3        Unreviewed, rolling out r113511.
     4        http://trac.webkit.org/changeset/113511
     5        https://bugs.webkit.org/show_bug.cgi?id=66032
     6        https://bugs.webkit.org/show_bug.cgi?id=85150
     7
     8        Regression: Many autofilled form fields lack the default
     9        autofill background even when authors don’t override the
     10        autofill colors
     11
     12        * css/html.css:
     13        (input:-webkit-autofill): Restore !important modifiers
     14
    1152012-04-30  Julien Chaffraix  <jchaffraix@webkit.org>
    216
  • trunk/Source/WebCore/css/html.css

    r115052 r115706  
    533533
    534534input:-webkit-autofill {
    535     background-color: #FAFFBD;
    536     background-image: none;
    537     color: #000000;
     535    background-color: #FAFFBD !important;
     536    background-image:none !important;
     537    color: #000000 !important;
    538538}
    539539
Note: See TracChangeset for help on using the changeset viewer.