72f520b6d213de76831772ae39db5e748e3ecc6d
[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": "ContextAttributes",
19             "type": "object",
20             "description": "WebGL drawing surface attributes.",
21             "properties": [
22                 { "name": "alpha", "type": "boolean" },
23                 { "name": "depth", "type": "boolean" },
24                 { "name": "stencil", "type": "boolean" },
25                 { "name": "antialias", "type": "boolean" },
26                 { "name": "premultipliedAlpha", "type": "boolean" },
27                 { "name": "preserveDrawingBuffer", "type": "boolean" },
28                 { "name": "failIfMajorPerformanceCaveat", "type": "boolean" }
29             ]
30         },
31         {
32             "id": "Canvas",
33             "type": "object",
34             "description": "Information about a 2D/WebGL canvas for which a rendering context has been created.",
35             "properties": [
36                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." },
37                 { "name": "contextType", "$ref": "ContextType", "description": "The type of rendering context backing the canvas." },
38                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Parent frame identifier." },
39                 { "name": "nodeId", "$ref": "DOM.NodeId", "optional": true, "description": "The corresponding DOM node id." },
40                 { "name": "cssCanvasName", "type": "string", "optional": true, "description": "The CSS canvas identifier, for canvases created with <code>document.getCSSCanvasContext</code>." },
41                 { "name": "contextAttributes", "$ref": "ContextAttributes", "optional": true, "description": "Context attributes for WebGL rendering contexts." }
42             ]
43         }
44     ],
45     "commands": [
46         {
47             "name": "enable",
48             "description": "Enables Canvas domain events."
49         },
50         {
51             "name": "disable",
52             "description": "Disables Canvas domain events."
53         },
54         {
55             "name": "requestNode",
56             "description": "Gets the NodeId for the canvas node with the given CanvasId.",
57             "parameters": [
58                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
59             ],
60             "returns": [
61                 { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Node identifier for given canvas." }
62             ]
63         },
64         {
65             "name": "requestContent",
66             "description": "Gets the data for the canvas node with the given CanvasId.",
67             "parameters": [
68                 { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." }
69             ],
70             "returns": [
71                 { "name": "content", "type": "string", "description": "Base64-encoded data of the canvas' contents." }
72             ]
73         }
74     ],
75     "events": [
76         {
77             "name": "canvasAdded",
78             "parameters": [
79                 { "name": "canvas", "$ref": "Canvas", "description": "Canvas object." }
80             ]
81         },
82         {
83             "name": "canvasRemoved",
84             "parameters": [
85                 { "name": "canvasId", "$ref": "CanvasId", "description": "Removed canvas identifier." }
86             ]
87         }
88     ]
89 }