Bug 65744 - Remove LegacyDefaultOptionalArguments flag from storage IDL files
Summary: Remove LegacyDefaultOptionalArguments flag from storage IDL files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 21:47 PDT by Mark Pilgrim (Google)
Modified: 2011-11-02 18:56 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.60 KB, patch)
2011-08-04 21:47 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (9.57 KB, patch)
2011-11-02 15:33 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (12.37 KB, patch)
2011-11-02 16:07 PDT, Erik Arvidsson
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2011-08-04 21:47:02 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 all remaining IndexedDB and WebSQLDatabase-related IDL files. It does not change any behavior, i.e. it does not make any arguments required that were previously optional, nor vice-versa. ONE EXCEPTION: it changes IDBTransaction.idl to make the objectStore() method require its single argument, as required by WebIDL and consistent with all the other changes we've made in the recent past to make IndexedDB as strict as WebIDL requires.

All existing tests pass.
Comment 1 Mark Pilgrim (Google) 2011-08-04 21:47:50 PDT
Created attachment 103032 [details]
Patch
Comment 2 Adam Barth 2011-08-04 21:55:44 PDT
Comment on attachment 103032 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=103032&action=review

> Source/WebCore/storage/StorageInfo.idl:41
> -        [CallWith=ScriptExecutionContext] void queryUsageAndQuota(in unsigned short storageType, in [Callback, Optional] StorageInfoUsageCallback usageCallback, in [Callback, Optional] StorageInfoErrorCallback errorCallback);
> -        [CallWith=ScriptExecutionContext] void requestQuota(in unsigned short storageType, in unsigned long long newQuotaInBytes, in [Callback, Optional] StorageInfoQuotaCallback quotaCallback, in [Callback, Optional] StorageInfoErrorCallback errorCallback);
> +        [CallWith=ScriptExecutionContext] void queryUsageAndQuota(in [Optional=CallWithDefaultValue] unsigned short storageType, 
> +                                                                  in [Callback, Optional] StorageInfoUsageCallback usageCallback, 
> +                                                                  in [Callback, Optional] StorageInfoErrorCallback errorCallback);
> +        [CallWith=ScriptExecutionContext] void requestQuota(in [Optional=CallWithDefaultValue] unsigned short storageType, 
> +                                                            in [Optional=CallWithDefaultValue] unsigned long long newQuotaInBytes, 
> +                                                            in [Callback, Optional] StorageInfoQuotaCallback quotaCallback, 
> +                                                            in [Callback, Optional] StorageInfoErrorCallback errorCallback);

QUOTA is very new.  I wouldn't add the optional attributes.
Comment 3 Erik Arvidsson 2011-10-26 16:07:14 PDT
Comment on attachment 103032 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=103032&action=review

> Source/WebCore/storage/Storage.idl:42
> +        [DontEnum, ConvertNullStringTo=Null] DOMString key(in [Optional=CallWithDefaultValue] unsigned long index);
> +        [DontEnum, ConvertNullStringTo=Null] DOMString getItem(in [Optional=CallWithDefaultValue] DOMString key);
> +        [DontEnum] void setItem(in [Optional=CallWithDefaultValue] DOMString key, 
> +                                in [Optional=CallWithDefaultValue] DOMString data) 
>              raises(DOMException);
> -        [DontEnum] void removeItem(in DOMString key);
> +        [DontEnum] void removeItem(in [Optional=CallWithDefaultValue] DOMString key);

I understand that this doesn't change the semantics but do we really want these to be optional?
Comment 4 Adam Barth 2011-10-26 16:39:27 PDT
> I understand that this doesn't change the semantics but do we really want these to be optional?

Yeah, they make much more sense as non-optional.  The only question is the compatibility risk.

Do other browsers require these arguments?
Comment 5 Erik Arvidsson 2011-11-02 15:33:38 PDT
Created attachment 113388 [details]
Patch
Comment 6 Erik Arvidsson 2011-11-02 15:34:37 PDT
(In reply to comment #4)
> Do other browsers require these arguments?

I checked and all these arguments are required in Firefox. I can test IE9 too if you want.
Comment 7 Adam Barth 2011-11-02 15:37:56 PDT
Comment on attachment 113388 [details]
Patch

Can we add those tests as LayoutTests?
Comment 8 Erik Arvidsson 2011-11-02 15:38:31 PDT
IE9 allows skipping the arguments in Storage.idl even though it makes little sense in doing

localStorage.setItem()

I'm fine changing this to match IE9 but I feel like we are better of not allowing this.

I will add some tests.
Comment 9 Erik Arvidsson 2011-11-02 16:07:37 PDT
Created attachment 113391 [details]
Patch
Comment 10 Adam Barth 2011-11-02 16:36:32 PDT
Comment on attachment 113391 [details]
Patch

What about StorageInfo.idl ?  Would you be willing to add tests for those changes too.  Note: Quota is very new, so there's not much risk of breaking stuff.
Comment 11 Erik Arvidsson 2011-11-02 18:56:22 PDT
Committed r99130: <http://trac.webkit.org/changeset/99130>