• haraken@chromium.org's avatar
    Rename [Optional=CallWithDefaultValue] and [Optional=CallWithNullValue] · 18d2e414
    haraken@chromium.org authored
    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
    18d2e414
GamepadList.idl 1.56 KB