RESOLVED FIXED 156955
[WebIDL] Drop [Default] WebKit-IDL extended attribute
https://bugs.webkit.org/show_bug.cgi?id=156955
Summary [WebIDL] Drop [Default] WebKit-IDL extended attribute
Chris Dumez
Reported 2016-04-23 17:27:59 PDT
Drop [Default] WebKit-IDL extended attribute in favor of the standard WebIDL syntax for parameters' default value.
Attachments
Patch (249.42 KB, patch)
2016-04-23 21:14 PDT, Chris Dumez
no flags
Patch (249.58 KB, patch)
2016-04-23 21:19 PDT, Chris Dumez
no flags
Patch (249.58 KB, patch)
2016-04-23 21:20 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (681.96 KB, application/zip)
2016-04-23 22:32 PDT, Build Bot
no flags
Patch (252.55 KB, patch)
2016-04-23 22:34 PDT, Chris Dumez
no flags
Patch (253.40 KB, patch)
2016-04-24 09:57 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-04-23 17:36:02 PDT
return-type identifier(type identifier, optional type identifier = value);
Chris Dumez
Comment 2 2016-04-23 21:14:16 PDT
Chris Dumez
Comment 3 2016-04-23 21:19:17 PDT
Chris Dumez
Comment 4 2016-04-23 21:20:20 PDT
Chris Dumez
Comment 5 2016-04-23 21:20:44 PDT
Working with EWS to get all ports building.
Build Bot
Comment 6 2016-04-23 22:32:22 PDT
Comment on attachment 277179 [details] Patch Attachment 277179 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/1210734 New failing tests: imported/w3c/web-platform-tests/html/dom/interfaces.html
Build Bot
Comment 7 2016-04-23 22:32:26 PDT
Created attachment 277183 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.4
Chris Dumez
Comment 8 2016-04-23 22:34:57 PDT
Darin Adler
Comment 9 2016-04-24 09:28:56 PDT
Comment on attachment 277184 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=277184&action=review Nice work. > Source/WebCore/ChangeLog:30 > + These do not cause any Web-Exposed behavior change. However, when getting > + rid of [Default] started passing more parameters by derefence instead of > + pointer (as is expected for parameters not marked as nullable). As a result, > + I had to mark a few parameters as nullable in the IDL to maintain the > + previous behavior. In some cases, the implementation was already throwing > + when passing null. In such cases, I have not marked the type as nullable > + so that the generated bindings now throw the exception instead of our > + implementation code. In some cases, the exception being thrown is now > + different. This is why some of the layout tests had to be rebaselined. I would have expected this patch to include removal of the code in ShouldPassWrapperByReference in CodeGenerator.pm that looks at the Default extended attribute. > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3582 > + $defaultValue = "nullptr" if $defaultValue eq "null"; > + $defaultValue = "PNaN" if $defaultValue eq "NaN"; I suggest putting these after the string related optimizations to avoid the peculiar use of nullptr in the string code. > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3583 > + $defaultValue = GetNativeTypeFromSignature($parameter) . "()" if $defaultValue eq "[]"; Could we just use "{}" instead of doing this? > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3592 > + $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)"; Should talk to Ben about these to be sure they are what we want. For example, if there is something performance critical going on it would be good to avoid allocating and then deleting every time. > Source/WebCore/dom/NodeFilter.idl:50 > #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C > - short acceptNode([Default=Undefined] optional Node n); > + short acceptNode(optional Node n); > #else > - [Custom] unsigned short acceptNode([Default=Undefined] optional Node n); > + [Custom] unsigned short acceptNode(optional Node n); > #endif We have to be able to do better than the name "n".
Chris Dumez
Comment 10 2016-04-24 09:48:50 PDT
Comment on attachment 277184 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=277184&action=review >> Source/WebCore/ChangeLog:30 >> + different. This is why some of the layout tests had to be rebaselined. > > I would have expected this patch to include removal of the code in ShouldPassWrapperByReference in CodeGenerator.pm that looks at the Default extended attribute. Will do. >> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3582 >> + $defaultValue = "PNaN" if $defaultValue eq "NaN"; > > I suggest putting these after the string related optimizations to avoid the peculiar use of nullptr in the string code. Ok >> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3583 >> + $defaultValue = GetNativeTypeFromSignature($parameter) . "()" if $defaultValue eq "[]"; > > Could we just use "{}" instead of doing this? That was my first attempt but it did not build. It complained about not being allowed to use an initializer list on the right side of a '?'. >> Source/WebCore/dom/NodeFilter.idl:50 >> #endif > > We have to be able to do better than the name "n". Ok.
Chris Dumez
Comment 11 2016-04-24 09:57:37 PDT
Chris Dumez
Comment 12 2016-04-24 10:23:24 PDT
Note You need to log in before you can comment on or make changes to this bug.