WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 65353
Remove LegacyDefaultOptionalArguments flag from DOMWindow.idl
https://bugs.webkit.org/show_bug.cgi?id=65353
Summary
Remove LegacyDefaultOptionalArguments flag from DOMWindow.idl
Mark Pilgrim (Google)
Reported
2011-07-28 18:51:58 PDT
As discussed in IRC, we are migrating our IDL files away from the interface-level "LegacyDefaultOptionalArguments" flag and onto argument-level [Optional] or [Optional=CallWithDefaultValue] flags. This patch migrates DOMWindow.idl. It does not change any behavior, i.e. it does not make any arguments required that were previously optional, nor vice-versa. All existing tests pass. (Note: this required a small change to the code generator to allow [RequireAllArguments] without the "=Raise" parameter, as required by scrollBy, scrollTo, scroll, moveBy, moveTo, resizeBy, and resizeTo methods.)
Attachments
Patch
(11.30 KB, patch)
2011-07-28 18:53 PDT
,
Mark Pilgrim (Google)
no flags
Details
Formatted Diff
Diff
Patch
(9.11 KB, patch)
2011-08-03 12:19 PDT
,
Mark Pilgrim (Google)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Mark Pilgrim (Google)
Comment 1
2011-07-28 18:53:12 PDT
Created
attachment 102322
[details]
Patch
Darin Adler
Comment 2
2011-07-28 18:59:46 PDT
Comment on
attachment 102322
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=102322&action=review
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1983 > if ($dataNode->extendedAttributes->{"LegacyDefaultOptionalArguments"}) { > $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"}; > } else { > - $requiresAllArguments = "Raise"; > + $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"} || "Raise"; > }
There is probably a cleaner way to write this that doesn’t repeat the expression function->signature->extendedAttributes->{"RequiresAllArguments"}.
> Source/WebCore/page/DOMWindow.idl:74 > + [Custom] DOMWindow open(in [Optional=CallWithDefaultValue] DOMString url,
I’m curious, what does “call with default value” mean? What is the default value?
Mark Pilgrim (Google)
Comment 3
2011-07-28 19:17:42 PDT
(In reply to
comment #2
)
> (From update of
attachment 102322
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=102322&action=review
> > There is probably a cleaner way to write this that doesn’t repeat the expression function->signature->extendedAttributes->{"RequiresAllArguments"}.
After a few more patches in the coming few days, we will be removing the LegacyDefaultOptionalArguments altogether, so I'd argue it's not that big a deal.
> > > Source/WebCore/page/DOMWindow.idl:74 > > + [Custom] DOMWindow open(in [Optional=CallWithDefaultValue] DOMString url, > > I’m curious, what does “call with default value” mean? What is the default value?
It varies by type.
Adam Barth
Comment 4
2011-07-28 22:38:24 PDT
> (From update of
attachment 102322
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=102322&action=review
> > > Source/WebCore/page/DOMWindow.idl:74 > > + [Custom] DOMWindow open(in [Optional=CallWithDefaultValue] DOMString url, > > I’m curious, what does “call with default value” mean? What is the default value?
Basically, it's whatever undefined maps to for the given type. In the case of DOMString, I think that's the null string. For pointer types, it ends up as zero. "Optional" (without the value) uses C++ overloading to dispatch the different calls. We struggled a bit to come up with an appropriate name. If you've got a better suggestion, we're all ears. :)
Adam Barth
Comment 5
2011-07-29 10:50:05 PDT
Comment on
attachment 102322
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=102322&action=review
>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1983 >> if ($dataNode->extendedAttributes->{"LegacyDefaultOptionalArguments"}) { >> $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"}; >> } else { >> - $requiresAllArguments = "Raise"; >> + $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"} || "Raise"; >> } > > There is probably a cleaner way to write this that doesn’t repeat the expression function->signature->extendedAttributes->{"RequiresAllArguments"}.
I would just address this comment. It's easy to fix. :)
> Source/WebCore/page/DOMWindow.idl:205 > - [EnabledAtRuntime=FileSystem] void webkitRequestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback); > - [EnabledAtRuntime=FileSystem] void webkitResolveLocalFileSystemURL(in DOMString url, in [Callback, Optional] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback); > + [EnabledAtRuntime=FileSystem] void webkitRequestFileSystem(in [Optional=CallWithDefaultValue] unsigned short type, > + in [Optional=CallWithDefaultValue] long long size, > + in [Callback, Optional] FileSystemCallback successCallback, > + in [Callback, Optional] ErrorCallback errorCallback); > + [EnabledAtRuntime=FileSystem] void webkitResolveLocalFileSystemURL(in [Optional=CallWithDefaultValue] DOMString url, > + in [Callback, Optional] EntryCallback successCallback, > + in [Callback, Optional] ErrorCallback errorCallback);
I'd skip these. FileSystem is pretty new.
> Source/WebCore/page/DOMWindow.idl:250 > #if defined(ENABLE_REQUEST_ANIMATION_FRAME) > // WebKit animation extensions > long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback, in Element element); > - void webkitCancelRequestAnimationFrame(in long id); > + void webkitCancelRequestAnimationFrame(in [Optional=CallWithDefaultValue] long id); > #endif
This API is already pretty new. I'd skip it.
Mark Pilgrim (Google)
Comment 6
2011-08-03 12:19:51 PDT
Created
attachment 102808
[details]
Patch
Mark Pilgrim (Google)
Comment 7
2011-08-03 12:20:46 PDT
Skipped FileSystem and animationFrame APIs. Refactored code generators as per Darin's comment.
WebKit Review Bot
Comment 8
2011-08-03 14:51:02 PDT
Comment on
attachment 102808
[details]
Patch Clearing flags on attachment: 102808 Committed
r92313
: <
http://trac.webkit.org/changeset/92313
>
WebKit Review Bot
Comment 9
2011-08-03 14:51:06 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