Bug 69801 - Regarding constructor, replace [ConstructorWith=...] IDL with [CallWith=...] IDL
Summary: Regarding constructor, replace [ConstructorWith=...] IDL with [CallWith=...] IDL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 69799
Blocks: 65839
  Show dependency treegraph
 
Reported: 2011-10-10 16:43 PDT by Kentaro Hara
Modified: 2011-10-13 16:44 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.02 KB, patch)
2011-10-13 05:35 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (5.03 KB, patch)
2011-10-13 05:37 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2011-10-10 16:43:37 PDT
As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...]. We should deprecate [ConstructorWith=...]. This is a clean-up bug for the bug 65839.
Comment 1 Adam Barth 2011-10-10 16:56:39 PDT
@Kentaro: CallWith should also be the first arguments to the constructors, not the last as ConstructorWith appears to be.
Comment 2 Kentaro Hara 2011-10-10 17:08:07 PDT
abarth: There are two options. Deprecate [ConstructorWith=...] or deprecate [CallWith=...]. I first thought that deprecating [ConstructorWith=...] will make more sense, since [CallWith=...] is used here and there and I did not care the position of arguments. 

I want to keep the position of arguments of existing constructors as it is (i.e. the last). So, as for constructors, I would like to deprecate [CallWith=...].
Comment 3 Adam Barth 2011-10-10 17:13:04 PDT
See also Bug 69799

> I want to keep the position of arguments of existing constructors as it is

Why?
Comment 4 Kentaro Hara 2011-10-10 17:30:08 PDT
(In reply to comment #3)
> > I want to keep the position of arguments of existing constructors as it is
> 
> Why?

Just because all the existing custom constructors that are using ScriptExecutionContext are putting it as the last argument.

> See also Bug 69799

Ah, sorry, I noticed it now. I agree to it. Before uploading this patch, I will wait for the above patch landed.
Comment 5 Kentaro Hara 2011-10-13 05:35:37 PDT
Created attachment 110832 [details]
Patch
Comment 6 Kentaro Hara 2011-10-13 05:37:37 PDT
Created attachment 110833 [details]
Patch
Comment 7 Adam Barth 2011-10-13 11:34:48 PDT
Comment on attachment 110833 [details]
Patch

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

> Source/WebCore/ChangeLog:7
> +        As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...].
> +        We should deprecate [ConstructorWith=...]. This is a clean-up bug for the bug 65839.

It's somewhat less obvious what CallWith means as an attribute of the whole interface.  I guess it makes sense for JavaScript where the interface *is* the constructor, but it probably makes somewhat less sense for other languages.  I still think this patch is a win though.

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1549
> -    if ($dataNode->extendedAttributes->{"ConstructorWith"} && $dataNode->extendedAttributes->{"ConstructorWith"} eq "ScriptExecutionContext") {
> +    if ($dataNode->extendedAttributes->{"CallWith"} && $dataNode->extendedAttributes->{"CallWith"} eq "ScriptExecutionContext") {

Do we not need a similar change to CodeGeneratorJSC.pm ?  I guess all these interfaces have JSCustomConstructor.

> Source/WebCore/fileapi/FileReader.idl:-41
> -        ConstructorWith=ScriptExecutionContext,

This doesn't need CallWith ?  I guess not if we can compile without it.
Comment 8 Kentaro Hara 2011-10-13 15:37:40 PDT
(In reply to comment #7)
> (From update of attachment 110833 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=110833&action=review
> 
> > Source/WebCore/ChangeLog:7
> > +        As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...].
> > +        We should deprecate [ConstructorWith=...]. This is a clean-up bug for the bug 65839.
> 
> It's somewhat less obvious what CallWith means as an attribute of the whole interface.  I guess it makes sense for JavaScript where the interface *is* the constructor, but it probably makes somewhat less sense for other languages.  I still think this patch is a win though.
> 
> > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1549
> > -    if ($dataNode->extendedAttributes->{"ConstructorWith"} && $dataNode->extendedAttributes->{"ConstructorWith"} eq "ScriptExecutionContext") {
> > +    if ($dataNode->extendedAttributes->{"CallWith"} && $dataNode->extendedAttributes->{"CallWith"} eq "ScriptExecutionContext") {
> 
> Do we not need a similar change to CodeGeneratorJSC.pm ?  I guess all these interfaces have JSCustomConstructor.

No, because [ConstructorWith] is the IDL that I introduced when I implemented [Constructor] IDL for V8, in other words, [ConstructorWith] is not yet implemented in JSC.

> 
> > Source/WebCore/fileapi/FileReader.idl:-41
> > -        ConstructorWith=ScriptExecutionContext,
> 
> This doesn't need CallWith ?  I guess not if we can compile without it.

It has CallWith. You can find it by clicking "20 below" link of FileReader.idl diff. I just removed ConstructorWith because FileReader.idl has both ConstructorWith and CallWith.

Thanks for reviewing these patches, Adam!
Comment 9 WebKit Review Bot 2011-10-13 16:44:51 PDT
Comment on attachment 110833 [details]
Patch

Clearing flags on attachment: 110833

Committed r97424: <http://trac.webkit.org/changeset/97424>
Comment 10 WebKit Review Bot 2011-10-13 16:44:56 PDT
All reviewed patches have been landed.  Closing bug.