summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/constraints/input-maxlength-emoji.html
blob: 068abad9363065afff404b3e30f33615ca6e5111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests pasting an emoji in a text field with a maxlength attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=252900">
<input id="target" type="text" maxlength="10" />
<script>
test(function() {
  let target = document.getElementById("target");
  target.focus();
  document.execCommand("InsertHTML", false, "👨‍👩‍👧‍👦");
  assert_equals(target.value, "👨‍👩‍👧‍");
}, "Emoji gets truncated due to maxlength attribute");
</script>