summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/editing-0/spelling-and-grammar-checking/spellcheck-enumerated-ascii-case-insensitive.html
blob: 9f00f1dff12661685c50146caa39b94c547feac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="help" href="https://html.spec.whatwg.org/#attr-spellcheck">
<link rel="help" href="https://html.spec.whatwg.org/#enumerated-attribute">
<meta name="assert" content="@spellcheck values are ASCII case-insensitive">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!--
  While <div> and <span> aren’t defined as “checkable for the purposes of this
  feature”, this has no effect on the attribute’s state.

  We wrap the <span> elements under test with <div> elements so the checking
  enabled algorithm stops at step 4 (ancestor content attribute), before steps
  relying on user-agent-defined behavior (see [#concept-spellcheck-default]).
-->
<div spellcheck="true"><span spellcheck="false"></span></div>
<div spellcheck="true"><span spellcheck="FaLsE"></span></div>
<div spellcheck="true"><span spellcheck="falſe"></span></div>
<script>
const span = document.querySelectorAll("span");

test(() => {
  assert_equals(span[0].spellcheck, false, "lowercase valid");
  assert_equals(span[1].spellcheck, false, "mixed case valid");
  assert_equals(span[2].spellcheck, true, "non-ASCII invalid");
}, "keyword false");
</script>