tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_treeupdate_cssoverflow.js (1579B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 /* import-globals-from ../../mochitest/role.js */
      8 loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
      9 
     10 addAccessibleTask(
     11  `
     12  <div id="container"><div id="scrollarea" style="overflow:auto;"><input>`,
     13  async function (browser, accDoc) {
     14    const id1 = "container";
     15    const container = findAccessibleChildByID(accDoc, id1);
     16 
     17    /* ================= Change scroll range ================================== */
     18    let tree = {
     19      SECTION: [
     20        {
     21          // container
     22          SECTION: [
     23            {
     24              // scroll area
     25              ENTRY: [], // child content
     26            },
     27          ],
     28        },
     29      ],
     30    };
     31    testAccessibleTree(container, tree);
     32 
     33    let onReorder = waitForEvent(EVENT_REORDER, id1);
     34    await invokeContentTask(browser, [id1], id => {
     35      let doc = content.document;
     36      doc.getElementById("scrollarea").style.width = "20px";
     37      doc.getElementById(id).appendChild(doc.createElement("input"));
     38    });
     39    await onReorder;
     40 
     41    tree = {
     42      SECTION: [
     43        {
     44          // container
     45          SECTION: [
     46            {
     47              // scroll area
     48              ENTRY: [], // child content
     49            },
     50          ],
     51        },
     52        {
     53          ENTRY: [], // inserted input
     54        },
     55      ],
     56    };
     57    testAccessibleTree(container, tree);
     58  },
     59  { iframe: true, remoteIframe: true }
     60 );