Bug 65715 - Remove LegacyDefaultOptionalArguments flag from DOM-related files except Document.idl
Summary: Remove LegacyDefaultOptionalArguments flag from DOM-related files except Docu...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 13:39 PDT by Mark Pilgrim (Google)
Modified: 2011-08-04 17:03 PDT (History)
2 users (show)

See Also:


Attachments
Patch (34.82 KB, patch)
2011-08-04 13:40 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (34.16 KB, patch)
2011-08-04 16:37 PDT, Mark Pilgrim (Google)
no flags 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 13:39:03 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 IDL files in the dom/ directory *except* Document.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.
Comment 1 Mark Pilgrim (Google) 2011-08-04 13:40:06 PDT
Created attachment 102972 [details]
Patch
Comment 2 Adam Barth 2011-08-04 13:52:34 PDT
Comment on attachment 102972 [details]
Patch

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

> Source/WebCore/dom/Clipboard.idl:-32
> -        LegacyDefaultOptionalArguments,

is RequiresAllArguments still needed for setData ?

> Source/WebCore/dom/MediaStreamList.idl:31
> -        MediaStream item(in [IsIndex] unsigned long index);
> +        MediaStream item(in [IsIndex,Optional=CallWithDefaultValue] unsigned long index);

I'm slightly unsure about this one.  The MediaStream stuff is very new, so maybe it doesn't need it?  On the other hand, having all these fake vectors be consistent seems beneficial.

> Source/WebCore/dom/MediaStreamTrackList.idl:31
> -        MediaStreamTrack item(in [IsIndex] unsigned long index);
> +        MediaStreamTrack item(in [IsIndex,Optional=CallWithDefaultValue] unsigned long index);

This probably isn't needed.
Comment 3 Adam Barth 2011-08-04 13:53:11 PDT
Comment on attachment 102972 [details]
Patch

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

> Source/WebCore/dom/TouchList.idl:34
> -        Touch item(in unsigned long index);
> +        Touch item(in [Optional=CallWithDefaultValue] unsigned long index);

Same thing here.  TOUCH_EVENTS are very new.  I think we should skip these even though it's somewhat inconsistent.
Comment 4 Mark Pilgrim (Google) 2011-08-04 13:59:00 PDT
(In reply to comment #2)
> (From update of attachment 102972 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=102972&action=review
> 
> > Source/WebCore/dom/Clipboard.idl:-32
> > -        LegacyDefaultOptionalArguments,
> 
> is RequiresAllArguments still needed for setData ?

Yes. [RequiresAllArguments] is different from [RequiresAllArguments=Raise].

> 
> > Source/WebCore/dom/MediaStreamList.idl:31
> > -        MediaStream item(in [IsIndex] unsigned long index);
> > +        MediaStream item(in [IsIndex,Optional=CallWithDefaultValue] unsigned long index);
> 
> I'm slightly unsure about this one.  The MediaStream stuff is very new, so maybe it doesn't need it?  On the other hand, having all these fake vectors be consistent seems beneficial.
> 
> > Source/WebCore/dom/MediaStreamTrackList.idl:31
> > -        MediaStreamTrack item(in [IsIndex] unsigned long index);
> > +        MediaStreamTrack item(in [IsIndex,Optional=CallWithDefaultValue] unsigned long index);
> 
> This probably isn't needed.

New patch coming up...
Comment 5 Adam Barth 2011-08-04 14:03:15 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > (From update of attachment 102972 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=102972&action=review
> > 
> > > Source/WebCore/dom/Clipboard.idl:-32
> > > -        LegacyDefaultOptionalArguments,
> > 
> > is RequiresAllArguments still needed for setData ?
> 
> Yes. [RequiresAllArguments] is different from [RequiresAllArguments=Raise].

Because it returns undefined?  It might be good to test other browsers to see if we're really not supposed to Raise in this situation.
Comment 6 Mark Pilgrim (Google) 2011-08-04 16:37:57 PDT
Created attachment 103003 [details]
Patch
Comment 7 Mark Pilgrim (Google) 2011-08-04 16:38:52 PDT
This patch changes the behavior of MediaStreamList and MediaTrackList, but it doesn't change Clipboard.
Comment 8 WebKit Review Bot 2011-08-04 17:03:27 PDT
Comment on attachment 103003 [details]
Patch

Clearing flags on attachment: 103003

Committed r92433: <http://trac.webkit.org/changeset/92433>
Comment 9 WebKit Review Bot 2011-08-04 17:03:32 PDT
All reviewed patches have been landed.  Closing bug.