Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: LayoutTests/fast/forms/textarea/edit-autofilled-text.html

Issue 471803003: Adjust autofilled property for <search> input and <select> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and add NeedsRebaseLine for window test. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/textarea/edit-autofilled-text.html
diff --git a/LayoutTests/fast/forms/textarea/edit-autofilled-text.html b/LayoutTests/fast/forms/textarea/edit-autofilled-text.html
deleted file mode 100644
index 1c38e9843bb4ee5800b7dfa29c503971c6fbef3e..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/forms/textarea/edit-autofilled-text.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<head>
-<script src="../../../resources/js-test.js"></script>
-<script>
-function test() {
- if (!window.internals) {
- testFailed('This test requires the test harness to run.');
- return;
- }
-
- var textarea = document.querySelector('textarea');
- textarea.value = 'autofilled is true';
-
- var computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
- var originalForeground = computedStyleTextarea.color;
- var originalBackground = computedStyleTextarea.backgroundColor;
-
- if (window.internals)
- window.internals.setAutofilled(textarea, true);
-
- // Both the foreground and background colors should change.
- computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
- if (computedStyleTextarea.color == originalForeground) {
- testFailed('Foreground color for <textarea> element did not change when autofilled.');
- return;
- }
- if (computedStyleTextarea.backgroundColor == originalBackground) {
- testFailed('Background color for <textarea> element did not change when autofilled.');
- return;
- }
-
- // Edit the autofilled text.
- textarea.focus();
- document.execCommand('Delete', false, null);
- document.execCommand('Delete', false, null);
- document.execCommand('Delete', false, null);
- document.execCommand('Delete', false, null);
- document.execCommand('InsertText', false, 'false');
-
- // Colors should be restored.
- computedStyleTextarea = document.defaultView.getComputedStyle(textarea);
- if (computedStyleTextarea.color != originalForeground) {
- testFailed('Foreground color for <textarea> element did not revert when un-autofilled.');
- return;
- }
- if (computedStyleTextarea.backgroundColor != originalBackground) {
- testFailed('Background color for <textarea> element did not revert when un-autofilled.');
- return;
- }
-
- testPassed('');
-}
-</script>
-
-<style>
- textarea {
- color: #FFFFFF;
- background: transparent;
- }
-</style>
-</head>
-<body onload="test()">
- This tests that background and foreground colors for autofilled textarea should be restored to original colors when editing the text.<br>
- <form name="fm">
- <textarea id="textarea"></textarea>
- </form>
- <div id="console"></div>
-</body>

Powered by Google App Engine
This is Rietveld 408576698