RESOLVED FIXED Bug 190026
Web Inspector: Canvas: replace constant numbers with their associated name on WebGL contexts
https://bugs.webkit.org/show_bug.cgi?id=190026
Summary Web Inspector: Canvas: replace constant numbers with their associated name on...
Devin Rousso
Reported 2018-09-26 21:49:35 PDT
Any `GLenum` argument should come from a constant number defined on `WebGLRenderingContext.prototype`, meaning that we can (and should) show that text instead of the number value. Developers are more likely to know the constant's name rather than its actual numerical value.
Attachments
Patch (10.20 KB, patch)
2018-09-26 22:19 PDT, Devin Rousso
no flags
[Image] After Patch is applied (175.91 KB, image/png)
2018-09-26 22:20 PDT, Devin Rousso
no flags
Patch (10.08 KB, patch)
2018-10-02 00:22 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2018-09-26 22:19:49 PDT
Devin Rousso
Comment 2 2018-09-26 22:20:20 PDT
Created attachment 350939 [details] [Image] After Patch is applied I'm not sure how to stylistically differentiate between constant values and swizzled values. Feedback welcome :)
Joseph Pecoraro
Comment 3 2018-10-01 11:42:49 PDT
Comment on attachment 350938 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350938&action=review r=me > Source/WebInspectorUI/UserInterface/Models/RecordingAction.js:117 > + let prototype = WI.RecordingAction._prototypeForType(type); > + for (let key in prototype) { > + let descriptor = Object.getOwnPropertyDescriptor(prototype, key); > + if (descriptor.value === value) > + return key; > + } Nice! Should we avoid a few keys? For example if we're in a spot with the value zero, there would be multiple options and it seems the first one we come across would be the one returned: NONE: 0 NO_ERROR: 0 POINTS: 0 ZERO: 0 Or maybe we've just limited the constant indexes to a better set that will have useful non-ambugious constants.
Devin Rousso
Comment 4 2018-10-02 00:22:54 PDT
WebKit Commit Bot
Comment 5 2018-10-02 01:00:45 PDT
Comment on attachment 351349 [details] Patch Clearing flags on attachment: 351349 Committed r236715: <https://trac.webkit.org/changeset/236715>
WebKit Commit Bot
Comment 6 2018-10-02 01:00:47 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2018-10-02 01:01:37 PDT
Note You need to log in before you can comment on or make changes to this bug.