https://github.com/web-platform-tests/wpt
Raw File
Tip revision: d4b686df9fe6933c4c37986c9c3840eba5aad2ef authored by Joshua Bell on 06 April 2018, 19:47:51 UTC
Cookie Store: Tentatively deflake special names test
Tip revision: d4b686d
canvas_focus_drawCustomFocusRing_001.html
<!DOCTYPE html>
<html>
  <head>
    <title>canvas drawCustomFocusRing() step1 test</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <link rel="author" title="Takeshi Kurosawa" href="mailto:kurosawa-takeshi@mitsue.co.jp">
    <link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-drawcustomfocusring">
  </head>
  <body>
    <h1>Description</h1>
    <p>This test checks whether drawCustomFocusRing returns false if the element passed as an argument is not focused or is not a descendant of the element with whose context the method is associated.</p>
    <div id="log"></div>
    <div>
      <input type="text" id="text0">
      <canvas id="canvas"><input type="text" id="text1"></canvas>
    </div>
    <script>
    (function() {
      test(function() {
          var canvas = document.getElementById('canvas');
          var context = canvas.getContext('2d');
          var text0 = document.getElementById('text0');
          text0.focus(); // document.activeElement === text0;

          var text1 = document.getElementById('text1');
          assert_false(context.drawCustomFocusRing(text1));
      }, 'drawCustomFocusRing must return false for an element that is not focused.');

      test(function() {
          var canvas = document.getElementById('canvas');
          var context = canvas.getContext('2d');
          var text0 = document.getElementById('text0');
          text0.focus(); // document.activeElement === text0;

          assert_false(context.drawCustomFocusRing(text0));
      }, 'drawCustomFocusRing must return false for an element that is not a descendant of the canvas element.');
    })();
    </script>
  </body>
</html>
back to top