186a3ce890b588157923f7974187add39807ad13
[WebKit-https.git] / Source / JavaScriptCore / inspector / protocol / Canvas.json
1 {
2     "domain": "Canvas",
3     "availability": "web",
4     "description": "Canvas domain allows tracking of 2D and WebGL canvases that have an associated graphics context. Tracks canvases in the DOM and CSS canvases created with -webkit-canvas.",
5     "types": [
6         {
7             "id": "CanvasId",
8             "type": "string",
9             "description": "Unique canvas identifier."
10         },
11         {
12             "id": "ContextType",
13             "type": "string",
14             "enum": ["canvas-2d", "webgl"],
15             "description": "The type of rendering context backing the canvas element."
16         },
17         {
18             "id": "Canvas",
19             "type": "object",
20             "description": "Information about a 2D/WebGL canvas for which a rendering context has been created.",
21             "properties": [
22                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." },
23                 { "name": "contextType", "$ref": "ContextType", "description": "The type of rendering context backing the canvas." },
24                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Parent frame identifier." },
25                 { "name": "nodeId", "$ref": "DOM.NodeId", "optional": true, "description": "The corresponding DOM node id." },
26                 { "name": "cssCanvasName", "type": "string", "optional": true, "description": "The CSS canvas identifier, for canvases created with <code>document.getCSSCanvasContext</code>." }
27             ]
28         }
29     ],
30     "commands": [
31         {
32             "name": "enable",
33             "description": "Enables Canvas domain events."
34         },
35         {
36             "name": "disable",
37             "description": "Disables Canvas domain events."
38         },
39         {
40             "name": "requestNode",
41             "description": "Gets the NodeId for the canvas node with the given CanvasId.",
42             "parameters": [
43                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
44             ],
45             "returns": [
46                 { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Node identifier for given canvas." }
47             ]
48         },
49         {
50             "name": "requestContent",
51             "description": "Gets the data for the canvas node with the given CanvasId.",
52             "parameters": [
53                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
54             ],
55             "returns": [
56                 { "name": "content", "type": "string", "description": "Base64-encoded data of the canvas' contents." }
57             ]
58         }
59     ],
60     "events": [
61         {
62             "name": "canvasAdded",
63             "parameters": [
64                 { "name": "canvas", "$ref": "Canvas", "description": "Canvas object." }
65             ]
66         },
67         {
68             "name": "canvasRemoved",
69             "parameters": [
70                 { "name": "canvasId", "$ref": "CanvasId", "description": "Removed canvas identifier." }
71             ]
72         }
73     ]
74 }