summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom/make_names.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/make_names.pl')
-rwxr-xr-xSource/WebCore/dom/make_names.pl59
1 files changed, 56 insertions, 3 deletions
diff --git a/Source/WebCore/dom/make_names.pl b/Source/WebCore/dom/make_names.pl
index 836137e..674831c 100755
--- a/Source/WebCore/dom/make_names.pl
+++ b/Source/WebCore/dom/make_names.pl
@@ -3,6 +3,7 @@
# Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
# Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org>
# Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+# Copyright (C) 2011 Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -65,7 +66,7 @@ if ($ENV{CC}) {
} else {
$gccLocation = "/usr/bin/gcc";
}
-my $preprocessor = $gccLocation . " -E -P -x c++";
+my $preprocessor = $gccLocation . " -E -x c++";
GetOptions(
'tags=s' => \$tagsFile,
@@ -596,6 +597,10 @@ sub printJSElementIncludes
for my $tagName (sort keys %enabledTags) {
my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};
next if defined($tagsSeen{$JSInterfaceName}) || usesDefaultJSWrapper($tagName);
+ if ($enabledTags{$tagName}{conditional}) {
+ # We skip feature-define-specific #includes here since we handle them separately.
+ next;
+ }
$tagsSeen{$JSInterfaceName} = 1;
print F "#include \"${wrapperFactoryType}${JSInterfaceName}.h\"\n";
@@ -610,12 +615,54 @@ sub printElementIncludes
for my $tagName (sort keys %enabledTags) {
my $interfaceName = $enabledTags{$tagName}{interfaceName};
next if defined($tagsSeen{$interfaceName});
+ if ($enabledTags{$tagName}{conditional}) {
+ # We skip feature-define-specific #includes here since we handle them separately.
+ next;
+ }
$tagsSeen{$interfaceName} = 1;
print F "#include \"${interfaceName}.h\"\n";
}
}
+sub printConditionalElementIncludes
+{
+ my ($F, $wrapperFactoryType) = @_;
+
+ my %conditionals;
+ my %unconditionalElementIncludes;
+ my %unconditionalJSElementIncludes;
+
+ for my $tagName (keys %enabledTags) {
+ my $conditional = $enabledTags{$tagName}{conditional};
+ my $interfaceName = $enabledTags{$tagName}{interfaceName};
+ my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};
+
+ if ($conditional) {
+ $conditionals{$conditional}{interfaceNames}{$interfaceName} = 1;
+ $conditionals{$conditional}{JSInterfaceNames}{$JSInterfaceName} = 1;
+ } else {
+ $unconditionalElementIncludes{$interfaceName} = 1;
+ $unconditionalJSElementIncludes{$JSInterfaceName} = 1;
+ }
+ }
+
+ for my $conditional (sort keys %conditionals) {
+ print F "\n#if ENABLE($conditional)\n";
+ for my $interfaceName (sort keys %{$conditionals{$conditional}{interfaceNames}}) {
+ next if $unconditionalElementIncludes{$interfaceName};
+ print F "#include \"$interfaceName.h\"\n";
+ }
+ if ($wrapperFactoryType) {
+ for my $JSInterfaceName (sort keys %{$conditionals{$conditional}{JSInterfaceNames}}) {
+ next if $unconditionalJSElementIncludes{$JSInterfaceName};
+ print F "#include \"$wrapperFactoryType$JSInterfaceName.h\"\n";
+ }
+ }
+ print F "#endif\n";
+ }
+}
+
sub printDefinitions
{
my ($F, $namesRef, $type, $namespaceURI) = @_;
@@ -661,8 +708,11 @@ END
printElementIncludes($F);
+print F "\n#include <wtf/HashMap.h>\n";
+
+printConditionalElementIncludes($F);
+
print F <<END
-#include <wtf/HashMap.h>
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(VIDEO)
#include "Document.h"
@@ -922,8 +972,11 @@ sub printWrapperFactoryCppFile
printElementIncludes($F);
+ print F "\n#include <wtf/StdLibExtras.h>\n";
+
+ printConditionalElementIncludes($F, $wrapperFactoryType);
+
print F <<END
-#include <wtf/StdLibExtras.h>
#if ENABLE(VIDEO)
#include "Document.h"