Rename [Optional=CallWithDefaultValue] and [Optional=CallWithNullValue]
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 00:25:00 +0000 (00:25 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 00:25:00 +0000 (00:25 +0000)
commit18d2e414d3cbc1df7aec2eae2457fd741fcfc433
tree85d3932e1e10ae580fac27cfc04ccf27cc230958
parentea6c3e32826acec2875923860ad1c4b6a96f3575
Rename [Optional=CallWithDefaultValue] and [Optional=CallWithNullValue]
https://bugs.webkit.org/show_bug.cgi?id=78200

Reviewed by Adam Barth.

[Optional=CallWithDefaultValue] and [Optional=CallWithNullValue] are confusing.

- [Optional=CallWithDefaultValue] indicates that a missing value should be treated
as if the JavaScript undefined is passed.
- [Optional=CallWithNullValue] indicates that a missing value should be treated as
the WebKit null value (i.e. JSValue() or v8::Local<v8::Value>()).
- Actually, the difference between [Optional=CallWithDefaultValue] and
[Optional=CallWithNullValue] will appear only when the type of the missing value
is DOMString. In case of [Optional=CallWithDefaultValue], the missing value is
converted to the string "undefined". On the other hand, in case of
[Optional=CallWithNullValue], the missing value is converted to the WebKit null string.

With these observations, this patch renames as follows:

- Rename [Optional=CallWithDefaultValue] to [Optional=DefaultIsUndefined].
- Rename [Optional=CallWithNullValue] to [Optional=DefaultIsNullString].

Test: bindings/scripts/test/TestObj.idl

* bindings/js/JSDOMBinding.h: Renamed MissingIsEmpty to DefaultIsNullString,
renamed MissingIsUndefined to DefaultIsUndefined.
* bindings/v8/V8Binding.h: Ditto.
* bindings/v8/custom/V8BindingMacros.h: Ditto.

* bindings/scripts/CodeGeneratorJS.pm: Modified to support the renaming.
(GenerateParametersCheck):
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
(GenerateParametersCheck):
(RequiresCustomSignature):

* bindings/scripts/test/TestObj.idl: Renamed [Optional=...] as described above.
* bindings/scripts/test/TestInterface.idl: Ditto.
* bindings/scripts/test/TestNamedConstructor.idl: Ditto.

* bindings/scripts/test/CPP/WebDOMTestObj.cpp: Updated run-bindings-tests results.
(WebDOMTestObj::methodWithOptionalString):
(WebDOMTestObj::methodWithOptionalStringIsUndefinedString):
(WebDOMTestObj::methodWithOptionalStringIsNullString):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_method_with_optional_string):
(webkit_dom_test_obj_method_with_optional_string_is_undefined_string):
(webkit_dom_test_obj_method_with_optional_string_is_null_string):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefinedString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj methodWithOptionalString:]):
(-[DOMTestObj methodWithOptionalStringIsUndefinedString:]):
(-[DOMTestObj methodWithOptionalStringIsNullString:]):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructorCallback):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjInternal::methodWithOptionalStringCallback):
(TestObjInternal):
(WebCore::TestObjInternal::methodWithOptionalStringIsUndefinedStringCallback):
(WebCore::TestObjInternal::methodWithOptionalStringIsNullStringCallback):
(WebCore):

