WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
174719
[WebIDL] Make a few parameters non-nullable in inspector IDL files
https://bugs.webkit.org/show_bug.cgi?id=174719
Summary
[WebIDL] Make a few parameters non-nullable in inspector IDL files
Sam Weinig
Reported
2017-07-21 11:01:33 PDT
[WebIDL] Make a few parameters non-nullable in inspector IDL files
Attachments
Patch
(9.83 KB, patch)
2017-07-21 11:02 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2017-07-21 11:02:20 PDT
Created
attachment 316105
[details]
Patch
Joseph Pecoraro
Comment 2
2017-07-21 11:22:53 PDT
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?
Joseph Pecoraro
Comment 3
2017-07-21 11:41:39 PDT
`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
WebKit Commit Bot
Comment 4
2017-07-21 12:40:00 PDT
Comment on
attachment 316105
[details]
Patch Clearing flags on attachment: 316105 Committed
r219735
: <
http://trac.webkit.org/changeset/219735
>
WebKit Commit Bot
Comment 5
2017-07-21 12:40:02 PDT
All reviewed patches have been landed. Closing bug.
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