Title: [115442] trunk/Source/WebCore
Revision
115442
Author
[email protected]
Date
2012-04-27 09:35:38 -0700 (Fri, 27 Apr 2012)

Log Message

[Gtk][DOM Bindings] Feature-protected properties are put under condition guards
https://bugs.webkit.org/show_bug.cgi?id=85068

Reviewed by Martin Robinson.

Generated feature-dependent properties are now present regardless of that
feature being enabled. On getting or setting that property's value a warning
is thrown if the feature is not enabled. Additionally, if the generated
interface is feature-dependant, when getting or setting any property's value
a warning is thrown if the feature is not enabled.

No new tests - covered by existing bindings tests.

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateProperty):
(GenerateProperties):
* bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Rebaseline.
(webkit_dom_test_interface_set_property):
(webkit_dom_test_interface_get_property):
(webkit_dom_test_interface_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Ditto.
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp: Ditto.
(webkit_dom_test_serialized_script_value_interface_get_property):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115441 => 115442)


--- trunk/Source/WebCore/ChangeLog	2012-04-27 16:34:33 UTC (rev 115441)
+++ trunk/Source/WebCore/ChangeLog	2012-04-27 16:35:38 UTC (rev 115442)
@@ -1,5 +1,34 @@
 2012-04-27  Zan Dobersek  <[email protected]>
 
+        [Gtk][DOM Bindings] Feature-protected properties are put under condition guards
+        https://bugs.webkit.org/show_bug.cgi?id=85068
+
+        Reviewed by Martin Robinson.
+
+        Generated feature-dependent properties are now present regardless of that
+        feature being enabled. On getting or setting that property's value a warning
+        is thrown if the feature is not enabled. Additionally, if the generated
+        interface is feature-dependant, when getting or setting any property's value
+        a warning is thrown if the feature is not enabled.
+
+        No new tests - covered by existing bindings tests.
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (GenerateProperty):
+        (GenerateProperties):
+        * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Rebaseline.
+        (webkit_dom_test_interface_set_property):
+        (webkit_dom_test_interface_get_property):
+        (webkit_dom_test_interface_class_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Ditto.
+        (webkit_dom_test_obj_set_property):
+        (webkit_dom_test_obj_get_property):
+        (webkit_dom_test_obj_class_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp: Ditto.
+        (webkit_dom_test_serialized_script_value_interface_get_property):
+
+2012-04-27  Zan Dobersek  <[email protected]>
+
         [Gtk][DOM Bindings] Conditional string in implementation file generated in wrong place after 113450
         https://bugs.webkit.org/show_bug.cgi?id=85065
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (115441 => 115442)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2012-04-27 16:34:33 UTC (rev 115441)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2012-04-27 16:35:38 UTC (rev 115442)
@@ -346,6 +346,11 @@
 sub GenerateConditionalWarning
 {
     my $node = shift;
+    my $indentSize = shift;
+    if (!$indentSize) {
+        $indentSize = 4;
+    }
+
     my $conditional = $node->extendedAttributes->{"Conditional"};
     my @warn;
 
@@ -354,15 +359,15 @@
             my @splitConditionals = split(/&/, $conditional);
             foreach $condition (@splitConditionals) {
                 push(@warn, "#if !ENABLE($condition)\n");
-                push(@warn, "    WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n");
+                push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n");
                 push(@warn, "#endif\n");
             }
         } elsif ($conditional =~ /\|/) {
             foreach $condition (split(/\|/, $conditional)) {
-                push(@warn, "    WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n");
+                push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($condition) . "\")\n");
             }
         } else {
-            push(@warn, "    WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($conditional) . "\")\n");
+            push(@warn, ' ' x $indentSize . "WEBKIT_WARN_FEATURE_NOT_PRESENT(\"" . HumanReadableConditional($conditional) . "\")\n");
         }
     }
 
@@ -373,8 +378,12 @@
     my $attribute = shift;
     my $interfaceName = shift;
     my @writeableProperties = @{shift @_};
+    my $parentNode = shift;
 
     my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
+    my @conditionalWarn = GenerateConditionalWarning($attribute->signature, 8);
+    my $parentConditionalString = $codeGenerator->GenerateConditionalString($parentNode);
+    my @parentConditionalWarn = GenerateConditionalWarning($parentNode, 8);
     my $camelPropName = $attribute->signature->name;
     my $setPropNameFunction = $codeGenerator->WK_ucfirst($camelPropName);
     my $getPropNameFunction = $codeGenerator->WK_lcfirst($camelPropName);
