tor-browser

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

box-model.js (1051B)


      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 const {
      8  UPDATE_GEOMETRY_EDITOR_ENABLED,
      9  UPDATE_LAYOUT,
     10  UPDATE_OFFSET_PARENT,
     11 } = require("resource://devtools/client/inspector/boxmodel/actions/index.js");
     12 
     13 module.exports = {
     14  /**
     15   * Updates the geometry editor's enabled state.
     16   *
     17   * @param  {boolean} enabled
     18   *         Whether or not the geometry editor is enabled or not.
     19   */
     20  updateGeometryEditorEnabled(enabled) {
     21    return {
     22      type: UPDATE_GEOMETRY_EDITOR_ENABLED,
     23      enabled,
     24    };
     25  },
     26 
     27  /**
     28   * Updates the layout state with the new layout properties.
     29   */
     30  updateLayout(layout) {
     31    return {
     32      type: UPDATE_LAYOUT,
     33      layout,
     34    };
     35  },
     36 
     37  /**
     38   * Updates the offset parent state with the new DOM node.
     39   */
     40  updateOffsetParent(offsetParent) {
     41    return {
     42      type: UPDATE_OFFSET_PARENT,
     43      offsetParent,
     44    };
     45  },
     46 };