2009-07-14 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jul 2009 05:58:27 +0000 (05:58 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jul 2009 05:58:27 +0000 (05:58 +0000)
        Try to fix Windows build.

        * bindings/scripts/CodeGeneratorCOM.pm: Add Reflect and ReflectURL support.

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

WebCore/ChangeLog
WebCore/bindings/scripts/CodeGeneratorCOM.pm

index 224d28f..aec3b7d 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-14  Darin Adler  <darin@apple.com>
+
+        Try to fix Windows build.
+
+        * bindings/scripts/CodeGeneratorCOM.pm: Add Reflect and ReflectURL support.
+
 2009-07-14  Pierre d'Herbemont  <pdherbemont@apple.com>
 
         Reviewed by Oliver Hunt.
index 7e80a17..6641305 100644 (file)
@@ -596,9 +596,15 @@ sub GenerateCPPAttribute
 
         # FIXME: CHECK EXCEPTION AND DO SOMETHING WITH IT
 
-        my $setterCall = "    impl${implementationClassWithoutNamespace}()->${setterName}(" . join(", ", @setterParams) . ");\n";
-
-        push(@setterImplementation, $setterCall);
+        my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
+        my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
+        if ($reflect || $reflectURL) {
+            $CPPImplementationWebCoreIncludes{"HTMLNames.h"} = 1;
+            my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
+            push(@setterImplementation, "    impl${implementationClassWithoutNamespace}()->setAttribute(WebCore::HTMLNames::${contentAttributeName}Attr, " . join(", ", @setterParams) . ");\n");
+        } else {
+            push(@setterImplementation, "    impl${implementationClassWithoutNamespace}()->${setterName}(" . join(", ", @setterParams) . ");\n");
+        }
         push(@setterImplementation, "    return S_OK;\n");
         push(@setterImplementation, "}\n\n");
 
@@ -611,7 +617,17 @@ sub GenerateCPPAttribute
     push(@getterImplementation, "    if (!result)\n");
     push(@getterImplementation, "        return E_POINTER;\n\n");
 
-    my $implementationGetter = "impl${implementationClassWithoutNamespace}()->" . $codeGenerator->WK_lcfirst($attributeName) . "(" . ($hasGetterException ? "ec" : ""). ")";
+    my $implementationGetter;
+    my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
+    my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
+    if ($reflect || $reflectURL) {
+        $implIncludes{"HTMLNames.h"} = 1;
+        my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
+        my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
+        $implementationGetter = "impl${implementationClassWithoutNamespace}()->${getAttributeFunctionName}(WebCore::HTMLNames::${contentAttributeName}Attr)";
+    } else {
+        $implementationGetter = "impl${implementationClassWithoutNamespace}()->" . $codeGenerator->WK_lcfirst($attributeName) . "(" . ($hasGetterException ? "ec" : ""). ")";
+    }
 
     push(@getterImplementation, "    WebCore::ExceptionCode ec = 0;\n") if $hasGetterException;