Rename [ConvertUndefinedOrNullToNullString] to
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 19:24:23 +0000 (19:24 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 19:24:23 +0000 (19:24 +0000)
[TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString]
https://bugs.webkit.org/show_bug.cgi?id=77611

Reviewed by Adam Barth.

This patch renames [ConvertUndefinedOrNullToNullString] to
[TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString], according to the spec
(http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs,
http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs).

No tests. No changes in behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* bindings/scripts/CodeGeneratorV8.pm:
(GetNativeTypeFromSignature):
* dom/DOMImplementation.idl:
* dom/Document.idl:
* fileapi/Blob.idl:
* fileapi/DirectoryEntry.idl:
* fileapi/DirectoryEntrySync.idl:
* fileapi/Entry.idl:
* fileapi/EntrySync.idl:
* fileapi/WebKitBlobBuilder.idl:
* html/HTMLButtonElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
* page/Console.idl:
* page/DOMWindow.idl:

* bindings/scripts/test/TestObj.idl: No changes in run-bindings-tests results.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106575 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/dom/DOMImplementation.idl
Source/WebCore/dom/Document.idl
Source/WebCore/fileapi/Blob.idl
Source/WebCore/fileapi/DirectoryEntry.idl
Source/WebCore/fileapi/DirectoryEntrySync.idl
Source/WebCore/fileapi/Entry.idl
Source/WebCore/fileapi/EntrySync.idl
Source/WebCore/fileapi/WebKitBlobBuilder.idl
Source/WebCore/html/HTMLButtonElement.idl
Source/WebCore/html/HTMLCanvasElement.idl
Source/WebCore/html/HTMLFieldSetElement.idl
Source/WebCore/html/HTMLInputElement.idl
Source/WebCore/html/HTMLKeygenElement.idl
Source/WebCore/html/HTMLObjectElement.idl
Source/WebCore/html/HTMLOutputElement.idl
Source/WebCore/html/HTMLSelectElement.idl
Source/WebCore/html/HTMLTextAreaElement.idl
Source/WebCore/page/Console.idl
Source/WebCore/page/DOMWindow.idl

index 2a08389..acac9ad 100644 (file)
@@ -1,3 +1,44 @@
+2012-02-02  Kentaro Hara  <haraken@chromium.org>
+
+        Rename [ConvertUndefinedOrNullToNullString] to
+        [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString]
+        https://bugs.webkit.org/show_bug.cgi?id=77611
+
+        Reviewed by Adam Barth.
+
+        This patch renames [ConvertUndefinedOrNullToNullString] to
+        [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString], according to the spec
+        (http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs,
+        http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs).
+
+        No tests. No changes in behavior.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GetNativeTypeFromSignature):
+        * dom/DOMImplementation.idl:
+        * dom/Document.idl:
+        * fileapi/Blob.idl:
+        * fileapi/DirectoryEntry.idl:
+        * fileapi/DirectoryEntrySync.idl:
+        * fileapi/Entry.idl:
+        * fileapi/EntrySync.idl:
+        * fileapi/WebKitBlobBuilder.idl:
+        * html/HTMLButtonElement.idl:
+        * html/HTMLCanvasElement.idl:
+        * html/HTMLFieldSetElement.idl:
+        * html/HTMLInputElement.idl:
+        * html/HTMLKeygenElement.idl:
+        * html/HTMLObjectElement.idl:
+        * html/HTMLOutputElement.idl:
+        * html/HTMLSelectElement.idl:
+        * html/HTMLTextAreaElement.idl:
+        * page/Console.idl:
+        * page/DOMWindow.idl:
+
+        * bindings/scripts/test/TestObj.idl: No changes in run-bindings-tests results.
+
 2012-02-02  Anders Carlsson  <andersca@apple.com>
 
         NPAPI will not send mouse up events when mouse is outside plugin area
index b184e6d..84c061f 100644 (file)
@@ -2868,8 +2868,13 @@ sub JSValueToNative
     return "static_cast<Range::CompareHow>($value.toInt32(exec))" if $type eq "CompareHow";
 
     if ($type eq "DOMString") {
-        return "valueToStringWithNullCheck(exec, $value)" if ($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString") or $signature->extendedAttributes->{"Reflect"};
-        return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"};
+        if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "EmptyString")) {
+            return "valueToStringWithUndefinedOrNullCheck(exec, $value)"
+        }
+        if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString") or $signature->extendedAttributes->{"Reflect"}) {
+            return "valueToStringWithNullCheck(exec, $value)"
+        }
+        # FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "EmptyString"))'.
         return "ustringToString($value.isEmpty() ? UString() : $value.toString(exec)->value(exec))";
     }
 
