Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate week and month cases from selection-not-application.html #32479

Merged
merged 3 commits into from
Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=variant content="">
<meta name=variant content="?week,month">
<title>text field selection</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var nonApplicableTypes = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"];
var nonApplicableTypes = ["hidden", "email", "datetime-local", "date", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"];
var applicableTypes = ["text", "search", "tel", "url", "password", "aninvalidtype", null];

if (location.search) {
// If the <meta name=variant> tag used is non-empty, then use it instead of
// nonApplicableTypes.
nonApplicableTypes = location.search.substr(1).split(',');
}

nonApplicableTypes.forEach(function(type){
var el = document.createElement("input");
el.type = type;

if (el.type != type) {
// Type is not supported - don't bother with the following checks.
return;
}

test(() => {
assert_equals(el.selectionStart, null);
}, `selectionStart on an input[type=${type}] returns null`);
Expand Down