Title: [115706] trunk
Revision
115706
Author
[email protected]
Date
2012-04-30 20:21:54 -0700 (Mon, 30 Apr 2012)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115705 => 115706)


--- trunk/LayoutTests/ChangeLog	2012-05-01 03:13:06 UTC (rev 115705)
+++ trunk/LayoutTests/ChangeLog	2012-05-01 03:21:54 UTC (rev 115706)
@@ -1,3 +1,17 @@
+2012-04-30  Ilya Sherman  <[email protected]>
+
+        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
+
+        * fast/forms/input-autofilled-expected.txt:
+        * fast/forms/input-autofilled.html:
+
 2012-04-30  Keishi Hattori  <[email protected]>
 
         datalist: Inconsistent behavior of HTMLInputElement::list

Modified: trunk/LayoutTests/fast/forms/input-autofilled-expected.txt (115705 => 115706)


--- trunk/LayoutTests/fast/forms/input-autofilled-expected.txt	2012-05-01 03:13:06 UTC (rev 115705)
+++ trunk/LayoutTests/fast/forms/input-autofilled-expected.txt	2012-05-01 03:21:54 UTC (rev 115706)
@@ -1,15 +1,4 @@
 This tests that foreground and background colors properly change for autofilled inputs. It can only be run using DumpRenderTree.
-    
-PASS computedStyleUnstyled.color == originalForegroundUnstyled is true
-PASS computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled is false
-PASS computedStyleStyled.color == originalForegroundStyled is true
-PASS computedStyleStyled.backgroundColor == originalBackgroundStyled is true
-PASS computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector is false
-PASS computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector is false
-PASS computedStyleUnstyled.color == originalForegroundUnstyled is true
-PASS computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled is true
-PASS computedStyleStyled.color == originalForegroundStyled is true
-PASS computedStyleStyled.backgroundColor == originalBackgroundStyled is true
-PASS computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector is true
-PASS computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector is true
 
+PASS 
+

Modified: trunk/LayoutTests/fast/forms/input-autofilled.html (115705 => 115706)


--- trunk/LayoutTests/fast/forms/input-autofilled.html	2012-05-01 03:13:06 UTC (rev 115705)
+++ trunk/LayoutTests/fast/forms/input-autofilled.html	2012-05-01 03:21:54 UTC (rev 115706)
@@ -7,76 +7,58 @@
             layoutTestController.dumpAsText();
         }
 
-        var unstyled = document.getElementById('unstyled');
-        var styled = document.getElementById('styled');
-        var styledWithSelector = document.getElementById('styledWithSelector');
-        computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled);
-        originalForegroundUnstyled = computedStyleUnstyled.color;
-        originalBackgroundUnstyled = computedStyleUnstyled.backgroundColor;
-        computedStyleStyled = document.defaultView.getComputedStyle(styled);
-        originalForegroundStyled = computedStyleStyled.color;
-        originalBackgroundStyled = computedStyleStyled.backgroundColor;
-        computedStyleStyledWithSelector = document.defaultView.getComputedStyle(styledWithSelector);
-        originalForegroundStyledWithSelector = computedStyleStyledWithSelector.color;
-        originalBackgroundStyledWithSelector = computedStyleStyledWithSelector.backgroundColor;
+        var tf = document.getElementById('tf');
+        var computedStyle = document.defaultView.getComputedStyle(tf);
+        var originalForeground = computedStyle.color;
+        var originalBackground = computedStyle.backgroundColor;
 
         if (window.layoutTestController) {
-            layoutTestController.setAutofilled(unstyled, true);
-            layoutTestController.setAutofilled(styled, true);
-            layoutTestController.setAutofilled(styledWithSelector, true);
+            layoutTestController.setAutofilled(tf, true);
         }
 