@@ -383,9 +392,7 @@
     my $propNameCaps = uc($propName);
     $propName =~ s/_/-/g;
     my ${propEnum} = "PROP_${propNameCaps}";
-    push(@cBodyProperties, "#if ${conditionalString}\n") if $conditionalString;
     push(@cBodyProperties, "    ${propEnum},\n");
-    push(@cBodyProperties, "#endif /* ${conditionalString} */\n") if $conditionalString;
 
     my $propType = $attribute->signature->type;
     my ${propGType} = decamelize($propType);
@@ -434,16 +441,23 @@
     push(@setterArguments, "ec") if @{$attribute->setterExceptions};
 
     if (grep {$_ eq $attribute} @writeableProperties) {
+        push(@txtSetProps, "    case ${propEnum}: {\n");
+        push(@txtSetProps, "#if ${parentConditionalString}\n") if $parentConditionalString;
         push(@txtSetProps, "#if ${conditionalString}\n") if $conditionalString;
-        push(@txtSetProps, "    case ${propEnum}: {\n");
         push(@txtSetProps, "        WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
         push(@txtSetProps, "        ${setterFunctionName}(" . join(", ", @setterArguments) . ");\n");
+        push(@txtSetProps, "#else\n") if $conditionalString;
+        push(@txtSetProps, @conditionalWarn) if scalar(@conditionalWarn);
+        push(@txtSetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
+        push(@txtSetProps, "#else\n") if $parentConditionalString;
+        push(@txtSetProps, @parentConditionalWarn) if scalar(@parentConditionalWarn);
+        push(@txtSetProps, "#endif /* ${parentConditionalString} */\n") if $parentConditionalString;
         push(@txtSetProps, "        break;\n    }\n");
-        push(@txtSetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
     }
 
+    push(@txtGetProps, "    case ${propEnum}: {\n");
+    push(@txtGetProps, "#if ${parentConditionalString}\n") if $parentConditionalString;
     push(@txtGetProps, "#if ${conditionalString}\n") if $conditionalString;
-    push(@txtGetProps, "    case ${propEnum}: {\n");
     push(@txtGetProps, "        WebCore::ExceptionCode ec = 0;\n") if @{$attribute->getterExceptions};
 
     my $postConvertFunction = "";
@@ -473,8 +487,13 @@
         }
     }
 
+    push(@txtGetProps, "#else\n") if $conditionalString;
+    push(@txtGetProps, @conditionalWarn) if scalar(@conditionalWarn);
+    push(@txtGetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
+    push(@txtGetProps, "#else\n") if $parentConditionalString;
+    push(@txtGetProps, @parentConditionalWarn) if scalar(@parentConditionalWarn);
+    push(@txtGetProps, "#endif /* ${parentConditionalString} */\n") if $parentConditionalString;
     push(@txtGetProps, "        break;\n    }\n");
-    push(@txtGetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
 
     my %param_spec_options = ("int", "G_MININT, /* min */\nG_MAXINT, /* max */\n0, /* default */",
                               "boolean", "FALSE, /* default */",
@@ -500,9 +519,7 @@
                                                            $param_spec_options{$gtype}
                                                            ${gparamflag}));
 EOF
-    push(@txtInstallProps, "#if ${conditionalString}\n") if $conditionalString;
     push(@txtInstallProps, $txtInstallProp);
-    push(@txtInstallProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
 }
 
 sub GenerateProperties {
@@ -577,7 +594,7 @@
     foreach my $attribute (@readableProperties) {
         if ($attribute->signature->type ne "EventListener" &&
             $attribute->signature->type ne "MediaQueryListListener") {
-            GenerateProperty($attribute, $interfaceName, \@writeableProperties);
+            GenerateProperty($attribute, $interfaceName, \@writeableProperties, $dataNode);
         }
     }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp (115441 => 115442)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp	2012-04-27 16:34:33 UTC (rev 115441)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp	2012-04-27 16:35:38 UTC (rev 115442)
@@ -85,15 +85,9 @@
 
 enum {
     PROP_0,
-#if ENABLE(Condition11) || ENABLE(Condition12)
     PROP_SUPPLEMENTAL_STR1,
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
-#if ENABLE(Condition11) || ENABLE(Condition12)
     PROP_SUPPLEMENTAL_STR2,
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
-#if ENABLE(Condition11) || ENABLE(Condition12)
     PROP_SUPPLEMENTAL_NODE,
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
 };
 
 static void webkit_dom_test_interface_finalize(GObject* object)
@@ -120,12 +114,20 @@
     WebKitDOMTestInterface* self = WEBKIT_DOM_TEST_INTERFACE(object);
     WebCore::TestInterface* coreSelf = WebKit::core(self);
     switch (propertyId) {
+    case PROP_SUPPLEMENTAL_STR2: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    case PROP_SUPPLEMENTAL_STR2: {
         WebCore::TestSupplemental::setSupplementalStr2(coreSelf, WTF::String::fromUTF8(g_value_get_string(value)));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition11")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition12")
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
         break;
@@ -139,25 +141,49 @@
     WebKitDOMTestInterface* self = WEBKIT_DOM_TEST_INTERFACE(object);
     WebCore::TestInterface* coreSelf = WebKit::core(self);
     switch (propertyId) {
+    case PROP_SUPPLEMENTAL_STR1: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    case PROP_SUPPLEMENTAL_STR1: {
         g_value_take_string(value, convertToUTF8String(WebCore::TestSupplemental::supplementalStr1(coreSelf)));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition11")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition12")
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+    case PROP_SUPPLEMENTAL_STR2: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    case PROP_SUPPLEMENTAL_STR2: {
         g_value_take_string(value, convertToUTF8String(WebCore::TestSupplemental::supplementalStr2(coreSelf)));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition11")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition12")
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+    case PROP_SUPPLEMENTAL_NODE: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    case PROP_SUPPLEMENTAL_NODE: {
         RefPtr<WebCore::Node> ptr = WebCore::TestSupplemental::supplementalNode(coreSelf);
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition11")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition12")
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
         break;
@@ -180,7 +206,6 @@
     gobjectClass->get_property = webkit_dom_test_interface_get_property;
     gobjectClass->constructed = webkit_dom_test_interface_constructed;
 
-#if ENABLE(Condition11) || ENABLE(Condition12)
     g_object_class_install_property(gobjectClass,
                                     PROP_SUPPLEMENTAL_STR1,
                                     g_param_spec_string("supplemental-str1", /* name */
@@ -188,8 +213,6 @@
                                                            "read-only  gchar* TestInterface.supplemental-str1", /* longer - could do with some extra doc stuff here */
                                                            "", /* default */
                                                            WEBKIT_PARAM_READABLE));
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
-#if ENABLE(Condition11) || ENABLE(Condition12)
     g_object_class_install_property(gobjectClass,
                                     PROP_SUPPLEMENTAL_STR2,
                                     g_param_spec_string("supplemental-str2", /* name */
@@ -197,8 +220,6 @@
                                                            "read-write  gchar* TestInterface.supplemental-str2", /* longer - could do with some extra doc stuff here */
                                                            "", /* default */
                                                            WEBKIT_PARAM_READWRITE));
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
-#if ENABLE(Condition11) || ENABLE(Condition12)
     g_object_class_install_property(gobjectClass,
                                     PROP_SUPPLEMENTAL_NODE,
                                     g_param_spec_object("supplemental-node", /* name */
@@ -206,7 +227,6 @@
                                                            "read-write  WebKitDOMNode* TestInterface.supplemental-node", /* longer - could do with some extra doc stuff here */
                                                            WEBKIT_TYPE_DOM_NODE, /* gobject type */
                                                            WEBKIT_PARAM_READWRITE));
-#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
 
 
 }

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (115441 => 115442)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2012-04-27 16:34:33 UTC (rev 115441)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2012-04-27 16:35:38 UTC (rev 115442)
@@ -133,15 +133,9 @@
     PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_ATTRIBUTE_RAISES,
     PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_WITH_SPACES_ATTRIBUTE,
     PROP_WITH_SCRIPT_ARGUMENTS_AND_CALL_STACK_ATTRIBUTE,
-#if ENABLE(Condition1)
     PROP_CONDITIONAL_ATTR1,
-#endif /* ENABLE(Condition1) */
-#if ENABLE(Condition1) && ENABLE(Condition2)
     PROP_CONDITIONAL_ATTR2,
-#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
-#if ENABLE(Condition1) || ENABLE(Condition2)
     PROP_CONDITIONAL_ATTR3,
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
     PROP_CONTENT_DOCUMENT,
     PROP_MUTABLE_POINT,
     PROP_IMMUTABLE_POINT,
@@ -256,24 +250,36 @@
         coreSelf->setWithScriptStateAttribute((g_value_get_long(value)));
         break;
     }
+    case PROP_CONDITIONAL_ATTR1: {
 #if ENABLE(Condition1)
-    case PROP_CONDITIONAL_ATTR1: {
         coreSelf->setConditionalAttr1((g_value_get_long(value)));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+#endif /* ENABLE(Condition1) */
         break;
     }
-#endif /* ENABLE(Condition1) */
+    case PROP_CONDITIONAL_ATTR2: {
 #if ENABLE(Condition1) && ENABLE(Condition2)
-    case PROP_CONDITIONAL_ATTR2: {
         coreSelf->setConditionalAttr2((g_value_get_long(value)));
+#else
+#if !ENABLE(Condition1)
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+#endif
+#if !ENABLE(Condition2)
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+    case PROP_CONDITIONAL_ATTR3: {
 #if ENABLE(Condition1) || ENABLE(Condition2)
-    case PROP_CONDITIONAL_ATTR3: {
         coreSelf->setConditionalAttr3((g_value_get_long(value)));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
     case PROP_STRICT_FLOAT: {
         coreSelf->setStrictFloat((g_value_get_float(value)));
         break;
@@ -442,24 +448,36 @@
         g_value_set_object(value, WebKit::kit(ptr.get()));
         break;
     }
+    case PROP_CONDITIONAL_ATTR1: {
 #if ENABLE(Condition1)
-    case PROP_CONDITIONAL_ATTR1: {
         g_value_set_long(value, coreSelf->conditionalAttr1());
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+#endif /* ENABLE(Condition1) */
         break;
     }
-#endif /* ENABLE(Condition1) */
+    case PROP_CONDITIONAL_ATTR2: {
 #if ENABLE(Condition1) && ENABLE(Condition2)
-    case PROP_CONDITIONAL_ATTR2: {
         g_value_set_long(value, coreSelf->conditionalAttr2());
+#else
+#if !ENABLE(Condition1)
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+#endif
+#if !ENABLE(Condition2)
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+    case PROP_CONDITIONAL_ATTR3: {
 #if ENABLE(Condition1) || ENABLE(Condition2)
-    case PROP_CONDITIONAL_ATTR3: {
         g_value_set_long(value, coreSelf->conditionalAttr3());
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
     case PROP_CONTENT_DOCUMENT: {
         RefPtr<WebCore::Document> ptr = coreSelf->contentDocument();
         g_value_set_object(value, WebKit::kit(ptr.get()));
@@ -772,7 +790,6 @@
                                                            "read-write  WebKitDOMTestObj* TestObj.with-script-arguments-and-call-stack-attribute", /* longer - could do with some extra doc stuff here */
                                                            WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
                                                            WEBKIT_PARAM_READWRITE));
-#if ENABLE(Condition1)
     g_object_class_install_property(gobjectClass,
                                     PROP_CONDITIONAL_ATTR1,
                                     g_param_spec_long("conditional-attr1", /* name */
@@ -782,8 +799,6 @@
 G_MAXLONG, /* max */
 0, /* default */
                                                            WEBKIT_PARAM_READWRITE));
-#endif /* ENABLE(Condition1) */
-#if ENABLE(Condition1) && ENABLE(Condition2)
     g_object_class_install_property(gobjectClass,
                                     PROP_CONDITIONAL_ATTR2,
                                     g_param_spec_long("conditional-attr2", /* name */
@@ -793,8 +808,6 @@
 G_MAXLONG, /* max */
 0, /* default */
                                                            WEBKIT_PARAM_READWRITE));
-#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
-#if ENABLE(Condition1) || ENABLE(Condition2)
     g_object_class_install_property(gobjectClass,
                                     PROP_CONDITIONAL_ATTR3,
                                     g_param_spec_long("conditional-attr3", /* name */
@@ -804,7 +817,6 @@
 G_MAXLONG, /* max */
 0, /* default */
                                                            WEBKIT_PARAM_READWRITE));
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
     g_object_class_install_property(gobjectClass,
                                     PROP_CONTENT_DOCUMENT,
                                     g_param_spec_object("content-document", /* name */

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp (115441 => 115442)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp	2012-04-27 16:34:33 UTC (rev 115441)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp	2012-04-27 16:35:38 UTC (rev 115442)
@@ -129,28 +129,53 @@
     WebCore::TestSerializedScriptValueInterface* coreSelf = WebKit::core(self);
     switch (propertyId) {
     case PROP_VALUE: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->value();
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
     case PROP_READONLY_VALUE: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->readonlyValue();
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
     case PROP_CACHED_VALUE: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->cachedValue();
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
     case PROP_PORTS: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::MessagePortArray> ptr = coreSelf->ports();
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
     case PROP_CACHED_READONLY_VALUE: {
+#if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->cachedReadonlyValue();
         g_value_set_object(value, WebKit::kit(ptr.get()));
+#else
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
+        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
     default:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to