Title: [175995] trunk/Source/WebCore
- Revision
- 175995
- Author
- [email protected]
- Date
- 2014-11-11 17:20:30 -0800 (Tue, 11 Nov 2014)
Log Message
Modernize $buildingForIPhone in CodeGeneratorObjC.pm
<http://webkit.org/b/138640>
Reviewed by Daniel Bates.
Mac OS X is the only platform that supports NSColor, so rename
$buildingForIPhone to $shouldUseCGColor (which is actually what
the variable represents) and define it in terms of the "macosx"
platform name.
* bindings/scripts/CodeGeneratorObjC.pm:
($buildingForIPhone): Rename to $shouldUseCGColor.
($shouldUseCGColor): False if PLATFORM_NAME is not defined,
which is the case on older Xcodes when building for Mac OS X, or
if PLATFORM_NAME is equal to "macosx". True otherwise.
(GetClassName): Switch to use new variable name.
(AddIncludesForType): Ditto.
(GenerateHeader): Remove dead code. The
$buildingForTigerOrEarlier variable was accidentally
re-introduced in r161638, but was originally removed in r127032!
(GenerateImplementation): Switch to use new variable name.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (175994 => 175995)
--- trunk/Source/WebCore/ChangeLog 2014-11-12 01:06:18 UTC (rev 175994)
+++ trunk/Source/WebCore/ChangeLog 2014-11-12 01:20:30 UTC (rev 175995)
@@ -1,3 +1,27 @@
+2014-11-11 David Kilzer <[email protected]>
+
+ Modernize $buildingForIPhone in CodeGeneratorObjC.pm
+ <http://webkit.org/b/138640>
+
+ Reviewed by Daniel Bates.
+
+ Mac OS X is the only platform that supports NSColor, so rename
+ $buildingForIPhone to $shouldUseCGColor (which is actually what
+ the variable represents) and define it in terms of the "macosx"
+ platform name.
+
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ ($buildingForIPhone): Rename to $shouldUseCGColor.
+ ($shouldUseCGColor): False if PLATFORM_NAME is not defined,
+ which is the case on older Xcodes when building for Mac OS X, or
+ if PLATFORM_NAME is equal to "macosx". True otherwise.
+ (GetClassName): Switch to use new variable name.
+ (AddIncludesForType): Ditto.
+ (GenerateHeader): Remove dead code. The
+ $buildingForTigerOrEarlier variable was accidentally
+ re-introduced in r161638, but was originally removed in r127032!
+ (GenerateImplementation): Switch to use new variable name.
+
2014-11-11 Tim Horton <[email protected]>
Add support for mailto: link action menus
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (175994 => 175995)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2014-11-12 01:06:18 UTC (rev 175994)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2014-11-12 01:20:30 UTC (rev 175995)
@@ -104,7 +104,7 @@
"NodeIterator" => 1, "TreeWalker" => 1, "AbstractView" => 1, "Blob" => 1);
# Constants
-my $buildingForIPhone = defined $ENV{PLATFORM_NAME} && ($ENV{PLATFORM_NAME} eq "iphoneos" or $ENV{PLATFORM_NAME} eq "iphonesimulator");
+my $shouldUseCGColor = defined $ENV{PLATFORM_NAME} && $ENV{PLATFORM_NAME} ne "macosx";
my $nullableInit = "bool isNull = false;";
my $exceptionInit = "WebCore::ExceptionCode ec = 0;";
my $jsContextSetter = "WebCore::JSMainThreadNullState state;";
@@ -392,7 +392,7 @@
# special cases
return "NSString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue";
- return "CGColorRef" if $name eq "Color" and $buildingForIPhone;
+ return "CGColorRef" if $name eq "Color" and $shouldUseCGColor;
return "NS$name" if IsNativeObjCType($name);
return "BOOL" if $name eq "boolean";
return "unsigned char" if $name eq "octet";
@@ -659,7 +659,7 @@
if (IsNativeObjCType($type)) {
if ($type eq "Color") {
- if ($buildingForIPhone) {
+ if ($shouldUseCGColor) {
$implIncludes{"ColorSpace.h"} = 1;
} else {
$implIncludes{"ColorMac.h"} = 1;
@@ -863,7 +863,7 @@
my $publicInterfaceKey = $property . ";";
# FIXME: This only works for the getter, but not the setter. Need to refactor this code.
- if ($buildingForTigerOrEarlier && !$buildingForIPhone || IsCoreFoundationType($attributeType)) {
+ if (IsCoreFoundationType($attributeType)) {
$publicInterfaceKey = "- (" . $attributeType . ")" . $attributeName . ";";
}
@@ -1329,7 +1329,7 @@
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
} elsif ($idlType eq "Color") {
- if ($buildingForIPhone) {
+ if ($shouldUseCGColor) {
$getterContentHead = "WebCore::cachedCGColor($getterContentHead";
$getterContentTail .= ", WebCore::ColorSpaceDeviceRGB)";
} else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes