Remove [ConvertToString] from CodeGeneratorCPP.pm and rename
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 00:21:20 +0000 (00:21 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 00:21:20 +0000 (00:21 +0000)
it to [ObjCImplementedAsUnsignedLong]
https://bugs.webkit.org/show_bug.cgi?id=78100

Reviewed by Eric Seidel.

Now [ConvertToString] is used by ObjC's HTMLElement.size only.
This patch removes [ConvertToString] code from CodeGeneratorCPP.pm,
and renames [ConvertToString] to [ObjCImplementedAsUnsignedLong].

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorCPP.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
* html/HTMLInputElement.idl: Removed FIXME comment, because the latest spec
says HTMLInputElement.size should be unsigned long.
(http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-element)

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
Source/WebCore/html/HTMLInputElement.idl

index e0db884..91f0f7a 100644 (file)
@@ -1,3 +1,25 @@
+2012-02-08  Kentaro Hara  <haraken@chromium.org>
+
+        Remove [ConvertToString] from CodeGeneratorCPP.pm and rename
+        it to [ObjCImplementedAsUnsignedLong]
+        https://bugs.webkit.org/show_bug.cgi?id=78100
+
+        Reviewed by Eric Seidel.
+
+        Now [ConvertToString] is used by ObjC's HTMLElement.size only.
+        This patch removes [ConvertToString] code from CodeGeneratorCPP.pm,
+        and renames [ConvertToString] to [ObjCImplementedAsUnsignedLong].
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/CodeGeneratorCPP.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (GenerateImplementation):
+        * html/HTMLInputElement.idl: Removed FIXME comment, because the latest spec
+        says HTMLInputElement.size should be unsigned long.
+        (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-element)
+
 2012-02-08  Leo Yang  <leo.yang@torchmobile.com.cn>
 
         REGRESSION(r84194): Build fails when turning on ENABLE_FILE_SYSTEM
index e87855c..a909a57 100644 (file)
@@ -748,11 +748,6 @@ sub GenerateImplementation
                 my $argName = "new" . ucfirst($attributeName);
                 my $arg = GetCPPTypeGetter($argName, $idlType);
 
-                # The definition of ConvertToString is flipped for the setter
-                if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
-                    $arg = "WTF::String($arg).toInt()";
-                }
-
                 my $attributeType = GetCPPType($attribute->signature->type, 1);
                 push(@implContent, "void $className\:\:$setterName($attributeType $argName)\n");
                 push(@implContent, "{\n");
index 6c7eda9..5a63fc3 100644 (file)
@@ -1257,7 +1257,7 @@ sub GenerateImplementation
                     }
                 }
                 $implIncludes{"DOMPrivate.h"} = 1;
-            } elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+            } elsif ($attribute->signature->extendedAttributes->{"ObjCImplementedAsUnsignedLong"}) {
                 $getterContentHead = "WTF::String::number(" . $getterContentHead;
                 $getterContentTail .= ")";
             } elsif ($idlType eq "Date") {
@@ -1384,8 +1384,8 @@ sub GenerateImplementation
                 my $argName = "new" . ucfirst($attributeInterfaceName);
                 my $arg = GetObjCTypeGetter($argName, $idlType);
 
-                # The definition of ConvertToString is flipped for the setter
-                if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+                # The definition of ObjCImplementedAsUnsignedLong is flipped for the setter
+                if ($attribute->signature->extendedAttributes->{"ObjCImplementedAsUnsignedLong"}) {
                     $arg = "WTF::String($arg).toInt()";
                 }
 
index 2028d02..4e218b9 100644 (file)
@@ -50,10 +50,9 @@ module html {
         attribute [Reflect] boolean readOnly;
         attribute [Reflect] boolean required;
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-        attribute [ConvertToString] DOMString size; // DOM level 2 changed this to a long, but our existing API is a string
+        attribute [ObjCImplementedAsUnsignedLong] DOMString size; // DOM level 2 changed this to a long, but ObjC API is a string
 #else
-        // FIXME: The spec says this should be a long, not an unsigned long.
-        attribute unsigned long size; // Changed string -> long as part of DOM level 2
+        attribute unsigned long size; // Changed string -> long -> unsigned long
 #endif
         attribute [Reflect, URL] DOMString src;
         attribute [Reflect] DOMString step;