As discussed in IRC, we are doing away with the interface-level LegacyDefaultOptionalArguments flag. To handle some cases of the old behavior, we need to define a new (argument-level) flag so that functions can define optional arguments but not have to declare every single combination of arguments in C++. The old code generator handled this by calling a single C++ function with all arguments, but with default values for the "optional" arguments. Thus, this patch invents a new argument-level flag called [Optional=CallWithDefaultValue] that emulates the old behavior. This patch also fixes all the initXXXEvent declarations to remove the LegacyDefaultOptionalArguments flag and use the new [Optional=CallWithDefaultValue] flag on arguments that require it for backward compatibility.
Created attachment 101639 [details] Patch
Comment on attachment 101639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=101639&action=review > Source/WebCore/dom/MessageEvent.idl:40 > - [Custom] void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in SerializedScriptValue dataArg, in DOMString originArg, in DOMString lastEventIdArg, in DOMWindow sourceArg, in Array messagePorts); > + [Custom] void initMessageEvent(in [Optional=CallWithDefaultValue] DOMString typeArg, in [Optional=CallWithDefaultValue] boolean canBubbleArg, in [Optional=CallWithDefaultValue] boolean cancelableArg, in [Optional=CallWithDefaultValue] SerializedScriptValue dataArg, in [Optional=CallWithDefaultValue] DOMString originArg, in [Optional=CallWithDefaultValue] DOMString lastEventIdArg, in [Optional=CallWithDefaultValue] DOMWindow sourceArg, in [Optional=CallWithDefaultValue] Array messagePorts); I'd reformat this onto multiple lines. > Source/WebCore/dom/MessageEvent.idl:45 > - void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in SerializedScriptValue dataArg, in DOMString originArg, in DOMString lastEventIdArg, in DOMWindow sourceArg, in MessagePort messagePort); > + void initMessageEvent(in [Optional=CallWithDefaultValue] DOMString typeArg, in [Optional=CallWithDefaultValue] boolean canBubbleArg, in [Optional=CallWithDefaultValue] boolean cancelableArg, in [Optional=CallWithDefaultValue] SerializedScriptValue dataArg, in [Optional=CallWithDefaultValue] DOMString originArg, in [Optional=CallWithDefaultValue] DOMString lastEventIdArg, in [Optional=CallWithDefaultValue] DOMWindow sourceArg, in [Optional=CallWithDefaultValue] MessagePort messagePort); This too.
Also just realized that I'm using the != operator instead of "ne" to compare strings in Perl (CodeGenerator*.pm). Leaving this comment as a reminder to myself since I might not be able to re-patch this until Monday.
Comment on attachment 101639 [details] Patch Attachment 101639 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9200874 New failing tests: fast/events/document-elementFromPoint.html fast/events/offsetX-offsetY.html fast/events/init-events.html fast/dom/Window/window-xy-properties.html
Created attachment 101756 [details] Patch
Fixed !=/ne confusion. Also fixed failing tests -- there was one more place in the V8 code generator (only) that needed to distinguish between [Optional] and [Optional=CallWithDefaultValue], when checking whether it needed to build a custom signature.
Comment on attachment 101756 [details] Patch Clearing flags on attachment: 101756 Committed r91617: <http://trac.webkit.org/changeset/91617>
All reviewed patches have been landed. Closing bug.