RESOLVED FIXED142760
Web Inspector: Add more DOM Native Function parameter strings
https://bugs.webkit.org/show_bug.cgi?id=142760
Summary Web Inspector: Add more DOM Native Function parameter strings
Joseph Pecoraro
Reported 2015-03-16 18:48:23 PDT
* SUMMARY Add more DOM Native Function parameter strings. I autogenerated a set from our IDL to fill in the rest of our interfaces. I did handle: - optional parameters - static vs non-static I didn't handle: - Native DOM functions that are constructors - For overloaded IDL functions (WebGL Context has a few for example) I only generated a parameter list for the first function - Default values, because they seemed almost always to be Undefined / NullString / TreatUndefinedAsNullString
Attachments
[SCRIPT] IDL CodeGenerator used to autogenerate the JSON objects (3.04 KB, text/x-perl-script)
2015-03-16 18:51 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (58.54 KB, patch)
2015-03-16 18:53 PDT, Joseph Pecoraro
timothy: review+
joepeck: commit-queue-
Radar WebKit Bug Importer
Comment 1 2015-03-16 18:48:36 PDT
Joseph Pecoraro
Comment 2 2015-03-16 18:51:15 PDT
Created attachment 248776 [details] [SCRIPT] IDL CodeGenerator used to autogenerate the JSON objects Note to future self: To use this, I made DerivedSources.make run the JS codegenerator and this codegenerator for all IDL files. Then I just processed the stdout output: (striped empty objects, sorted, pretty printed, and hand edited).
Joseph Pecoraro
Comment 3 2015-03-16 18:53:58 PDT
Created attachment 248778 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 4 2015-03-16 18:56:43 PDT
Comment on attachment 248778 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=248778&action=review > Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:1495 > + SecurityPolicy: { I am not sure if this is real, or just for tests? Tests use "document.securityPolicy", but I don't see that in general browsing.
Timothy Hatcher
Comment 5 2015-03-16 19:16:34 PDT
Comment on attachment 248778 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=248778&action=review > Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:984 > + /* EventTarget */ So these are empty but inherit from EventTarget. >> Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:1495 >> + SecurityPolicy: { > > I am not sure if this is real, or just for tests? Tests use "document.securityPolicy", but I don't see that in general browsing. Likely not exposed. > Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:2076 > + var eventTargetTypes = [ Oh I see now. > Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:2084 > + for (var type of eventTargetTypes) Newline before this?
Joseph Pecoraro
Comment 6 2015-03-16 20:58:31 PDT
Comment on attachment 248778 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=248778&action=review >>> Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js:1495 >>> + SecurityPolicy: { >> >> I am not sure if this is real, or just for tests? Tests use "document.securityPolicy", but I don't see that in general browsing. > > Likely not exposed. It is behind ENABLE_CSP_NEXT, which Mac doesn't have enabled yet. I'll keep it, this is intended to be a public API I guess.
Joseph Pecoraro
Comment 7 2015-03-16 21:00:06 PDT
Comment on attachment 248778 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=248778&action=review > Source/WebCore/dom/Document.idl:214 > - NodeList getElementsByClassName([Default=Undefined] optional DOMString tagname); > + NodeList getElementsByClassName([Default=Undefined] optional DOMString classNames); So this is causing our ObjC API checker to complain: > Public API change. There are missing public properties and/or methods from the "DOMDocument" class. > - (DOMNodeList *)getElementsByClassName:(NSString *)tagname; This should be fine, but I'm going to avoid making this change in this patch. As it really doesn't matter.
Timothy Hatcher
Comment 8 2015-03-16 21:14:21 PDT
You can make the change in a follow up. Just update the big header that is cross references to make it stick.
Joseph Pecoraro
Comment 9 2015-03-16 21:18:56 PDT
(In reply to comment #8) > You can make the change in a follow up. Just update the big header that is > cross references to make it stick. Yep, I realized that now. I also have a few CodeGenerator cleanup patches after reading through some of the code.
Joseph Pecoraro
Comment 10 2015-03-16 21:43:11 PDT
Note You need to log in before you can comment on or make changes to this bug.