NEW 199546
Layer visualization needs to show more data about the layers
https://bugs.webkit.org/show_bug.cgi?id=199546
Summary Layer visualization needs to show more data about the layers
Simon Fraser (smfr)
Reported 2019-07-06 10:38:51 PDT
The layer 3d view needs to show layers with backing store (i.e. those that use memory), those that are solid color or have image contents, those that are clipping etc.
Attachments
Patch (25.35 KB, patch)
2019-07-07 17:13 PDT, Simon Fraser (smfr)
no flags
Screenshot (1.03 MB, image/png)
2019-07-07 17:14 PDT, Simon Fraser (smfr)
no flags
Archive of layout-test-results from ews102 for mac-highsierra (3.20 MB, application/zip)
2019-07-07 18:23 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews116 for mac-highsierra (2.98 MB, application/zip)
2019-07-07 19:03 PDT, EWS Watchlist
no flags
Patch (30.74 KB, patch)
2019-07-08 20:59 PDT, Simon Fraser (smfr)
bburg: review+
Radar WebKit Bug Importer
Comment 1 2019-07-06 12:54:53 PDT
Simon Fraser (smfr)
Comment 2 2019-07-07 17:13:32 PDT
Simon Fraser (smfr)
Comment 3 2019-07-07 17:14:08 PDT
Created attachment 373607 [details] Screenshot
EWS Watchlist
Comment 4 2019-07-07 17:16:43 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2019-07-07 18:23:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2019-07-07 18:23:19 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2019-07-07 19:03:12 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2019-07-07 19:03:14 PDT Comment hidden (obsolete)
Devin Rousso
Comment 9 2019-07-07 20:10:58 PDT
Comment on attachment 373606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373606&action=review > Source/JavaScriptCore/inspector/protocol/LayerTree.json:27 > + "id": "LayerAttributes", All of these properties could just be attached to `Layer`. It would make compatibility checks easier, and simplify the overall structure of the payload. > Source/JavaScriptCore/inspector/protocol/LayerTree.json:31 > + { "name": "isRoot", "type": "boolean" }, I'd make this optional, and only include it for objects that are the root (e.g. if provided, we effectively expect it to be `true`). > Source/JavaScriptCore/inspector/protocol/LayerTree.json:46 > + { "name": "attributes", "$ref": "LayerAttributes", "description": "Layer attributes." }, Ditto (>31). > Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp:249 > + if (compositingType == MediaCompositingLayer) Should these be `else if`s? > Source/WebInspectorUI/UserInterface/Models/Layer.js:27 > + constructor(layerId, nodeId, bounds, attributes, paintCount, memory, compositedBounds, isInShadowTree, isReflection, isGeneratedContent, isAnonymous, pseudoElementId, pseudoElement) I'd rather change this object to use a more "modern" approach to its constructor (and adjust `WI.Layer.fromPayload` accordingly). ``` constructor(layerId, nodeId, bounds, compositedBounds, paintCount, memory, {isRoot, isBackingStoreDetached, hasMediaContents, hasTiledBacking, isContainerLayer, isInShadowTree, isReflection, isGeneratedContent, isAnonymous, pseudoElementId, pseudoElement} = {}) { console.assert(typeof layerId === "string"); console.assert(typeof nodeId === "number"); console.assert(typeof bounds === "object"); console.assert(typeof compositedBounds === "object"); console.assert(typeof paintCount === "number"); console.assert(typeof memory === "number"); console.assert(isBackingStoreDetached === undefined || typeof isBackingStoreDetached === "boolean"); console.assert(hasMediaContents === undefined || typeof hasMediaContents === "boolean"); console.assert(hasTiledBacking === undefined || typeof hasTiledBacking === "boolean"); console.assert(isContainerLayer === undefined || typeof isContainerLayer === "boolean"); console.assert(isInShadowTree === undefined || typeof isInShadowTree === "boolean"); console.assert(isReflection === undefined || typeof isReflection === "boolean"); console.assert(isGeneratedContent === undefined || typeof isGeneratedContent === "boolean"); console.assert(isAnonymous === undefined || typeof isAnonymous === "boolean"); console.assert(pseudoElementId === undefined || typeof pseudoElementId === "number"); console.assert(pseudoElement === undefined || typeof pseudoElement === "string"); this._layerId = layerId; this._nodeId = nodeId; this._bounds = bounds; this._compositedBounds = compositedBounds; this._paintCount = paintCount; this._memory = memory; this._isRoot = !!isRoot; this._isBackingStoreDetached = !!isBackingStoreDetached; this._hasMediaContents = !!hasMediaContents; this._hasTiledBacking = !!hasTiledBacking; this._isContainerLayer = !!isContainerLayer; this._isInShadowTree = !!isInShadowTree; this._isReflection = !!isReflection; this._isGeneratedContent = !!isGeneratedContent; this._isAnonymous = !!isAnonymous; this._pseudoElementId = pseudoElementId || null; this._pseudoElement = pseudoElement || null; } ``` This way, it's immediately clear what arguments are required and what arguments are optional. It would also require additional `get`ers for the newly added properties. > Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js:365 > + outline.material.color.set(colors.stroke); > + outline.material.opacity = colors.strokeOpacity; This won't be very good for people who are colorblind. Also, there's no "legend" for the different fill/stroke combinations, so it doesn't seem like there's a way for users to know what they mean. Perhaps we should also show this information in the "popover" when a layer is selected? Should we have a legend in the <canvas> that the user can then reference? > Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js:516 > + if ("backingStoreIsAttached" in layer.attributes && !layer.attributes.backingStoreIsAttached) { Rather than check that it's provided and falsy, perhaps we could "invert" the property to be `isBackingStoreDetached` and check that it's truthy?
Simon Fraser (smfr)
Comment 10 2019-07-08 20:59:30 PDT
Blaze Burg
Comment 11 2019-08-06 14:00:37 PDT
Comment on attachment 373698 [details] Patch r=me
Joseph Pecoraro
Comment 12 2019-10-14 12:28:08 PDT
This was reviewed, will it land?
Simon Fraser (smfr)
Comment 13 2019-10-14 13:11:40 PDT
There was a desire for a border layer color key.
Note You need to log in before you can comment on or make changes to this bug.