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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/pseudo-placeholder.html

Issue 2509593002: Implement ::placeholder CSS selector. (Closed)
Patch Set: <!DOCTYPE html> Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/text/placeholder-pseudo-style.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/pseudo-placeholder.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/pseudo-placeholder.html b/third_party/WebKit/LayoutTests/fast/css/pseudo-placeholder.html
new file mode 100644
index 0000000000000000000000000000000000000000..25684f89a198b2655e4efd886e9372fc07f0c416
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/pseudo-placeholder.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+input::placeholder:hover {
+ color: blue;
+}
+input::placeholder {
+ color: green;
+}
+input::-webkit-input-placeholder {
+ background: red;
+}
+</style>
+<script>
+test(t => {
+ // There are three rules in the style element. But the first one should be
+ // dropped.
+ assert_equals(document.styleSheets[0].rules.length, 2);
+}, '::placeholder with a user-action selector should be an error.');
+
+test(t => {
+ assert_equals(document.styleSheets[0].rules[0].selectorText, 'input::placeholder');
+}, 'Serialization for ::placeholder should be ::placeholder.');
+
+test(t => {
+ // Compatibility with Safari and Firefox.
+ assert_equals(document.styleSheets[0].rules[1].selectorText, 'input::-webkit-input-placeholder');
+}, 'Serialization for ::-webkit-input-placeholder should be ::-webkit-input-placeholder.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/text/placeholder-pseudo-style.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698