Skip to content

Commit

Permalink
Bug 1751269 [wpt PR 32479] - Separate week and month cases from selec…
Browse files Browse the repository at this point in the history
…tion-not-application.html, a=testonly

Automatic update from web-platform-tests
Separate week and month cases from selection-not-application.html (#32479)

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

This was discussed here:
web-platform-tests/interop#11 (comment)

* use meta variant instead of two tests

* Update html/semantics/forms/textfieldselection/selection-not-application.html

Co-authored-by: Philip Jägenstedt <philip@foolip.org>
--

wpt-commits: d6d6e9898ed1a7cb994f5d2bc23e5b23d0e8b90c
wpt-pr: 32479
  • Loading branch information
josepharhar authored and moz-wptsync-bot committed Mar 26, 2022
1 parent a59f354 commit 515b918
Showing 1 changed file with 9 additions and 6 deletions.
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

0 comments on commit 515b918

Please sign in to comment.