accessible/tests/mochitest/treeupdate/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>Testing HTML scrollable frames (css overflow style)</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    12   <script type="application/javascript"
    13           src="../common.js"></script>
    14   <script type="application/javascript"
    15           src="../role.js"></script>
    16   <script type="application/javascript"
    17           src="../events.js"></script>
    19   <script type="application/javascript">
    21     ////////////////////////////////////////////////////////////////////////////
    22     // Invokers
    23     ////////////////////////////////////////////////////////////////////////////
    25     /**
    26      * Change scroll range to not empty size and inserts a child into container
    27      * to trigger tree update of the container. Prior to bug 677154 not empty
    28      * size resulted to accessible creation for scroll area, container tree
    29      * update picked up that accessible unattaching scroll area accessible
    30      * subtree.
    31      */
    32     function changeScrollRange(aContainerID, aScrollAreaID)
    33     {
    34       this.containerNode = getNode(aContainerID);
    35       this.container = getAccessible(this.containerNode);
    36       this.scrollAreaNode = getNode(aScrollAreaID);
    38       this.eventSeq = [
    39         new invokerChecker(EVENT_REORDER, this.container)
    40       ];
    42       this.invoke = function changeScrollRange_invoke()
    43       {
    44         this.scrollAreaNode.style.width = "20px";
    45         this.containerNode.appendChild(document.createElement("input"));
    46       }
    48       this.finalCheck = function changeScrollRange_finalCheck()
    49       {
    50         var accTree =
    51           { SECTION: [ // container
    52             { SECTION: [ // scroll area
    53               { ENTRY: [] } // child content
    54             ] },
    55             { ENTRY: [] } // inserted input
    56           ] };
    57         testAccessibleTree(this.container, accTree);
    58       }
    60       this.getID = function changeScrollRange_getID()
    61       {
    62         return "change scroll range for " + prettyName(aScrollAreaID);
    63       }
    64     }
    66     /**
    67      * Change scrollbar styles from hidden to auto. That makes us to create an
    68      * accessible for scroll area.
    69      */
    70     function changeScrollbarStyles(aContainerID, aScrollAreaID)
    71     {
    72       this.container = getAccessible(aContainerID);
    73       this.scrollAreaNode = getNode(aScrollAreaID);
    75       this.eventSeq = [
    76         new invokerChecker(EVENT_SHOW, getAccessible, this.scrollAreaNode),
    77         new invokerChecker(EVENT_REORDER, this.container)
    78       ];
    80       this.invoke = function changeScrollbarStyles_invoke()
    81       {
    82         var accTree =
    83           { SECTION: [] };
    84         testAccessibleTree(this.container, accTree);
    86         this.scrollAreaNode.style.overflow = "auto";
    87       }
    89       this.finalCheck = function changeScrollbarStyles_finalCheck()
    90       {
    91         var accTree =
    92           { SECTION: [ // container
    93             { SECTION: [] } // scroll area
    94           ] };
    95         testAccessibleTree(this.container, accTree);
    96       }
    98       this.getID = function changeScrollbarStyles_getID()
    99       {
   100         return "change scrollbar styles " + prettyName(aScrollAreaID);
   101       }
   102     }
   104     ////////////////////////////////////////////////////////////////////////////
   105     // Do tests
   106     ////////////////////////////////////////////////////////////////////////////
   108     var gQueue = null;
   109     //gA11yEventDumpID = "eventdump"; // debug stuff
   110     //gA11yEventDumpToConsole = true;
   112     function doTests()
   113     {
   114       gQueue = new eventQueue();
   116       gQueue.push(new changeScrollRange("container", "scrollarea"));
   117       gQueue.push(new changeScrollbarStyles("container2", "scrollarea2"));
   119       gQueue.invoke(); // Will call SimpleTest.finish();
   120     }
   122     SimpleTest.waitForExplicitFinish();
   123     addA11yLoadEvent(doTests);
   124   </script>
   125 </head>
   127 <body>
   129   <a target="_blank"
   130      href="https://bugzilla.mozilla.org/show_bug.cgi?id=677154"
   131      title="Detached document accessibility tree">
   132     Mozilla Bug 677154</a>
   134   <p id="display"></p>
   135   <div id="content" style="display: none"></div>
   136   <pre id="test">
   137   </pre>
   138   <div id="eventdump"></div>
   140   <div id="container"><div id="scrollarea" style="overflow:auto;"><input></div></div>
   141   <div id="container2"><div id="scrollarea2" style="overflow:hidden;"></div></div>
   142 </body>
   143 </html>

mercurial