* Modules/gamepad/GamepadList.idl: Renamed [Optional=...] as described above.
* Modules/intents/Intent.idl:
* css/CSSMediaRule.idl:
* css/CSSPrimitiveValue.idl:
* css/CSSRuleList.idl:
* css/CSSStyleDeclaration.idl:
* css/CSSStyleSheet.idl:
* css/CSSValueList.idl:
* css/MediaList.idl:
* css/MediaQueryList.idl:
* css/MediaQueryListListener.idl:
* css/StyleMedia.idl:
* css/StyleSheetList.idl:
* css/WebKitCSSKeyframesRule.idl:
* css/WebKitCSSMatrix.idl:
* dom/CharacterData.idl:
* dom/ClientRectList.idl:
* dom/CompositionEvent.idl:
* dom/CustomEvent.idl:
* dom/DOMImplementation.idl:
* dom/DOMStringList.idl:
* dom/DataTransferItem.idl:
* dom/DataTransferItemList.idl:
* dom/DeviceMotionEvent.idl:
* dom/DeviceOrientationEvent.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/Event.idl:
* dom/HashChangeEvent.idl:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationEvent.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/NodeFilter.idl:
* dom/NodeList.idl:
* dom/OverflowEvent.idl:
* dom/Range.idl:
* dom/ShadowRoot.idl:
* dom/Text.idl:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/UIEvent.idl:
* dom/WheelEvent.idl:
* html/DOMFormData.idl:
* html/HTMLAllCollection.idl:
* html/HTMLAudioElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLCollection.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* html/TextTrackCue.idl:
* html/canvas/CanvasGradient.idl:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/Float32Array.idl:
* html/canvas/Float64Array.idl:
* html/canvas/Int16Array.idl:
* html/canvas/Int32Array.idl:
* html/canvas/Int8Array.idl:
* html/canvas/OESVertexArrayObject.idl:
* html/canvas/Uint16Array.idl:
* html/canvas/Uint32Array.idl:
* html/canvas/Uint8Array.idl:
* html/canvas/Uint8ClampedArray.idl:
* page/Console.idl:
* page/DOMSelection.idl:
* page/DOMWindow.idl:
* page/History.idl:
* page/Location.idl:
* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPlugin.idl:
* plugins/DOMPluginArray.idl:
* storage/IDBDatabase.idl:
* storage/StorageEvent.idl:
* svg/ElementTimeControl.idl:
* svg/SVGDocument.idl:
* svg/SVGElementInstanceList.idl:
* svg/SVGFEDropShadowElement.idl:
* svg/SVGFEGaussianBlurElement.idl:
* svg/SVGFEMorphologyElement.idl:
* svg/SVGFilterElement.idl:
* svg/SVGLocatable.idl:
* svg/SVGMarkerElement.idl:
* svg/SVGPathElement.idl:
* svg/SVGSVGElement.idl:
* svg/SVGStylable.idl:
* svg/SVGTests.idl:
* svg/SVGTextContentElement.idl:
* webaudio/AudioNode.idl:
* workers/SharedWorker.idl:
* workers/WorkerContext.idl:
* xml/DOMParser.idl:
* xml/XMLSerializer.idl:
* xml/XPathEvaluator.idl:
* xml/XPathExpression.idl:
* xml/XPathNSResolver.idl:
* xml/XPathResult.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
141 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/gamepad/GamepadList.idl
Source/WebCore/Modules/intents/Intent.idl
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestInterface.idl
Source/WebCore/bindings/scripts/test/TestNamedConstructor.idl
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/v8/V8Binding.h
Source/WebCore/bindings/v8/custom/V8BindingMacros.h
Source/WebCore/css/CSSMediaRule.idl
Source/WebCore/css/CSSPrimitiveValue.idl
Source/WebCore/css/CSSRuleList.idl
Source/WebCore/css/CSSStyleDeclaration.idl
Source/WebCore/css/CSSStyleSheet.idl
Source/WebCore/css/CSSValueList.idl
Source/WebCore/css/MediaList.idl
Source/WebCore/css/MediaQueryList.idl
Source/WebCore/css/MediaQueryListListener.idl
Source/WebCore/css/StyleMedia.idl
Source/WebCore/css/StyleSheetList.idl
Source/WebCore/css/WebKitCSSKeyframesRule.idl
Source/WebCore/css/WebKitCSSMatrix.idl
Source/WebCore/dom/CharacterData.idl
Source/WebCore/dom/ClientRectList.idl
Source/WebCore/dom/CompositionEvent.idl
Source/WebCore/dom/CustomEvent.idl
Source/WebCore/dom/DOMImplementation.idl
Source/WebCore/dom/DOMStringList.idl
Source/WebCore/dom/DataTransferItem.idl
Source/WebCore/dom/DataTransferItemList.idl
Source/WebCore/dom/DeviceMotionEvent.idl
Source/WebCore/dom/DeviceOrientationEvent.idl
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.idl
Source/WebCore/dom/Event.idl
Source/WebCore/dom/HashChangeEvent.idl
Source/WebCore/dom/KeyboardEvent.idl
Source/WebCore/dom/MessageEvent.idl
Source/WebCore/dom/MouseEvent.idl
Source/WebCore/dom/MutationEvent.idl
Source/WebCore/dom/NamedNodeMap.idl
Source/WebCore/dom/Node.idl
Source/WebCore/dom/NodeFilter.idl
Source/WebCore/dom/NodeList.idl
Source/WebCore/dom/OverflowEvent.idl
Source/WebCore/dom/Range.idl
Source/WebCore/dom/ShadowRoot.idl
Source/WebCore/dom/Text.idl
Source/WebCore/dom/TextEvent.idl
Source/WebCore/dom/TouchEvent.idl
Source/WebCore/dom/UIEvent.idl
Source/WebCore/dom/WheelEvent.idl
Source/WebCore/html/DOMFormData.idl
Source/WebCore/html/HTMLAllCollection.idl
Source/WebCore/html/HTMLAudioElement.idl
Source/WebCore/html/HTMLCanvasElement.idl
Source/WebCore/html/HTMLCollection.idl
Source/WebCore/html/HTMLDocument.idl
Source/WebCore/html/HTMLElement.idl
Source/WebCore/html/HTMLInputElement.idl
Source/WebCore/html/HTMLMediaElement.idl
Source/WebCore/html/HTMLOptionElement.idl
Source/WebCore/html/HTMLOptionsCollection.idl
Source/WebCore/html/HTMLSelectElement.idl
Source/WebCore/html/HTMLTableElement.idl
Source/WebCore/html/HTMLTableRowElement.idl
Source/WebCore/html/HTMLTableSectionElement.idl
Source/WebCore/html/HTMLTextAreaElement.idl
Source/WebCore/html/TextTrackCue.idl
Source/WebCore/html/canvas/CanvasGradient.idl
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
Source/WebCore/html/canvas/Float32Array.idl
Source/WebCore/html/canvas/Float64Array.idl
Source/WebCore/html/canvas/Int16Array.idl
Source/WebCore/html/canvas/Int32Array.idl
Source/WebCore/html/canvas/Int8Array.idl
Source/WebCore/html/canvas/OESVertexArrayObject.idl
Source/WebCore/html/canvas/Uint16Array.idl
Source/WebCore/html/canvas/Uint32Array.idl
Source/WebCore/html/canvas/Uint8Array.idl
Source/WebCore/html/canvas/Uint8ClampedArray.idl
Source/WebCore/page/Console.idl
Source/WebCore/page/DOMSelection.idl
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/History.idl
Source/WebCore/page/Location.idl
Source/WebCore/plugins/DOMMimeTypeArray.idl
Source/WebCore/plugins/DOMPlugin.idl
Source/WebCore/plugins/DOMPluginArray.idl
Source/WebCore/storage/IDBDatabase.idl
Source/WebCore/storage/StorageEvent.idl
Source/WebCore/svg/ElementTimeControl.idl
Source/WebCore/svg/SVGDocument.idl
Source/WebCore/svg/SVGElementInstanceList.idl
Source/WebCore/svg/SVGFEDropShadowElement.idl
Source/WebCore/svg/SVGFEGaussianBlurElement.idl
Source/WebCore/svg/SVGFEMorphologyElement.idl
Source/WebCore/svg/SVGFilterElement.idl
Source/WebCore/svg/SVGLocatable.idl
Source/WebCore/svg/SVGMarkerElement.idl
Source/WebCore/svg/SVGPathElement.idl
Source/WebCore/svg/SVGSVGElement.idl
Source/WebCore/svg/SVGStylable.idl
Source/WebCore/svg/SVGTests.idl
Source/WebCore/svg/SVGTextContentElement.idl
Source/WebCore/webaudio/AudioNode.idl
Source/WebCore/workers/SharedWorker.idl
Source/WebCore/workers/WorkerContext.idl
Source/WebCore/xml/DOMParser.idl
Source/WebCore/xml/XMLSerializer.idl
Source/WebCore/xml/XPathEvaluator.idl
Source/WebCore/xml/XPathExpression.idl
Source/WebCore/xml/XPathNSResolver.idl
Source/WebCore/xml/XPathResult.idl