WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
Bug 112721
Web Inspector: Fix capitalization of stylized enum values in generated code
https://bugs.webkit.org/show_bug.cgi?id=112721
Summary
Web Inspector: Fix capitalization of stylized enum values in generated code
Timothy Hatcher
Reported
2013-03-19 11:22:15 PDT
InspectorBackend.registerEnum("Console.ConsoleMessageSource", {XML: "xml", Javascript: "javascript", Network: "network", ConsoleAPI: "console-api", Storage: "storage", Appcache: "appcache", Rendering: "rendering", Css: "css", Security: "security", Other: "other"});
Attachments
Proposed Fix
(9.14 KB, patch)
2016-12-08 13:31 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Proposed Fix
(60.38 KB, patch)
2016-12-08 16:24 PST
,
Blaze Burg
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews107 for mac-yosemite-wk2
(1.05 MB, application/zip)
2016-12-09 10:55 PST
,
Build Bot
no flags
Details
Proposed Fix
(70.86 KB, patch)
2016-12-09 11:49 PST
,
Blaze Burg
joepeck
: review+
joepeck
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Timothy Hatcher
Comment 1
2013-03-19 11:23:39 PDT
Javascript and Appcache should probably be JavaScript and AppCache too.
Brian Burg
Comment 2
2014-12-01 13:58:39 PST
Actually this bug does not seem relevant any more. Current protocol: { "id": "ConsoleMessage", "type": "object", "description": "Console message.", "properties": [ { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "other"], "description": "Message source." },
Radar WebKit Bug Importer
Comment 3
2014-12-01 13:59:00 PST
<
rdar://problem/19106359
>
Brian Burg
Comment 4
2014-12-01 14:00:34 PST
Hmm, so Css -> CSS was fixed at some point (probably in the generator rewrite), but Javascript and Appcache are still in there.
Blaze Burg
Comment 5
2016-12-08 13:30:23 PST
Let's just remove these enums, they aren't used.
Blaze Burg
Comment 6
2016-12-08 13:31:55 PST
Created
attachment 296558
[details]
Proposed Fix
Joseph Pecoraro
Comment 7
2016-12-08 13:55:47 PST
Comment on
attachment 296558
[details]
Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=296558&action=review
> Source/WebInspectorUI/ChangeLog:16 > + * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js: > + * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js: > + * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js: > + * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js: > + * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
This isn't actually removing them, they still exist in the Source/WebInspector/Versions/*/*iOS*.json input files that generate these files:
> { > "id": "ConsoleMessage", > "type": "object", > "properties": [ > { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "other"], "description": "Message source." }, > { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug"], "description": "Message severity." }, > { "name": "text", "type": "string", "description": "Message text." }, > { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing", "profile", "profileEnd"], "description": "Console message type." }, > ... > ] > },
I think these are fine, we should just use them in the frontend instead of hardcoded strings.
Joseph Pecoraro
Comment 8
2016-12-08 13:57:54 PST
If I recall correctly, this is one of the reasons we capture the *iOS*.json files. So that we could update the code generator and re-generate the output to be consistent. In this case as long as we don't change the string sent to the backend, we can do whatever we want to represent the Enum in the frontend. Whether it is ConsoleMessageLevel.CSS or ConsoleMessageLevel.Css is a frontend only thing.
Blaze Burg
Comment 9
2016-12-08 16:24:50 PST
Created
attachment 296590
[details]
Proposed Fix
WebKit Commit Bot
Comment 10
2016-12-08 16:26:18 PST
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Build Bot
Comment 11
2016-12-09 10:55:21 PST
Comment on
attachment 296590
[details]
Proposed Fix
Attachment 296590
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/2678217
New failing tests: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
Build Bot
Comment 12
2016-12-09 10:55:25 PST
Created
attachment 296662
[details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Joseph Pecoraro
Comment 13
2016-12-09 11:38:09 PST
Comment on
attachment 296590
[details]
Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=296590&action=review
> Source/JavaScriptCore/inspector/scripts/codegen/generator.py:41 > -_ALWAYS_UPPERCASED_ENUM_VALUE_SUBSTRINGS = set(['API', 'CSS', 'DOM', 'HTML', 'JIT', 'XHR', 'XML']) > +_SPECIAL_CASED_ENUM_VALUE_SUBSTRINGS = set(['API', 'CSS', 'DOM', 'HTML', 'JIT', 'JSON', 'XHR', 'XML', 'AppCache', 'JavaScript'])
Please run: Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb It sounds like we should have updated this line: InspectorBackend.registerEnum("Console.ConsoleMessageSource", {XML: "xml", Javascript: "javascript", Network: "network", ConsoleAPI: "console-api", Storage: "storage", Appcache: "appcache", Rendering: "rendering", CSS: "css", Security: "security", ContentBlocker: "content-blocker", Other: "other"}); In each of these files: Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js
Blaze Burg
Comment 14
2016-12-09 11:49:27 PST
Created
attachment 296667
[details]
Proposed Fix
Joseph Pecoraro
Comment 15
2016-12-19 14:46:22 PST
Comment on
attachment 296667
[details]
Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=296667&action=review
r=me but it needs at least that one fix.
> Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:268 > -InspectorBackend.registerEnum("Memory.CategoryDataType", {Javascript: "javascript", JIT: "jit", Images: "images", Layers: "layers", Page: "page", Other: "other"}); > +InspectorBackend.registerEnum("Memory.CategoryDataType", {JavaScript: "javascript", JIT: "jit", Images: "images", Layers: "layers", Page: "page", Other: "other"});
You'll need to update this to reflect this change: UserInterface/Models/MemoryTimelineRecord.js 54: case MemoryAgent.CategoryDataType.Javascript:
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug