accessible/tests/mochitest/tree/test_cssoverflow.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html>
     3 <head>
     4   <title>CSS overflow testing</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <style>
    10     a.link:focus {
    11       overflow: scroll;
    12     }
    13   </style>
    15   <script type="application/javascript"
    16           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    17   <script type="application/javascript"
    18           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    20   <script type="application/javascript"
    21           src="../common.js"></script>
    22   <script type="application/javascript"
    23           src="../events.js"></script>
    25   <script type="application/javascript">
    26     ////////////////////////////////////////////////////////////////////////////
    27     // Invokers
    29     function focusAnchor(aID)
    30     {
    31       this.linkNode = getNode(aID);
    32       this.link = getAccessible(this.linkNode);
    34       this.eventSeq = [
    35         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
    36       ];
    38       this.invoke = function focusAnchor_invoke()
    39       {
    40         this.linkNode.focus();
    41       }
    43       this.check = function focusAnchor_check(aEvent)
    44       {
    45         todo_is(this.link, aEvent.accessible,
    46                 "Focus should be fired against new link accessible!");
    47       }
    49       this.getID = function focusAnchor_getID()
    50       {
    51         return "focus a:focus{overflow:scroll} #1";
    52       }
    53     }
    55     function tabAnchor(aID)
    56     {
    57       this.linkNode = getNode(aID);
    58       this.link = getAccessible(this.linkNode);
    60       this.eventSeq = [
    61         new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
    62       ];
    64       this.invoke = function tabAnchor_invoke()
    65       {
    66         synthesizeKey("VK_TAB", { shiftKey: false });
    67       }
    69       this.check = function tabAnchor_check(aEvent)
    70       {
    71         todo_is(this.link, aEvent.accessible,
    72                    "Focus should be fired against new link accessible!");
    73       }
    75       this.getID = function tabAnchor_getID()
    76       {
    77         return "focus a:focus{overflow:scroll} #2";
    78       }
    79     }
    81     ////////////////////////////////////////////////////////////////////////////
    82     // Do tests
    84     var gQueue = null;
    85     //gA11yEventDumpID = "eventdump"; // debug stuff
    86     //gA11yEventDumpToConsole = true;
    88     function doTests()
    89     {
    90       // Shift+Tab not working, and a test timeout, bug 746977
    91       if (MAC) {
    92         todo(false, "Shift+tab isn't working on OS X, needs to be disabled until bug 746977 is fixed!");
    93         SimpleTest.finish();
    94         return;
    95       }
    97       gQueue = new eventQueue();
    99       // CSS 'overflow: scroll' property setting and unsetting causes accessible
   100       // recreation (and fire show/hide events). For example, the focus and
   101       // blur of HTML:a with ':focus {overflow: scroll; }' CSS style causes its
   102       // accessible recreation. The focus event should be fired on new
   103       // accessible.
   104       gQueue.push(new focusAnchor("a"));
   105       gQueue.push(new tabAnchor("a2"));
   107       gQueue.invoke(); // Will call SimpleTest.finish();
   108     }
   110     SimpleTest.waitForExplicitFinish();
   111     addA11yLoadEvent(doTests);
   112   </script>
   113 </head>
   115 <body>
   117   <a target="_blank"
   118      href="https://bugzilla.mozilla.org/show_bug.cgi?id=591163"
   119      title="mochitest for bug 413777: focus the a:focus {overflow: scroll;} shouldn't recreate HTML a accessible">
   120     Mozilla Bug 591163
   121   </a><br>
   122   <a target="_blank"
   123      title="Rework accessible tree update code"
   124      href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275">
   125     Mozilla Bug 570275
   126   </a><br>
   127   <a target="_blank"
   128      title="Text control frames should accept dynamic changes to the CSS overflow property"
   129      href="https://bugzilla.mozilla.org/show_bug.cgi?id=686247">
   130     Mozilla Bug 686247
   131   </a><br>
   133   <p id="display"></p>
   134   <div id="content" style="display: none"></div>
   135   <pre id="test">
   136   </pre>
   137   <div id="eventdump"></div>
   139   <div>
   140     <a id="a" class="link" href="www">link</a>
   141   </div>
   142   <div>
   143     <a id="a2" class="link" href="www">link2</a>
   144   </div>
   145 </body>
   146 </html>

mercurial