index 62909b8..086750c 100644 (file)
@@ -3333,11 +3333,12 @@ sub GetNativeTypeFromSignature
 
     if ($parameterIndex >= 0 && $type eq "V8Parameter") {
         my $mode = "";
-        if ($signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}) {
+        if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "EmptyString")) {
             $mode = "WithUndefinedOrNullCheck";
         } elsif (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString") or $signature->extendedAttributes->{"Reflect"}) {
             $mode = "WithNullCheck";
         }
+        # FIXME: Add the case for 'elsif ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "EmptyString"))'.
         $type .= "<$mode>";
     }
 
index 0023b2b..6062ca1 100644 (file)
@@ -192,7 +192,7 @@ module test {
         void convert2(in [ConvertNullStringTo=Undefined] b);
         void convert3(in [ConvertNullStringTo=False] c);
         void convert4(in [TreatNullAs=EmptyString] d);
-        void convert5(in [ConvertUndefinedOrNullToNullString] e);
+        void convert5(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] e);
 
         attribute SVGPoint mutablePoint;
         attribute [Immutable] SVGPoint immutablePoint;
index 57577ec..d610604 100644 (file)
@@ -32,9 +32,9 @@ module core {
 
         // DOM Level 2
 
-        [OldStyleObjC] DocumentType createDocumentType(in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString qualifiedName,
-                                                       in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString publicId,
-                                                       in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString systemId)
+        [OldStyleObjC] DocumentType createDocumentType(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString qualifiedName,
+                                                       in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString publicId,
+                                                       in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString systemId)
             raises(DOMException);
         [OldStyleObjC] Document createDocument(in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString namespaceURI, 
                                                in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString qualifiedName, 
index c04f850..3c3b67b 100644 (file)
@@ -128,7 +128,7 @@ module core {
 
         boolean            execCommand(in [Optional=CallWithDefaultValue] DOMString command,
                                        in [Optional=CallWithDefaultValue] boolean userInterface,
-                                       in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString value);
+                                       in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString value);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
         // FIXME: remove the these two versions once [Optional] is implemented for Objective-C.
@@ -175,7 +175,7 @@ module core {
         NodeList getElementsByName(in [Optional=CallWithDefaultValue] DOMString elementName);
 
 #if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
-        NodeList getItems(in [ConvertUndefinedOrNullToNullString, Optional=CallWithDefaultValue] DOMString typeNames);
+        NodeList getItems(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString, Optional=CallWithDefaultValue] DOMString typeNames);
 #endif
 
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
index 9902cd4..a9e8855 100644 (file)
@@ -40,7 +40,7 @@ module html {
 
 #if !defined(LANGUAGE_OBJECTIVE_C)
 #if defined(ENABLE_BLOB) && ENABLE_BLOB
-        Blob webkitSlice(in [Optional] long long start, in [Optional] long long end, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+        Blob webkitSlice(in [Optional] long long start, in [Optional] long long end, in [Optional, TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString contentType);
 #endif
 #endif
     };
index ac345e7..1029c37 100644 (file)
@@ -36,8 +36,8 @@ module storage {
         NoStaticTables
     ] DirectoryEntry : Entry {
         DirectoryReader createReader();
-        [Custom] void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
-        [Custom] void getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        [Custom] void getFile(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        [Custom] void getDirectory(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
         void removeRecursively(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
     };
 }
index b0ab178..1fa80e6 100644 (file)
@@ -36,8 +36,8 @@ module storage {
         NoStaticTables
     ] DirectoryEntrySync : EntrySync {
         DirectoryReaderSync createReader() raises (FileException);
-        [Custom] FileEntrySync getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in WebKitFlags flags) raises (FileException);
-        [Custom] DirectoryEntrySync getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in WebKitFlags flags) raises (FileException);
+        [Custom] FileEntrySync getFile(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString path, in WebKitFlags flags) raises (FileException);
+        [Custom] DirectoryEntrySync getDirectory(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString path, in WebKitFlags flags) raises (FileException);
         void removeRecursively() raises (FileException);
     };
 }
index d6d280b..8289453 100644 (file)
@@ -41,8 +41,8 @@ module storage {
         readonly attribute DOMFileSystem filesystem;
 
         void getMetadata(in [Callback] MetadataCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
-        void moveTo(in DirectoryEntry parent, in [Optional, ConvertUndefinedOrNullToNullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
-        void copyTo(in DirectoryEntry parent, in [Optional, ConvertUndefinedOrNullToNullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        void moveTo(in DirectoryEntry parent, in [Optional, TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        void copyTo(in DirectoryEntry parent, in [Optional, TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
         DOMString toURL();
         void remove(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
         void getParent(in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
index 459a014..5b79101 100644 (file)
@@ -41,8 +41,8 @@ module storage {
         readonly attribute DOMFileSystemSync filesystem;
 
         Metadata getMetadata() raises (FileException);
-        EntrySync moveTo(in DirectoryEntrySync parent, in [ConvertUndefinedOrNullToNullString] DOMString name) raises (FileException);
-        EntrySync copyTo(in DirectoryEntrySync parent, in [ConvertUndefinedOrNullToNullString] DOMString name) raises (FileException);
+        EntrySync moveTo(in DirectoryEntrySync parent, in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString name) raises (FileException);
+        EntrySync copyTo(in DirectoryEntrySync parent, in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString name) raises (FileException);
         DOMString toURL();
         void remove() raises (FileException);
         DirectoryEntrySync getParent();
index 4563613..1012e31 100644 (file)
@@ -35,13 +35,13 @@ module html {
         NoStaticTables
     ] WebKitBlobBuilder {
 #if !defined(LANGUAGE_OBJECTIVE_C)
-        Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+        Blob getBlob(in [Optional, TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString contentType);
 #endif
         void append(in Blob blob);
 #if defined(ENABLE_BLOB) && ENABLE_BLOB
         void append(in ArrayBuffer arrayBuffer);
 #endif
-        void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
+        void append(in DOMString value, in [Optional, TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString endings) raises (DOMException);
     };
 
 }
index c91947b..f37c970 100644 (file)
@@ -39,7 +39,7 @@ module html {
         readonly attribute boolean willValidate;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         void click();
 
index 50d4ae4..d3e39ed 100644 (file)
@@ -33,7 +33,7 @@ module html {
         attribute long width;
         attribute long height;
 
-        [Custom] DOMString toDataURL(in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString type)
+        [Custom] DOMString toDataURL(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString type)
             raises(DOMException);
 
 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
index 8cffe3d..512316d 100644 (file)
@@ -25,7 +25,7 @@ module html {
         readonly attribute boolean         willValidate;
         readonly attribute DOMString       validationMessage;
         boolean  checkValidity();
-        void     setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void     setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
     };
 
 }
index bedeb9a..a8f8903 100644 (file)
@@ -73,7 +73,7 @@ module html {
         readonly attribute boolean willValidate;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
         void select();
         void click();
 
index c34a925..93d8d61 100644 (file)
@@ -44,7 +44,7 @@ module html {
         readonly attribute ValidityState validity;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         readonly attribute NodeList labels;
     };
index 27e998a..a07ac66 100644 (file)
@@ -46,7 +46,7 @@ module html {
         readonly attribute ValidityState validity;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         // Introduced in DOM Level 2:
         readonly attribute [CheckAccessToNode] Document contentDocument;
index 378ae53..c2a41da 100644 (file)
@@ -36,7 +36,7 @@ module html {
         readonly attribute ValidityState validity;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         readonly attribute NodeList labels;
     };
index 9749780..1558d3c 100644 (file)
@@ -40,7 +40,7 @@ module html {
         readonly attribute boolean willValidate;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         // Modified in DOM Level 2:
         readonly attribute HTMLOptionsCollection options;
index b341423..a035e88 100644 (file)
@@ -45,7 +45,7 @@ module html {
         readonly attribute boolean willValidate;
         readonly attribute DOMString validationMessage;
         boolean checkValidity();
-        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+        void setCustomValidity(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString error);
 
         // WinIE & FireFox extension:
         attribute long selectionStart;
index 3c63a8a..a7ac535 100644 (file)
@@ -51,8 +51,8 @@ module window {
         [Custom] void profileEnd(in DOMString title);
 #endif
 
-        void time(in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString title);
-        [CustomArgumentHandling] void timeEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
+        void time(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString title);
+        [CustomArgumentHandling] void timeEnd(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] DOMString title);
         [CustomArgumentHandling] void timeStamp();
         [CustomArgumentHandling] void group();
         [CustomArgumentHandling] void groupCollapsed();
index 6eb7477..dc44434 100644 (file)
@@ -81,7 +81,7 @@ module window {
         void alert(in [Optional=CallWithDefaultValue] DOMString message);
         boolean confirm(in [Optional=CallWithDefaultValue] DOMString message);
         [ConvertNullStringTo=Null] DOMString prompt(in [Optional=CallWithDefaultValue] DOMString message,
-                                                    in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString defaultValue);
+                                                    in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString defaultValue);
 
         boolean find(in [Optional=CallWithDefaultValue] DOMString string,
                      in [Optional=CallWithDefaultValue] boolean caseSensitive,
@@ -147,7 +147,7 @@ module window {
 
         // DOM Level 2 Style Interface
         CSSStyleDeclaration getComputedStyle(in [Optional=CallWithDefaultValue] Element element,
-                                             in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] DOMString pseudoElement);
+                                             in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString pseudoElement);
 
         // WebKit extensions
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT