Diff
Modified: trunk/Source/WebCore/ChangeLog (102534 => 102535)
--- trunk/Source/WebCore/ChangeLog 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/ChangeLog 2011-12-11 06:20:32 UTC (rev 102535)
@@ -1,3 +1,26 @@
+2011-12-10 Benjamin Poulain <[email protected]>
+
+ #ifdef the parts of the Mac platform which should not be used on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=74246
+
+ Reviewed by David Kilzer.
+
+ * Configurations/WebCore.xcconfig:
+ * platform/FileSystem.cpp:
+ * platform/mac/FileSystemMac.mm:
+ * platform/mac/Language.mm:
+ (+[WebLanguageChangeObserver _webkit_languagePreferencesDidChange]):
+ (WebCore::createHTTPStyleLanguageCode):
+ (WebCore::platformDefaultLanguage):
+ * platform/mac/LocalizedStringsMac.mm:
+ (WebCore::localizedString):
+ (+[WebCoreSharedBufferData initialize]):
+ * platform/mac/WebCoreNSStringExtras.h:
+ * platform/mac/WebCoreNSStringExtras.mm:
+ * platform/mac/WebFontCache.mm:
+ * platform/mac/WebNSAttributedStringExtras.mm: The value NSAttachmentCharacter is
+ not defined in the iOS SDK so we add it here.
+
2011-12-10 Ryosuke Niwa <[email protected]>
The previous fix broke Lion release build. Fix that.
Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (102534 => 102535)
--- trunk/Source/WebCore/Configurations/WebCore.xcconfig 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig 2011-12-11 06:20:32 UTC (rev 102535)
@@ -81,7 +81,7 @@
EXCLUDED_SOURCE_FILE_NAMES_SVG_DOM_OBJC_BINDINGS_ENABLE_SVG_DOM_OBJC_BINDINGS = ;
EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(REAL_PLATFORM_NAME)) $(EXCLUDED_SOURCE_FILE_NAMES_SVG_DOM_OBJC_BINDINGS);
-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm localizedStrings.js;
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm HTMLConverter.mm MemoryPressureHandlerMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm localizedStrings.js;
EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm
Modified: trunk/Source/WebCore/platform/FileSystem.cpp (102534 => 102535)
--- trunk/Source/WebCore/platform/FileSystem.cpp 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/FileSystem.cpp 2011-12-11 06:20:32 UTC (rev 102535)
@@ -100,7 +100,7 @@
return String(buffer.data(), p - buffer.data());
}
-#if !PLATFORM(MAC)
+#if !PLATFORM(MAC) || PLATFORM(IOS)
bool canExcludeFromBackup()
{
Modified: trunk/Source/WebCore/platform/mac/FileSystemMac.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/FileSystemMac.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/FileSystemMac.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -32,7 +32,6 @@
#import "PlatformString.h"
#import <wtf/RetainPtr.h>
#import <wtf/text/CString.h>
-#import <wtf/UnusedParam.h>
namespace WebCore {
@@ -66,6 +65,7 @@
return String::fromUTF8(temporaryFilePath.data());
}
+#if !PLATFORM(IOS)
bool canExcludeFromBackup()
{
return true;
@@ -77,5 +77,6 @@
CSBackupSetItemExcluded(pathAsURL(path).get(), TRUE, FALSE);
return true;
}
+#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/mac/Language.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/Language.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/Language.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2005, 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2010, 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -102,6 +102,7 @@
NSString *code = [[preferredLanguageCode retain] autorelease];
+#if !PLATFORM(IOS)
static bool languageChangeObserverAdded;
if (!languageChangeObserverAdded) {
[[NSDistributedNotificationCenter defaultCenter] addObserver:[WebLanguageChangeObserver self]
@@ -110,6 +111,7 @@
object:nil];
languageChangeObserverAdded = true;
}
+#endif // !PLATFORM(IOS)
return code;
Modified: trunk/Source/WebCore/platform/mac/LocalizedStringsMac.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/LocalizedStringsMac.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/LocalizedStringsMac.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -37,7 +37,11 @@
{
static NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebCore"];
+#if !PLATFORM(IOS)
+ // Can be called on a dispatch queue when initializing strings on iOS.
+ // See LoadWebLocalizedStrings and <rdar://problem/7902473>.
ASSERT(isMainThread());
+#endif
RetainPtr<CFStringRef> keyString(AdoptCF, CFStringCreateWithCStringNoCopy(NULL, key, kCFStringEncodingUTF8, kCFAllocatorNull));
NSString *notFound = @"localized string not found";
Modified: trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.h (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.h 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.h 2011-12-11 06:20:32 UTC (rev 102535)
@@ -43,7 +43,9 @@
BOOL hasCaseInsensitiveSuffix(NSString *string, NSString *suffix);
BOOL hasCaseInsensitiveSubstring(NSString *string, NSString *substring);
NSString *filenameByFixingIllegalCharacters(NSString *string);
+#if !PLATFORM(IOS)
CFStringEncoding stringEncodingForResource(Handle resource);
+#endif
#ifdef __cplusplus
}
Modified: trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -68,6 +68,8 @@
return filename;
}
+#if !PLATFORM(IOS)
+
#if COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -118,3 +120,5 @@
#if COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
+
+#endif // !PLATFORM(IOS)
Modified: trunk/Source/WebCore/platform/mac/WebFontCache.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/WebFontCache.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/WebFontCache.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -301,10 +301,12 @@
return [self internalFontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
}
+#if !PLATFORM(IOS)
+ (NSFont *)fontWithFamily:(NSString *)desiredFamily traits:(NSFontTraitMask)desiredTraits size:(float)size
{
int desiredWeight = (desiredTraits & NSBoldFontMask) ? 9 : 5;
return [self fontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
}
+#endif
@end
Modified: trunk/Source/WebCore/platform/mac/WebNSAttributedStringExtras.mm (102534 => 102535)
--- trunk/Source/WebCore/platform/mac/WebNSAttributedStringExtras.mm 2011-12-11 01:23:36 UTC (rev 102534)
+++ trunk/Source/WebCore/platform/mac/WebNSAttributedStringExtras.mm 2011-12-11 06:20:32 UTC (rev 102535)
@@ -23,8 +23,15 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebNSAttributedStringExtras.h"
+#if PLATFORM(IOS)
+enum {
+ NSAttachmentCharacter = 0xfffc /* To denote attachments. */
+};
+#endif
+
namespace WebCore {
NSAttributedString *attributedStringByStrippingAttachmentCharacters(NSAttributedString *attributedString)