layout.js (1435B)
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 Arg, 9 generateActorSpec, 10 RetVal, 11 } = require("resource://devtools/shared/protocol.js"); 12 13 const flexboxSpec = generateActorSpec({ 14 typeName: "flexbox", 15 16 methods: { 17 getFlexItems: { 18 request: {}, 19 response: { 20 flexitems: RetVal("array:flexitem"), 21 }, 22 }, 23 }, 24 }); 25 26 const flexItemSpec = generateActorSpec({ 27 typeName: "flexitem", 28 29 methods: {}, 30 }); 31 32 const gridSpec = generateActorSpec({ 33 typeName: "grid", 34 35 methods: {}, 36 }); 37 38 const layoutSpec = generateActorSpec({ 39 typeName: "layout", 40 41 methods: { 42 getCurrentFlexbox: { 43 request: { 44 node: Arg(0, "domnode"), 45 onlyLookAtParents: Arg(1, "nullable:boolean"), 46 }, 47 response: { 48 flexbox: RetVal("nullable:flexbox"), 49 }, 50 }, 51 52 getCurrentGrid: { 53 request: { 54 node: Arg(0, "domnode"), 55 }, 56 response: { 57 grid: RetVal("nullable:grid"), 58 }, 59 }, 60 61 getGrids: { 62 request: { 63 rootNode: Arg(0, "domnode"), 64 }, 65 response: { 66 grids: RetVal("array:grid"), 67 }, 68 }, 69 }, 70 }); 71 72 exports.flexboxSpec = flexboxSpec; 73 exports.flexItemSpec = flexItemSpec; 74 exports.gridSpec = gridSpec; 75 exports.layoutSpec = layoutSpec;