[WebIDL] Make a few parameters non-nullable in inspector IDL files
Created attachment 316105 [details] Patch
Comment on attachment 316105 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316105&action=review r=me > Source/WebCore/inspector/InspectorFrontendHost.cpp:392 > if (!is<MouseEvent>(event)) > return; If this is the case should we just change the IDL to take a MouseEvent instead of an Event?
`InspectorFrontendHost.dispatchEventAsContextMenuEvent` can take a non-nullable. It is only used in our code with a non-null object: > if (this._event.type !== "contextmenu" && typeof InspectorFrontendHost.dispatchEventAsContextMenuEvent === "function") { > this._menuObject = menuObject; > this._event.target.addEventListener("contextmenu", this, true); > InspectorFrontendHost.dispatchEventAsContextMenuEvent(this._event); > } `CommandLineAPIHost.getEventListeners` taking a non-nullable would be a small behavior change but probably for the better. Users can use this by just calling it from Web Inspector's Quick Console: js> getEventListeners() undefined js> getEventListeners(document.body) {} js> getEventListeners(node) {click: Array} I think making the first argument non-nullable would change that first case to: > getEventListeners() TypeError: Not enough arguments Which is totally fine to me. As something only available through Web Inspector, we wouldn't be breaking any existing code. That said, returning `undefined` does matches Chrome's impl. None of this is standard nor commonly used. The doc everyone uses is: https://getfirebug.com/wiki/index.php/Command_Line_API#getEventListeners.28.29
Comment on attachment 316105 [details] Patch Clearing flags on attachment: 316105 Committed r219735: <http://trac.webkit.org/changeset/219735>
All reviewed patches have been landed. Closing bug.