https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e763335602af9b981c691f4c66eff25ef46bdea7 authored by Marcos Cáceres on 07 September 2018, 07:56:16 UTC
Add defaults to PaymentMethodChangeEventInit's members.
Tip revision: e763335
focus-visible-006-manual.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>CSS Test (Selectors): contenteditable elements always match :focus-visible</title>
  <link rel="author" title="Alice Boxhall" href="aboxhall@chromium.org" />
  <link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <style>
    span[contenteditable] {
        border: 1px solid black;
        background-color: white;
        padding: 2px 5px;
    }

    :focus-visible {
      outline: darkgreen dotted 1px; /* fallback for Edge */
      outline: darkgreen auto 5px;
    }

    :focus:not(:focus-visible) {
      outline: 0;
      background-color: tomato;
    }
  </style>
</head>
<body>
  This test checks that <code>:focus-visible</code> always matches on elements with <code>contenteditable=true</code> set.
  <ol id="instructions">
    <li>If the user-agent does not claim to support the <code>:focus-visible</code> pseudo-class then SKIP this test.</li>
    <li><strong>Click</strong> the content editable span below to focus it.</li>
    <li>If the element has a red background, then the test result is FAILURE. If the element has a blue outline, then the test result is SUCCESS.</li>
  </ol>
  <br />
  <div>
    <span id="el" contenteditable>Focus me</span>
  </div>
  <script>
    async_test(function(t) {
      el.addEventListener("focus", t.step_func(function() {
        assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
        t.done();
      }));
    }, "Focus should always match :focus-visible on content editable divs");
  </script>
</body>
</html>
back to top