-        // For the unstyled element, the background color should change.  The foreground color should not change,
-        // as the default foreground color for an autofilled input is the same as for a non-autofilled input.
-        // For the styled element, the author-specified style should take precedence, so neither color should change.
-        // For the element styled with the :-webkit-autofill selector, both the foreground and the background colors
-        // should change.
-        computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled);
-        computedStyleStyled = document.defaultView.getComputedStyle(styled);
-        computedStyleStyledWithSelector = document.defaultView.getComputedStyle(styledWithSelector);
-        shouldBeTrue("computedStyleUnstyled.color == originalForegroundUnstyled");
-        shouldBeFalse("computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled");
-        shouldBeTrue("computedStyleStyled.color == originalForegroundStyled");
-        shouldBeTrue("computedStyleStyled.backgroundColor == originalBackgroundStyled");
-        shouldBeFalse("computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector");
-        shouldBeFalse("computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector");
+        // Both the foreground and background colors should change.
+        computedStyle = document.defaultView.getComputedStyle(tf);
+        var autofilledForeground = computedStyle.color;
+        var autofilledBackground = computedStyle.backgroundColor;
+        if (autofilledForeground == originalForeground) {
+            testFailed('Foreground color did not change when autofilled.');
+            return;
+        }
+        if (autofilledBackground == originalBackground) {
+            testFailed('Background color did not change when autofilled.');
+            return;
+        }
 
         if (window.layoutTestController) {
-            layoutTestController.setAutofilled(unstyled, false);
-            layoutTestController.setAutofilled(styled, false);
-            layoutTestController.setAutofilled(styledWithSelector, false);
+            layoutTestController.setAutofilled(tf, false);
         }
 
         // Colors should be restored.
-        computedStyleUnstyled = document.defaultView.getComputedStyle(unstyled);
-        computedStyleStyled = document.defaultView.getComputedStyle(styled);
-        shouldBeTrue("computedStyleUnstyled.color == originalForegroundUnstyled");
-        shouldBeTrue("computedStyleUnstyled.backgroundColor == originalBackgroundUnstyled");
-        shouldBeTrue("computedStyleStyled.color == originalForegroundStyled");
-        shouldBeTrue("computedStyleStyled.backgroundColor == originalBackgroundStyled");
-        shouldBeTrue("computedStyleStyledWithSelector.color == originalForegroundStyledWithSelector");
-        shouldBeTrue("computedStyleStyledWithSelector.backgroundColor == originalBackgroundStyledWithSelector");
+        computedStyle = document.defaultView.getComputedStyle(tf);
+        if (computedStyle.color != originalForeground) {
+            testFailed('Foreground color did not revert when un-autofilled.');
+            return;
+        }
+        if (computedStyle.backgroundColor != originalBackground) {
+            testFailed('Background color did not revert when un-autofilled.');
+            return;
+        }
+
+        testPassed('');
     }
     </script>
 
     <style>
-    #styled {
-      color: #00FF00;
-      background-color: #00FF00;
+    #tf {
+      color: #FFFFFF;
+      background-color: #FFFFFF;
     }
-    
-    #styledWithSelector:-webkit-autofill {
-      color: #00FF00;
-      background-color: #00FF00;
-    }
     </style>
 </head>
 <body _onload_="test()">
     This tests that foreground and background colors properly change for autofilled inputs.  It can only be run using DumpRenderTree.<br>
     <form name="fm">
-        <input type="text" id="unstyled" value="Field value" />
-        <input type="text" id="styled" value="Field value" />
-        <input type="text" id="styledWithSelector" value="Field value" />
+        <input type="text" id="tf" value="Field value" />
     </form>
     <div id="console"></div>
 </body>

Modified: trunk/Source/WebCore/ChangeLog (115705 => 115706)


--- trunk/Source/WebCore/ChangeLog	2012-05-01 03:13:06 UTC (rev 115705)
+++ trunk/Source/WebCore/ChangeLog	2012-05-01 03:21:54 UTC (rev 115706)
@@ -1,3 +1,17 @@
+2012-04-30  Ilya Sherman  <[email protected]>
+
+        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
+
+        * css/html.css:
+        (input:-webkit-autofill): Restore !important modifiers
+
 2012-04-30  Julien Chaffraix  <[email protected]>
 
         Move RenderTableCell's row index to RenderTableRow

Modified: trunk/Source/WebCore/css/html.css (115705 => 115706)


--- trunk/Source/WebCore/css/html.css	2012-05-01 03:13:06 UTC (rev 115705)
+++ trunk/Source/WebCore/css/html.css	2012-05-01 03:21:54 UTC (rev 115706)
@@ -532,9 +532,9 @@
 }
 
 input:-webkit-autofill {
-    background-color: #FAFFBD;
-    background-image: none;
-    color: #000000;
+    background-color: #FAFFBD !important;
+    background-image:none !important;
+    color: #000000 !important;
 }
 
 input[type="radio"], input[type="checkbox"] {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to