summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
commitaa9cf406d62004519ad54596e1c391f9a6439210 (patch)
treedd562b9c296981f2761b76623911be8496c7af84 /src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm
parent987aec28b950e1c9817a20a9dd71afc071cd93ea (diff)
parent56b6a5924008ab5cdbae36e9662eddba923acd5e (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm')
-rw-r--r--src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm
index 7e80a17a6..6641305a3 100644
--- a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm
+++ b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorCOM.pm
@@ -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;