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

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

Issue 1756483005: Option, checkbox and radio should support ':default' selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated as per review comments Created 4 years, 10 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: third_party/WebKit/LayoutTests/fast/css/pseudo-default-005.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/pseudo-default-005.html b/third_party/WebKit/LayoutTests/fast/css/pseudo-default-005.html
new file mode 100644
index 0000000000000000000000000000000000000000..320066bd6d8fadd9dd6bd12088f19998ee9d4593
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/pseudo-default-005.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
tkent 2016/03/03 13:29:07 Please do not add |-005| to the file name. It's h
ramya.v 2016/03/04 06:31:45 Done.
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
tkent 2016/03/03 13:29:07 I recommend to use testharness.js for new conforma
ramya.v 2016/03/04 06:31:45 Done.
+<style>
+ input:default { background: lime; }
+ option:default { background: lime; }
+ input { background: red; }
+ option { background: red; }
+</style>
+</head>
+<body>
+<p id="description"></p>
+<form method="get">
+<input name="y" type="checkbox" checked />
+<input name="n" type="checkbox" />
+<input name="n" type="radio" />
+<input name="y" type ="radio" checked />
tkent 2016/03/03 13:29:07 Add more cases: - other input types with 'checke
ramya.v 2016/03/04 06:31:45 Done.
+<select>
+<option name="n">1</option>
+<option name="y" selected>2</option>
tkent 2016/03/03 13:29:08 Add another case: - OPTION without selected attr
ramya.v 2016/03/04 06:31:45 Done.
+</select>
+</form>
+<div id="console"></div>
+<script>
+description("This test performs a check for the input types having checked attribute and option elements having selected attributes to be considered for :default CSS selector.");
+
+u = document.getElementsByName("n");
+for (i = 0; i < u.length; i++)
+ shouldBe("document.defaultView.getComputedStyle(u[i], null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
tkent 2016/03/03 13:29:08 You can simply check |shouldBeFalse("u[i].matches(
ramya.v 2016/03/04 06:31:45 Done.
+v = document.getElementsByName("y");
+for (i = 0; i < v.length; i++)
+ shouldBe("document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698