Changeset 218618 in webkit
- Timestamp:
- Jun 20, 2017 5:07:41 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r218617 r218618 1 2017-06-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Send context attributes for tracked canvases 4 https://bugs.webkit.org/show_bug.cgi?id=173327 5 6 Reviewed by Joseph Pecoraro. 7 8 * inspector/canvas/context-attributes-expected.txt: Added. 9 * inspector/canvas/context-attributes.html: Added. 10 1 11 2017-06-20 Matt Lewis <jlewis3@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r218594 r218618 1 2017-06-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Send context attributes for tracked canvases 4 https://bugs.webkit.org/show_bug.cgi?id=173327 5 6 Reviewed by Joseph Pecoraro. 7 8 * inspector/protocol/Canvas.json: 9 Add ContextAttributes object type that is optionally used for WebGL canvases. 10 1 11 2017-06-20 Konstantin Tokarev <annulen@yandex.ru> 2 12 -
trunk/Source/JavaScriptCore/inspector/protocol/Canvas.json
r218544 r218618 16 16 }, 17 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 { 18 32 "id": "Canvas", 19 33 "type": "object", … … 24 38 { "name": "frameId", "$ref": "Network.FrameId", "description": "Parent frame identifier." }, 25 39 { "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>." } 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." } 27 42 ] 28 43 } -
trunk/Source/WebCore/ChangeLog
r218616 r218618 1 2017-06-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Send context attributes for tracked canvases 4 https://bugs.webkit.org/show_bug.cgi?id=173327 5 6 Reviewed by Joseph Pecoraro. 7 8 Test: inspector/canvas/context-attributes.html 9 10 * inspector/InspectorCanvasAgent.cpp: 11 (WebCore::InspectorCanvasAgent::buildObjectForCanvas): 12 1 13 2017-06-20 Myles C. Maxfield <mmaxfield@apple.com> 2 14 -
trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp
r218544 r218618 35 35 #include "InstrumentingAgents.h" 36 36 #include "MainFrame.h" 37 #include "WebGLContextAttributes.h" 38 #include "WebGLRenderingContextBase.h" 37 39 #include <inspector/IdentifiersFactory.h> 38 40 #include <inspector/InspectorProtocolObjects.h> … … 278 280 } 279 281 282 #if ENABLE(WEBGL) 283 if (is<WebGLRenderingContextBase>(context)) { 284 if (std::optional<WebGLContextAttributes> attributes = downcast<WebGLRenderingContextBase>(context)->getContextAttributes()) { 285 canvas->setContextAttributes(Inspector::Protocol::Canvas::ContextAttributes::create() 286 .setAlpha(attributes->alpha) 287 .setDepth(attributes->depth) 288 .setStencil(attributes->stencil) 289 .setAntialias(attributes->antialias) 290 .setPremultipliedAlpha(attributes->premultipliedAlpha) 291 .setPreserveDrawingBuffer(attributes->preserveDrawingBuffer) 292 .setFailIfMajorPerformanceCaveat(attributes->failIfMajorPerformanceCaveat) 293 .release()); 294 } 295 } 296 #endif 297 280 298 return canvas; 281 299 } -
trunk/Source/WebInspectorUI/ChangeLog
r218544 r218618 1 2017-06-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Send context attributes for tracked canvases 4 https://bugs.webkit.org/show_bug.cgi?id=173327 5 6 Reviewed by Joseph Pecoraro. 7 8 * UserInterface/Models/Canvas.js: 9 (WebInspector.Canvas.fromPayload): 10 (WebInspector.Canvas.prototype.get contextAttributes): 11 * UserInterface/Views/CanvasDetailsSidebarPanel.js: 12 (WebInspector.CanvasDetailsSidebarPanel.prototype.initialLayout): 13 (WebInspector.CanvasDetailsSidebarPanel.prototype.layout): 14 (WebInspector.CanvasDetailsSidebarPanel.prototype.sizeDidChange): 15 (WebInspector.CanvasDetailsSidebarPanel.prototype._refreshAttributesSection): 16 17 * UserInterface/Views/DataGridNode.js: 18 (WebInspector.DataGridNode.prototype.createCellContent): 19 Instead of checking if the value of the cell is falsy, check that the key exists in the data. 20 This allows values like `false` to be displayed. 21 1 22 2017-06-19 Devin Rousso <drousso@apple.com> 2 23 -
trunk/Source/WebInspectorUI/UserInterface/Models/Canvas.js
r218544 r218618 26 26 WebInspector.Canvas = class Canvas extends WebInspector.Object 27 27 { 28 constructor(identifier, contextType, frame, {domNode, cssCanvasName } = {})28 constructor(identifier, contextType, frame, {domNode, cssCanvasName, contextAttributes} = {}) 29 29 { 30 30 super(); … … 39 39 this._domNode = domNode || null; 40 40 this._cssCanvasName = cssCanvasName || ""; 41 this._contextAttributes = contextAttributes || {}; 41 42 } 42 43 … … 61 62 domNode: payload.nodeId ? WebInspector.domTreeManager.nodeForId(payload.nodeId) : null, 62 63 cssCanvasName: payload.cssCanvasName, 64 contextAttributes: payload.contextAttributes, 63 65 }); 64 66 } … … 87 89 get frame() { return this._frame; } 88 90 get cssCanvasName() { return this._cssCanvasName; } 91 get contextAttributes() { return this._contextAttributes; } 89 92 90 93 get displayName() -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js
r218544 r218618 92 92 sourceSection.groups = [new WebInspector.DetailsSectionGroup([this._nodeRow, this._cssCanvasRow, this._widthRow, this._heightRow, this._datachedRow])]; 93 93 this.contentView.element.appendChild(sourceSection.element); 94 95 this._attributesDataGridRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Attributes")); 96 97 let attributesSection = new WebInspector.DetailsSection("canvas-attributes", WebInspector.UIString("Attributes")); 98 attributesSection.groups = [new WebInspector.DetailsSectionGroup([this._attributesDataGridRow])]; 99 this.contentView.element.appendChild(attributesSection.element); 94 100 } 95 101 … … 103 109 this._refreshIdentitySection(); 104 110 this._refreshSourceSection(); 111 this._refreshAttributesSection(); 112 } 113 114 sizeDidChange() 115 { 116 super.sizeDidChange(); 117 118 // FIXME: <https://webkit.org/b/152269> Web Inspector: Convert DetailsSection classes to use View 119 this._attributesDataGridRow.sizeDidChange(); 105 120 } 106 121 … … 186 201 }); 187 202 } 203 204 _refreshAttributesSection() 205 { 206 if (!this._canvas) 207 return; 208 209 if (isEmptyObject(this._canvas.contextAttributes)) { 210 // Remove the DataGrid to show the placeholder text. 211 this._attributesDataGridRow.dataGrid = null; 212 return; 213 } 214 215 let dataGrid = this._attributesDataGridRow.dataGrid; 216 if (!dataGrid) { 217 dataGrid = this._attributesDataGridRow.dataGrid = new WebInspector.DataGrid({ 218 name: {title: WebInspector.UIString("Name")}, 219 value: {title: WebInspector.UIString("Value"), width: "30%"}, 220 }); 221 } 222 223 dataGrid.removeChildren(); 224 225 for (let attribute in this._canvas.contextAttributes) { 226 let data = {name: attribute, value: this._canvas.contextAttributes[attribute]}; 227 let dataGridNode = new WebInspector.DataGridNode(data); 228 dataGrid.appendChild(dataGridNode); 229 } 230 231 dataGrid.updateLayoutIfNeeded(); 232 } 188 233 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js
r214405 r218618 384 384 createCellContent(columnIdentifier) 385 385 { 386 if (!(columnIdentifier in this.data)) 387 return zeroWidthSpace; // Zero width space to keep the cell from collapsing. 388 386 389 let data = this.data[columnIdentifier]; 387 if (!data)388 return zeroWidthSpace; // Zero width space to keep the cell from collapsing.389 390 390 return (typeof data === "number") ? data.maxDecimals(2).toLocaleString() : data; 391 391 }
Note: See TracChangeset
for help on using the changeset viewer.