WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
71503
Remove RequiresAllArguments
https://bugs.webkit.org/show_bug.cgi?id=71503
Summary
Remove RequiresAllArguments
Erik Arvidsson
Reported
2011-11-03 13:45:12 PDT
All method arguments are now required by default. We can annotate optional arguments using [Optional], [Optional=CallWithDefaultValue] and [Optional=CallWithNullValue] Annotating a method with [RequiresAllArguments=Raise] throws a TypeError when arguments are missing. This is the default behavior of all methods. [RequiresAllArguments=Raise] is not used anywhere. Annotating a method with [RequiresAllArguments] makes the method return undefined if any argument is missing. Source/WebCore/dom/Clipboard.idl: // FIXME: RequiresAllArguments is probably bogus here. Source/WebCore/dom/Clipboard.idl: [RequiresAllArguments] boolean setData(in DOMString type, in DOMString data); Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void scrollBy(in long x, in long y); Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void scrollTo(in long x, in long y); Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void scroll(in long x, in long y); Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void moveBy(in float x, in float y); // FIXME: this should take longs not floats. Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void moveTo(in float x, in float y); // FIXME: this should take longs not floats. Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void resizeBy(in float x, in float y); // FIXME: this should take longs not floats. Source/WebCore/page/DOMWindow.idl: [RequiresAllArguments] void resizeTo(in float width, in float height); // FIXME: this should take longs not floats. Source/WebCore/websockets/WebSocket.idl: // [RequiresAllArguments] boolean send(in ArrayBuffer data) raises(DOMException); Source/WebCore/websockets/WebSocket.idl: // [RequiresAllArguments] boolean send(in Blob data) raises(DOMException); Source/WebCore/websockets/WebSocket.idl: // [RequiresAllArguments] boolean send(in DOMString data) raises(DOMException); It seems like we could change the DOMWindow methods to just use [Optional] and not do anything in case not enough arguments are passed. Another option is to keep [RequiresAllArguments] (but not [RequiresAllArguments=Raise]) and rename it to something more correct.
Attachments
Patch
(32.57 KB, patch)
2011-11-11 13:23 PST
,
Erik Arvidsson
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Adam Barth
Comment 1
2011-11-03 15:50:23 PDT
Can we test these interfaces in other browsers? Perhaps we're actually supposed to raise an exception in these cases.
Adam Barth
Comment 2
2011-11-03 15:50:50 PDT
For example, I'd be surprised if this goofy behavior was required for WebSocket.
Erik Arvidsson
Comment 3
2011-11-09 17:15:45 PST
Firefox 8 throws for all of these when wrong number of arguments are provided IE9 treats missing arguments as 0 for all the window methods. IE9 throws "argument is not optional" for missing arguments for setData. Based on this I think we are pretty safe to remove RequiresAllArguments and change the window methods to [Optional=CallWithDefaultValue]
Erik Arvidsson
Comment 4
2011-11-11 13:23:18 PST
Created
attachment 114760
[details]
Patch
Adam Barth
Comment 5
2011-11-13 22:31:57 PST
Sounds great.
WebKit Review Bot
Comment 6
2011-11-14 11:12:14 PST
Comment on
attachment 114760
[details]
Patch Clearing flags on attachment: 114760 Committed
r100163
: <
http://trac.webkit.org/changeset/100163
>
WebKit Review Bot
Comment 7
2011-11-14 11:12:19 PST
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