accessible/tests/mochitest/treeupdate/test_cssoverflow.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/treeupdate/test_cssoverflow.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,143 @@
     1.4 +<html>
     1.5 +
     1.6 +<head>
     1.7 +  <title>Testing HTML scrollable frames (css overflow style)</title>
     1.8 +
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../role.js"></script>
    1.19 +  <script type="application/javascript"
    1.20 +          src="../events.js"></script>
    1.21 +
    1.22 +  <script type="application/javascript">
    1.23 +
    1.24 +    ////////////////////////////////////////////////////////////////////////////
    1.25 +    // Invokers
    1.26 +    ////////////////////////////////////////////////////////////////////////////
    1.27 +
    1.28 +    /**
    1.29 +     * Change scroll range to not empty size and inserts a child into container
    1.30 +     * to trigger tree update of the container. Prior to bug 677154 not empty
    1.31 +     * size resulted to accessible creation for scroll area, container tree
    1.32 +     * update picked up that accessible unattaching scroll area accessible
    1.33 +     * subtree.
    1.34 +     */
    1.35 +    function changeScrollRange(aContainerID, aScrollAreaID)
    1.36 +    {
    1.37 +      this.containerNode = getNode(aContainerID);
    1.38 +      this.container = getAccessible(this.containerNode);
    1.39 +      this.scrollAreaNode = getNode(aScrollAreaID);
    1.40 +
    1.41 +      this.eventSeq = [
    1.42 +        new invokerChecker(EVENT_REORDER, this.container)
    1.43 +      ];
    1.44 +
    1.45 +      this.invoke = function changeScrollRange_invoke()
    1.46 +      {
    1.47 +        this.scrollAreaNode.style.width = "20px";
    1.48 +        this.containerNode.appendChild(document.createElement("input"));
    1.49 +      }
    1.50 +
    1.51 +      this.finalCheck = function changeScrollRange_finalCheck()
    1.52 +      {
    1.53 +        var accTree =
    1.54 +          { SECTION: [ // container
    1.55 +            { SECTION: [ // scroll area
    1.56 +              { ENTRY: [] } // child content
    1.57 +            ] },
    1.58 +            { ENTRY: [] } // inserted input
    1.59 +          ] };
    1.60 +        testAccessibleTree(this.container, accTree);
    1.61 +      }
    1.62 +
    1.63 +      this.getID = function changeScrollRange_getID()
    1.64 +      {
    1.65 +        return "change scroll range for " + prettyName(aScrollAreaID);
    1.66 +      }
    1.67 +    }
    1.68 +
    1.69 +    /**
    1.70 +     * Change scrollbar styles from hidden to auto. That makes us to create an
    1.71 +     * accessible for scroll area.
    1.72 +     */
    1.73 +    function changeScrollbarStyles(aContainerID, aScrollAreaID)
    1.74 +    {
    1.75 +      this.container = getAccessible(aContainerID);
    1.76 +      this.scrollAreaNode = getNode(aScrollAreaID);
    1.77 +
    1.78 +      this.eventSeq = [
    1.79 +        new invokerChecker(EVENT_SHOW, getAccessible, this.scrollAreaNode),
    1.80 +        new invokerChecker(EVENT_REORDER, this.container)
    1.81 +      ];
    1.82 +
    1.83 +      this.invoke = function changeScrollbarStyles_invoke()
    1.84 +      {
    1.85 +        var accTree =
    1.86 +          { SECTION: [] };
    1.87 +        testAccessibleTree(this.container, accTree);
    1.88 +
    1.89 +        this.scrollAreaNode.style.overflow = "auto";
    1.90 +      }
    1.91 +
    1.92 +      this.finalCheck = function changeScrollbarStyles_finalCheck()
    1.93 +      {
    1.94 +        var accTree =
    1.95 +          { SECTION: [ // container
    1.96 +            { SECTION: [] } // scroll area
    1.97 +          ] };
    1.98 +        testAccessibleTree(this.container, accTree);
    1.99 +      }
   1.100 +
   1.101 +      this.getID = function changeScrollbarStyles_getID()
   1.102 +      {
   1.103 +        return "change scrollbar styles " + prettyName(aScrollAreaID);
   1.104 +      }
   1.105 +    }
   1.106 +
   1.107 +    ////////////////////////////////////////////////////////////////////////////
   1.108 +    // Do tests
   1.109 +    ////////////////////////////////////////////////////////////////////////////
   1.110 +
   1.111 +    var gQueue = null;
   1.112 +    //gA11yEventDumpID = "eventdump"; // debug stuff
   1.113 +    //gA11yEventDumpToConsole = true;
   1.114 +
   1.115 +    function doTests()
   1.116 +    {
   1.117 +      gQueue = new eventQueue();
   1.118 +
   1.119 +      gQueue.push(new changeScrollRange("container", "scrollarea"));
   1.120 +      gQueue.push(new changeScrollbarStyles("container2", "scrollarea2"));
   1.121 +
   1.122 +      gQueue.invoke(); // Will call SimpleTest.finish();
   1.123 +    }
   1.124 +
   1.125 +    SimpleTest.waitForExplicitFinish();
   1.126 +    addA11yLoadEvent(doTests);
   1.127 +  </script>
   1.128 +</head>
   1.129 +
   1.130 +<body>
   1.131 +
   1.132 +  <a target="_blank"
   1.133 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=677154"
   1.134 +     title="Detached document accessibility tree">
   1.135 +    Mozilla Bug 677154</a>
   1.136 +
   1.137 +  <p id="display"></p>
   1.138 +  <div id="content" style="display: none"></div>
   1.139 +  <pre id="test">
   1.140 +  </pre>
   1.141 +  <div id="eventdump"></div>
   1.142 +
   1.143 +  <div id="container"><div id="scrollarea" style="overflow:auto;"><input></div></div>
   1.144 +  <div id="container2"><div id="scrollarea2" style="overflow:hidden;"></div></div>
   1.145 +</body>
   1.146 +</html>

mercurial