<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<body id="body">

<img id="image" usemap="#map" src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1000" height="1000" alt="" style="border:1px solid black;">
<map name="map" id="map">

    <area id="focusable-area" tabindex="0" shape="rect" coords="0,0,500,500" href="#" role="img" title="Example 1">
    <area id="nonfocusable-area" tabindex="-1" shape="rect" coords="500,500,1000,1000" href="#" role="img" title="Example 2">
</map>

<p id="description"></p>
<div id="console"></div>

<script>

    description("This tests that a link in an image map with tabindex < 0 is not mouse focusable.");

    // First try to focus on the <area> that is focusable.
    eventSender.mouseMoveTo(100, 100);
    eventSender.mouseDown();
    eventSender.mouseUp();

    shouldBe("document.activeElement.id", "'focusable-area'");

    // Try to focus on the <area> that is NOT focusable. Focus should still remain on focusable-area.
    eventSender.mouseMoveTo(700, 700);
    eventSender.mouseDown();
    eventSender.mouseUp();

    // Some platforms (QT) set focus to the body if clicking on a non-focusable area.
    shouldBe("document.activeElement.id == 'focusable-area' || document.activeElement.id == 'body'", "true");
</script>

<script src="../../resources/js-test-post.js"></script>
</body>
</html>
