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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/pseudo-default-option.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-option.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/pseudo-default-option.html b/third_party/WebKit/LayoutTests/fast/css/pseudo-default-option.html
new file mode 100644
index 0000000000000000000000000000000000000000..d762b8910a48503e654ac6b79071c47ed8f8d920
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/pseudo-default-option.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<form method="get">
+<select>
+<option name="n">1</option>
+<option name="y" selected>2</option>
+<option id="o1" name="y">3</option>
+<option id="o2" name="n">4</option>
+</select>
+</form>
+<script>
+test(function() {
+ document.getElementById("o1").defaultSelected = true;
+ document.getElementById("o2").selected = true;
+ u = document.getElementsByName("n");
+ for (i = 0; i < u.length; i++)
+ assert_false(u[i].matches(":default"));
+ v = document.getElementsByName("y");
+ for (i = 0; i < v.length; i++)
+ assert_true(v[i].matches(":default"));
+}, "This test performs a check for option elements having selected attribute to be considered for :default CSS selector.");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698