12011-09-09 Kentaro Hara <haraken@google.com>
2
3 Generate a WebKitCSSMatrix constructor of V8 using the IDL 'Constructor' extended attribute
4 https://bugs.webkit.org/show_bug.cgi?id=67458
5
6 Reviewed by NOBODY (OOPS!).
7
8 Added a 'CallWithNullValue' extended attribute.
9 If a parameter is optional and missing, 'CallWithDefaultValue'
10 handles it as a string "undefined". On the other hand,
11 'CallWithNullValue' handles it as a null string
12 (Note: not a string "null", but a null string).
13
14 Tests: fast/dom/Window/custom-constructors.html
15 transforms/svg-vs-css.xhtml
16 transforms/cssmatrix-2d-interface.xhtml
17 transforms/cssmatrix-3d-interface.xhtmlGenerate a WebKitCSSMatrix constructor
18
19 * WebCore.gypi: Removed V8WebKitCSSMatrixConstructor.cpp.
20 * WebCore.pro: Removed V8WebKitCSSMatrixConstructor.cpp.
21 * bindings/scripts/CodeGeneratorV8.pm:
22 (GenerateParametersCheck): If the 'CallWithNullValue' extended attribute is set, we call MAYBE_MISSING_PARAMETER() with MISSING_IS_EMPTY mode to obtain a maybe missing parameter. Otherwise, we call MAYBE_MISSING_PARAMETER() with MISSING_IS_UNDEFINED mode.
23 (RequiresCustomSignature):
24 * bindings/scripts/test/V8/V8TestInterface.cpp: Updated test results.
25 (WebCore::V8TestInterface::constructorCallback):
26 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: Ditto.
27 (WebCore::TestMediaQueryListListenerInternal::methodCallback):
28 * bindings/scripts/test/V8/V8TestObj.cpp: Ditto.
29 (WebCore::TestObjInternal::voidMethodWithArgsCallback):
30 (WebCore::TestObjInternal::intMethodWithArgsCallback):
31 (WebCore::TestObjInternal::objMethodWithArgsCallback):
32 (WebCore::TestObjInternal::methodThatRequiresAllArgsCallback):
33 (WebCore::TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback):
34 (WebCore::TestObjInternal::optionsObjectCallback):
35 (WebCore::TestObjInternal::customArgsAndExceptionCallback):
36 (WebCore::TestObjInternal::withDynamicFrameAndArgCallback):
37 (WebCore::TestObjInternal::withDynamicFrameAndOptionalArgCallback):
38 (WebCore::TestObjInternal::withDynamicFrameAndUserGestureCallback):
39 (WebCore::TestObjInternal::withDynamicFrameAndUserGestureASADCallback):
40 (WebCore::TestObjInternal::methodWithOptionalArgCallback):
41 (WebCore::TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback):
42 (WebCore::TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback):
43 (WebCore::TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback):
44 (WebCore::TestObjInternal::overloadedMethod1Callback):
45 (WebCore::TestObjInternal::overloadedMethod2Callback):
46 (WebCore::TestObjInternal::overloadedMethod3Callback):
47 (WebCore::TestObjInternal::overloadedMethod4Callback):
48 (WebCore::TestObjInternal::classMethodWithOptionalCallback):
49 (WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback):
50 (WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback):
51 * bindings/v8/V8Binding.h:
52 (WebCore::V8ParameterBase::prepareBase): The fact that V8ParameterBase does not have any object means that we do not need to prepare anything, i.e. we should just return true in this case.
53 (WebCore::::prepare): If V8ParameterBase does not have any object, then we set a null string.
54 * bindings/v8/custom/V8BindingMacros.h: MAYBE_MISSING_PARAMETER() returns the parameter of a given index if the parameter exists. If the parameter does not exist and MISSING_IS_UNDEFINED is set, this macro returns an object that represents undefined. If the parameter does not exist and MISSING_IS_EMPTY is set, this macro returns an empty object.
55 * bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp: Removed.
56 * css/WebKitCSSMatrix.idl: Added the 'Constructor' extended attribute.
57