#if OS(DARWIN)
// When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed
// to use a unique JSGlobalData, we use a shared one for compatibility.
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
if (NSVersionOfLinkTimeLibrary("JavaScriptCore") <= webkitFirstVersionWithConcurrentGlobalContexts) {
#else
{
#endif
// Use a background thread to periodically scavenge memory to release back to the system
-// https://bugs.webkit.org/show_bug.cgi?id=27900: don't turn this on for Tiger until we have figured out why it caused a crash.
-#if defined(BUILDING_ON_TIGER)
-#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 0
-#else
#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 1
-#endif
#ifndef NDEBUG
namespace WTF {
malloc_introspection_t jscore_fastmalloc_introspection = { &FastMallocZone::enumerate, &FastMallocZone::goodSize, &FastMallocZone::check, &FastMallocZone::print,
&FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
, 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher.
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
, 0, 0, 0, 0 // These members will not be used unless the zone advertises itself as version seven or higher.
#endif
int flags = MAP_PRIVATE | MAP_ANON;
-#if OS(DARWIN) && !defined(BUILDING_ON_TIGER)
+#if OS(DARWIN)
int fd = usage;
-#else
- int fd = -1;
#endif
void* result = 0;
/* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */
#include <AvailabilityMacros.h>
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
#define BUILDING_ON_LEOPARD 1
#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
#define BUILDING_ON_SNOW_LEOPARD 1
#endif
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
-#define TARGETING_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
#define TARGETING_LEOPARD 1
#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
#define TARGETING_SNOW_LEOPARD 1
#endif
#if PLATFORM(MAC) && !PLATFORM(IOS)
-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && CPU(X86_64)
+#ifndef BUILDING_ON_LEOPARD
#define WTF_USE_PLUGIN_HOST_PROCESS 1
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#define ENABLE_GESTURE_EVENTS 1
#define ENABLE_RUBBER_BANDING 1
#define WTF_USE_WK_SCROLLBAR_PAINTER 1
#define WTF_USE_CF 1
#endif
-#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) && !PLATFORM(GTK) && !PLATFORM(QT)
+#if OS(DARWIN) && !PLATFORM(GTK) && !PLATFORM(QT)
#define ENABLE_PURGEABLE_MEMORY 1
#endif
#define ENABLE_GLOBAL_FASTMALLOC_NEW 0
#if OS(DARWIN)
#define WTF_USE_CF 1
-#ifndef BUILDING_ON_TIGER
#define WTF_USE_CORE_TEXT 1
#define ENABLE_WEB_ARCHIVE 1
-#else
-#define WTF_USE_ATSUI 1
-#endif
#endif
#endif
#define HAVE_SYS_TIMEB_H 1
#define WTF_USE_ACCELERATE 1
-#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
+#ifndef TARGETING_LEOPARD
#define HAVE_DISPATCH_H 1
#define HAVE_HOSTED_CORE_ANIMATION 1
#if PLATFORM(MAC)
/* Complex text framework */
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
#define WTF_USE_ATSUI 0
#define WTF_USE_CORE_TEXT 1
#else
#endif
/* Accelerated compositing */
-#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO))
+#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO))
#define WTF_USE_ACCELERATED_COMPOSITING 1
#endif
-#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS)
+#if (PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS)
#define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#define WTF_USE_AVFOUNDATION 1
#endif
#include <mach/vm_statistics.h>
-#if !defined(TARGETING_TIGER)
-
#if defined(VM_MEMORY_TCMALLOC)
#define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(VM_MEMORY_TCMALLOC)
#else
#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65)
#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
-#else // !defined(TARGETING_TIGER)
-
-// mmap on Tiger fails with tags that work on Leopard, so fall
-// back to Tiger-compatible tags (that also work on Leopard)
-// when targeting Tiger.
-#define VM_TAG_FOR_TCMALLOC_MEMORY -1
-#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1
-#define VM_TAG_FOR_REGISTERFILE_MEMORY -1
-
-#endif // !defined(TARGETING_TIGER)
-
-// Tags for vm_map and vm_allocate work on both Tiger and Leopard.
-
#if defined(VM_MEMORY_JAVASCRIPT_CORE)
#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE)
#else
void initializeMainThreadPlatform()
{
-#if !defined(BUILDING_ON_TIGER)
ASSERT(!staticMainThreadCaller);
staticMainThreadCaller = [[WTFMainThreadCaller alloc] init];
mainThreadEstablishedAsPthreadMain = false;
mainThreadPthread = pthread_self();
mainThreadNSThread = [[NSThread currentThread] retain];
-#else
- ASSERT_NOT_REACHED();
-#endif
}
void initializeMainThreadToProcessMainThreadPlatform()
return;
}
-#if !defined(BUILDING_ON_TIGER)
ASSERT(mainThreadNSThread);
[staticMainThreadCaller performSelector:@selector(call) onThread:mainThreadNSThread withObject:nil waitUntilDone:NO];
-#else
- ASSERT_NOT_REACHED();
-#endif
}
bool isMainThread()
return pthread_main_np();
}
-#if !defined(BUILDING_ON_TIGER)
ASSERT(mainThreadPthread);
return pthread_equal(pthread_self(), mainThreadPthread);
-#else
- ASSERT_NOT_REACHED();
- return false;
-#endif
}
} // namespace WTF
{
#if OS(DARWIN) && USE(CF)
// Mac OS X doesn't set UNIX locale to match user-selected one, so ICU default doesn't work.
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !OS(IOS)
+#if !defined(BUILDING_ON_LEOPARD) && !OS(IOS)
RetainPtr<CFLocaleRef> currentLocale(AdoptCF, CFLocaleCopyCurrent());
CFStringRef collationOrder = (CFStringRef)CFLocaleGetValue(currentLocale.get(), kCFLocaleCollatorIdentifier);
#else
__ZN7WebCore20LogNotYetImplementedE
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
_wkContentAreaDidHide
_wkContentAreaDidShow
_wkContentAreaResized
.objc_class_name_DOMSVGForeignObjectElement
#endif
-#if defined(BUILDING_ON_TIGER)
-_wkClearGlyphVector
-_wkConvertCharToGlyphs
-_wkCopyFullFontName
-_wkGetATSStyleGroup
-_wkGetCGFontFromNSFont
-_wkGetFontMetrics
-_wkGetGlyphVectorFirstRecord
-_wkGetGlyphVectorNumGlyphs
-_wkGetGlyphVectorRecordSize
-_wkGetNSFontATSUFontId
-_wkInitializeGlyphVector
-_wkReleaseStyleGroup
-_wkSupportsMultipartXMixedReplace
-#endif
#if ENABLE(VIDEO)
__ZN7WebCore16HTMLMediaElement12endScrubbingEv
__ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
__ZN7WebCore6Editor13lowercaseWordEv
__ZN7WebCore6Editor13uppercaseWordEv
__ZN7WebCore6Editor14capitalizeWordEv
#ifndef AccessibilityList_h
#define AccessibilityList_h
-#if PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD))
+#if PLATFORM(MAC) && defined(BUILDING_ON_LEOPARD)
#define ACCESSIBILITY_LISTS 0
#else
#define ACCESSIBILITY_LISTS 1
#include "AccessibilityRenderObject.h"
#include <wtf/Forward.h>
-#if PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD))
+#if PLATFORM(MAC) && defined(BUILDING_ON_LEOPARD)
#define ACCESSIBILITY_TABLES 0
#else
#define ACCESSIBILITY_TABLES 1
macNotification = NSAccessibilityFocusedUIElementChangedNotification;
break;
case AXAutocorrectionOccured:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
macNotification = @"AXAutocorrectionOccurred";
break;
#else
case AXRowCountChanged:
macNotification = NSAccessibilityRowCountChangedNotification;
break;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
case AXRowExpanded:
macNotification = NSAccessibilityRowExpandedNotification;
break;
#define NSAccessibilityPlaceholderValueAttribute @"AXPlaceholderValue"
#endif
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#define NSAccessibilityValueDescriptionAttribute @"AXValueDescription"
-#define NSAccessibilityTimelineSubrole @"AXTimeline"
-#endif
@interface NSObject (WebKitAccessibilityArrayCategory)
{ RulerRole, NSAccessibilityRulerRole },
{ RulerMarkerRole, NSAccessibilityRulerMarkerRole },
{ LinkRole, NSAccessibilityLinkRole },
-#ifndef BUILDING_ON_TIGER
{ DisclosureTriangleRole, NSAccessibilityDisclosureTriangleRole },
{ GridRole, NSAccessibilityGridRole },
-#endif
{ WebCoreLinkRole, NSAccessibilityLinkRole },
{ ImageMapLinkRole, NSAccessibilityLinkRole },
{ ImageMapRole, @"AXImageMap" },
@end
-#ifdef BUILDING_ON_TIGER
-@implementation DOMHTMLDocument (DOMHTMLDocumentOverrides)
-
-- (DOMNode *)firstChild
-{
- WebCore::HTMLDocument* coreHTMLDocument = core(self);
- if (!coreHTMLDocument->page() || !coreHTMLDocument->page()->settings()->needsTigerMailQuirks())
- return kit(coreHTMLDocument->firstChild());
-
- WebCore::Node* child = coreHTMLDocument->firstChild();
- while (child && child->nodeType() == WebCore::Node::DOCUMENT_TYPE_NODE)
- child = child->nextSibling();
-
- return kit(child);
-}
-
-@end
-#endif
@implementation DOMHTMLInputElement (FormAutoFillTransition)
NSMapTable* createWrapperCache()
{
-#ifdef BUILDING_ON_TIGER
- return NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 0);
-#else
// NSMapTable with zeroing weak pointers is the recommended way to build caches like this under garbage collection.
NSPointerFunctionsOptions keyOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality;
NSPointerFunctionsOptions valueOptions = NSPointerFunctionsZeroingWeakMemory | NSPointerFunctionsObjectPersonality;
return [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0];
-#endif
}
NSObject* getDOMWrapper(DOMObjectInternal* impl)
@end
@interface DOMObject (DOMLinkStyle)
-#ifndef BUILDING_ON_TIGER
@property(readonly, retain) DOMStyleSheet *sheet;
-#else
-- (DOMStyleSheet *)sheet;
-#endif
@end
#endif
#import <runtime/Completion.h>
#import <wtf/Threading.h>
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#endif
using namespace JSC;
using namespace JSC::Bindings;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
+ (id)scriptObjectForJSObject:(JSObjectRef)jsObject originRootObject:(RootObject*)originRootObject rootObject:(RootObject*)rootObject
// This is a deprecated code path which should not be required on Android.
// Remove this guard once Bug 39476 is fixed.
-#if PLATFORM(ANDROID) || defined(BUILDING_ON_TIGER)
+#if PLATFORM(ANDROID)
if (!handled)
result = callJNIMethod(m_instance->m_instance, jMethod->returnType(), jMethod->name().utf8().data(), jMethod->signature(), jArgs.data());
#endif
static NSMapTable *createInstanceWrapperCache()
{
-#ifdef BUILDING_ON_TIGER
- return NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0);
-#else
// NSMapTable with zeroing weak pointers is the recommended way to build caches like this under garbage collection.
NSPointerFunctionsOptions keyOptions = NSPointerFunctionsZeroingWeakMemory | NSPointerFunctionsOpaquePersonality;
NSPointerFunctionsOptions valueOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality;
return [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0];
-#endif
}
RuntimeObject* ObjcInstance::newRuntimeObject(ExecState* exec)
#endif
#endif /* USE(CG) */
-#ifdef BUILDING_ON_TIGER
-#undef ENABLE_FTPDIR
-#define ENABLE_FTPDIR 0
-#endif
#if PLATFORM(WIN) && USE(CG)
#define WTF_USE_SAFARI_THEME 1
bool enforceMIMEType = strict;
bool needsSiteSpecificQuirks = parent && parent->document() && parent->document()->settings() && parent->document()->settings()->needsSiteSpecificQuirks();
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if (enforceMIMEType && needsSiteSpecificQuirks) {
// Covers both http and https, with or without "www."
if (baseURL.string().contains("mcafee.com/japan/", false))
static bool disableRangeMutation(Page* page)
{
- // This check is made on super-hot code paths, so we only want this on Tiger and Leopard.
-#if defined(TARGETING_TIGER) || defined(TARGETING_LEOPARD)
- // Disable Range mutation on document modifications in Tiger and Leopard Mail
+ // This check is made on super-hot code paths, so we only want this on Leopard.
+#ifdef TARGETING_LEOPARD
+ // Disable Range mutation on document modifications in Leopard Mail.
// See <rdar://problem/5865171>
return page && (page->settings()->needsLeopardMailQuirks() || page->settings()->needsTigerMailQuirks());
#else
return;
}
-#ifndef BUILDING_ON_TIGER
- // Post-Tiger, this menu item is a show/hide toggle, to match AppKit. Leave Tiger behavior alone
- // to match rest of OS X.
if (client()->spellingUIIsShowing()) {
client()->showSpellingUI(false);
return;
}
-#endif
advanceToNextMisspelling(true);
client()->showSpellingUI(true);
}
}
-#if !PLATFORM(MAC) || (PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)))
+#if !PLATFORM(MAC) || (PLATFORM(MAC) && (defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)))
// This only erases markers that are in the first unit (word or sentence) of the selection.
- // Perhaps peculiar, but it matches AppKit on these Mac OSX versions.
+ // Perhaps peculiar, but it matches AppKit on these Mac OS X versions.
if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange())
m_frame->document()->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling);
#endif
#ifndef SpellingCorrectionController_h
#define SpellingCorrectionController_h
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
// Some platforms provide UI for suggesting autocorrection.
#define SUPPORT_AUTOCORRECTION_PANEL 1
// Some platforms use spelling and autocorrection markers to provide visual cue.
#else
#define SUPPORT_AUTOCORRECTION_PANEL 0
#define REMOVE_MARKERS_UPON_EDITING 0
-#endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#include "DocumentMarker.h"
#include "EditCommand.h"
void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)
{
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
if (!document()->frame()->editor()->isContinuousSpellCheckingEnabled()
&& !document()->frame()->editor()->isAutomaticQuoteSubstitutionEnabled()
&& !document()->frame()->editor()->isAutomaticLinkDetectionEnabled()
{
updatePreservesTypingStyle(commandTypeForAddedTyping);
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
document()->frame()->editor()->appliedEditing(this);
// Since the spellchecking code may also perform corrections and other replacements, it should happen after the typing changes.
if (!m_shouldPreventSpellChecking)
bool choosePlainText;
m_frame->editor()->client()->setInsertionPasteboard([NSPasteboard generalPasteboard]);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
if (fragment && shouldInsertFragment(fragment, range, EditorInsertActionPasted))
pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), false);
if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInNoQuirksMode())
enforceMIMEType = false;
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if (enforceMIMEType && needsSiteSpecificQuirks) {
// Covers both http and https, with or without "www."
if (baseURL.string().contains("mcafee.com/japan/", false))
virtual void setInsertionPasteboard(NSPasteboard*) { };
virtual NSURL* canonicalizeURL(NSURL*) { return 0; }
virtual NSURL* canonicalizeURLString(NSString*) { return 0; }
-#ifdef BUILDING_ON_TIGER
- virtual NSArray* pasteboardTypesForSelection(Frame*) { return 0; }
#endif
-#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
virtual void uppercaseWord() { }
virtual void lowercaseWord() { }
virtual void capitalizeWord() { }
case FrameLoadTypeStandard:
history()->updateForStandardLoad();
-#ifndef BUILDING_ON_TIGER
- // This code was originally added for a Leopard performance imporvement. We decided to
- // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>.
if (m_frame->view())
m_frame->view()->setScrollbarsSuppressed(true);
-#endif
m_client->transitionToCommittedForNewPage();
break;
#include "HTMLFormElement.h"
#include "InspectorInstrumentation.h"
#include "Page.h"
-#if PLATFORM(QT)
-#include "PluginDatabase.h"
-#endif
#include "ResourceError.h"
#include "ResourceHandle.h"
#include "ResourceLoadScheduler.h"
#include "Settings.h"
#include <wtf/CurrentTime.h>
+#if PLATFORM(QT)
+#include "PluginDatabase.h"
+#endif
+
// FIXME: More that is in common with SubresourceLoader should move up into ResourceLoader.
namespace WebCore {
ASSERT(!m_response.isNull());
-#if USE(CFNETWORK) || (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER))
+#if USE(CFNETWORK) || PLATFORM(MAC)
// Workaround for <rdar://problem/6060782>
if (m_response.isNull()) {
m_response = ResourceResponse(KURL(), "text/html", 0, String(), String());
namespace WebCore {
-#ifndef BUILDING_ON_TIGER
static void scheduleAll(const ResourceLoaderSet& loaders, SchedulePair* pair)
{
const ResourceLoaderSet copy = loaders;
if (ResourceHandle* handle = (*it)->handle())
handle->unschedule(pair);
}
-#endif
void DocumentLoader::schedule(SchedulePair* pair)
{
-#ifndef BUILDING_ON_TIGER
if (m_mainResourceLoader && m_mainResourceLoader->handle())
m_mainResourceLoader->handle()->schedule(pair);
scheduleAll(m_subresourceLoaders, pair);
scheduleAll(m_plugInStreamLoaders, pair);
scheduleAll(m_multipartSubresourceLoaders, pair);
-#else
- UNUSED_PARAM(pair);
-#endif
}
void DocumentLoader::unschedule(SchedulePair* pair)
{
-#ifndef BUILDING_ON_TIGER
if (m_mainResourceLoader && m_mainResourceLoader->handle())
m_mainResourceLoader->handle()->unschedule(pair);
unscheduleAll(m_subresourceLoaders, pair);
unscheduleAll(m_plugInStreamLoaders, pair);
unscheduleAll(m_multipartSubresourceLoaders, pair);
-#else
- UNUSED_PARAM(pair);
-#endif
}
} // namespace
case ContextMenuItemTagCheckSpellingWhileTyping:
frame->editor()->toggleContinuousSpellChecking();
break;
-#ifndef BUILDING_ON_TIGER
case ContextMenuItemTagCheckGrammarWithSpelling:
frame->editor()->toggleGrammarChecking();
break;
-#endif
#if PLATFORM(MAC)
case ContextMenuItemTagShowFonts:
frame->editor()->showFontPanel();
frame->editor()->showColorPanel();
break;
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
case ContextMenuItemTagMakeUpperCase:
frame->editor()->uppercaseWord();
break;
fontMenuItem.setSubMenu(&fontMenu);
}
-#if !defined(BUILDING_ON_TIGER)
#if !PLATFORM(GTK)
#endif // !PLATFORM(GTK)
-#else
-
-void ContextMenuController::createAndAppendSpellingAndGrammarSubMenu(ContextMenuItem& spellingAndGrammarMenuItem)
-{
- ContextMenu spellingMenu;
-
- ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel,
- contextMenuItemTagShowSpellingPanel(true));
- ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling,
- contextMenuItemTagCheckSpelling());
- ContextMenuItem checkAsYouType(CheckableActionType, ContextMenuItemTagCheckSpellingWhileTyping,
- contextMenuItemTagCheckSpellingWhileTyping());
-
- appendItem(showSpellingPanel, &spellingMenu);
- appendItem(checkSpelling, &spellingMenu);
- appendItem(checkAsYouType, &spellingMenu);
-
- spellingMenuItem.setSubMenu(&spellingMenu);
-}
-
-#endif
#if PLATFORM(MAC)
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
void ContextMenuController::createAndAppendSubstitutionsSubMenu(ContextMenuItem& substitutionsMenuItem)
{
}
#if PLATFORM(MAC)
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
#define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 1
#else
#define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 0
} else
appendItem(IgnoreGrammarItem, m_contextMenu.get());
appendItem(*separatorItem(), m_contextMenu.get());
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
} else {
// If the string was autocorrected, generate a contextual menu item allowing it to be changed back.
String replacedString = m_hitTestResult.replacedString();
#endif
if (!inPasswordField) {
-#ifndef BUILDING_ON_TIGER
#if !PLATFORM(GTK)
appendItem(*separatorItem(), m_contextMenu.get());
ContextMenuItem SpellingAndGrammarMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu,
createAndAppendSpellingAndGrammarSubMenu(SpellingAndGrammarMenuItem);
appendItem(SpellingAndGrammarMenuItem, m_contextMenu.get());
#endif
-#else
- ContextMenuItem SpellingMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu,
- contextMenuItemTagSpellingMenu());
- createAndAppendSpellingSubMenu(SpellingMenuItem);
- appendItem(SpellingMenuItem, m_contextMenu.get());
-#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
ContextMenuItem substitutionsMenuItem(SubmenuType, ContextMenuItemTagSubstitutionsMenu,
contextMenuItemTagSubstitutionsMenu());
createAndAppendSubstitutionsSubMenu(substitutionsMenuItem);
shouldEnable = frame->selection()->isRange();
break;
case ContextMenuItemTagCheckGrammarWithSpelling:
-#ifndef BUILDING_ON_TIGER
if (frame->editor()->isGrammarCheckingEnabled())
shouldCheck = true;
shouldEnable = true;
-#endif
break;
case ContextMenuItemTagItalic: {
shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState;
shouldEnable = false;
break;
case ContextMenuItemTagShowSpellingPanel:
-#ifndef BUILDING_ON_TIGER
if (frame->editor()->spellingPanelIsShowing())
item.setTitle(contextMenuItemTagShowSpellingPanel(false));
else
item.setTitle(contextMenuItemTagShowSpellingPanel(true));
-#endif
shouldEnable = frame->editor()->canEdit();
break;
case ContextMenuItemTagNoGuessesFound:
case ContextMenuItemTagTransformationsMenu:
break;
case ContextMenuItemTagShowSubstitutions:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
if (frame->editor()->substitutionsPanelIsShowing())
item.setTitle(contextMenuItemTagShowSubstitutions(false));
else
shouldEnable = frame->editor()->canEdit();
break;
case ContextMenuItemTagCorrectSpellingAutomatically:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->isAutomaticSpellingCorrectionEnabled();
#endif
break;
case ContextMenuItemTagSmartCopyPaste:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->smartInsertDeleteEnabled();
#endif
break;
case ContextMenuItemTagSmartQuotes:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->isAutomaticQuoteSubstitutionEnabled();
#endif
break;
case ContextMenuItemTagSmartDashes:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->isAutomaticDashSubstitutionEnabled();
#endif
break;
case ContextMenuItemTagSmartLinks:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->isAutomaticLinkDetectionEnabled();
#endif
break;
case ContextMenuItemTagTextReplacement:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
shouldCheck = frame->editor()->isAutomaticTextReplacementEnabled();
#endif
break;
virtual void setInsertionPasteboard(NSPasteboard*) = 0;
virtual NSURL* canonicalizeURL(NSURL*) = 0;
virtual NSURL* canonicalizeURLString(NSString*) = 0;
-#ifdef BUILDING_ON_TIGER
- virtual NSArray* pasteboardTypesForSelection(Frame*) = 0;
-#endif
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
virtual void uppercaseWord() = 0;
virtual void lowercaseWord() = 0;
virtual void capitalizeWord() = 0;
m_scheduledRunLoopPairs = adoptPtr(new SchedulePairHashSet);
m_scheduledRunLoopPairs->add(pair);
-#ifndef BUILDING_ON_TIGER
for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree()->traverseNext()) {
if (DocumentLoader* documentLoader = frame->loader()->documentLoader())
documentLoader->schedule(pair.get());
if (DocumentLoader* documentLoader = frame->loader()->provisionalDocumentLoader())
documentLoader->schedule(pair.get());
}
-#endif
// FIXME: make SharedTimerMac use these SchedulePairs.
}
RefPtr<SchedulePair> pair = prpPair;
m_scheduledRunLoopPairs->remove(pair);
-#ifndef BUILDING_ON_TIGER
for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree()->traverseNext()) {
if (DocumentLoader* documentLoader = frame->loader()->documentLoader())
documentLoader->unschedule(pair.get());
if (DocumentLoader* documentLoader = frame->loader()->provisionalDocumentLoader())
documentLoader->unschedule(pair.get());
}
-#endif
}
} // namespace
String DefaultLocalizationStrategy::contextMenuItemTagLookUpInDictionary(const String& selectedString)
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
UNUSED_PARAM(selectedString);
return WEB_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
#else
void disableSuddenTermination();
void enableSuddenTermination();
-#if (!PLATFORM(MAC) || defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)) && !PLATFORM(CHROMIUM)
+#if (!PLATFORM(MAC) || defined(BUILDING_ON_LEOPARD)) && !PLATFORM(CHROMIUM)
inline void disableSuddenTermination() { }
inline void enableSuddenTermination() { }
#endif
#endif
typedef struct CGFont* CGFontRef;
-#ifndef BUILDING_ON_TIGER
typedef const struct __CTFont* CTFontRef;
-#endif
#include <CoreFoundation/CFBase.h>
#include <objc/objc-auto.h>
#if USE(CG) || USE(SKIA_ON_MAC_CHROME)
typedef struct CGFont* CGFontRef;
#if OS(DARWIN)
-#ifndef BUILDING_ON_TIGER
typedef const struct __CTFont* CTFontRef;
typedef UInt32 ATSUFontID;
typedef UInt32 ATSFontRef;
#endif
#endif
-#endif
namespace WebCore {
class FontDescription;
-#if OS(DARWIN) && !defined(BUILDING_ON_TIGER)
+#if OS(DARWIN)
inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
#endif
#elif OS(DARWIN)
, m_font(hashTableDeletedFontValue())
#endif
-#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN))
+#if USE(CG) && PLATFORM(WIN)
, m_cgFont(0)
#elif USE(CAIRO)
, m_scaledFont(hashTableDeletedFontValue())
#if OS(DARWIN)
, m_font(0)
#endif
-#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN))
+#if USE(CG) && PLATFORM(WIN)
, m_cgFont(0)
#elif USE(CAIRO)
, m_scaledFont(0)
#if OS(DARWIN)
, m_font(0)
#endif
-#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN))
+#if USE(CG) && PLATFORM(WIN)
, m_cgFont(0)
#elif USE(CAIRO)
, m_scaledFont(0)
#if USE(CG) || USE(SKIA_ON_MAC_CHROME)
#if OS(DARWIN)
-#ifndef BUILDING_ON_TIGER
CGFontRef cgFont() const { return m_cgFont.get(); }
-#else
- CGFontRef cgFont() const { return m_cgFont; }
-#endif
CTFontRef ctFont() const;
bool roundsGlyphAdvances() const;
#if PLATFORM(WIN)
RetainPtr<CGFontRef> m_cgFont;
#else
-#ifndef BUILDING_ON_TIGER
RetainPtr<CGFontRef> m_cgFont;
-#else
- CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced.
-#endif
mutable RetainPtr<CTFontRef> m_CTFont;
#endif
#endif
typedef struct CGContext* CGContextRef;
-#define USE_CG_SHADING defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#define USE_CG_SHADING defined(BUILDING_ON_LEOPARD)
#if USE_CG_SHADING
typedef struct CGShading* CGShadingRef;
float m_syntheticBoldOffset;
#endif
-#ifdef BUILDING_ON_TIGER
-public:
- void* m_styleGroup;
-
-private:
-#endif
#if USE(ATSUI)
public:
using namespace std;
-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
namespace WebCore {
// FIXME: maybe only do trilinear if the image is being scaled down,
// but then what if the layer size changes?
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
m_contentsLayer->setMinificationFilter(PlatformCALayer::Trilinear);
#endif
m_contentsLayer->setContents(m_pendingContentsImage.get());
#import <QuartzCore/QuartzCore.h>
#import <wtf/UnusedParam.h>
-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
using namespace WebCore;
#import <wtf/CurrentTime.h>
#import <wtf/UnusedParam.h>
-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
using namespace WebCore;
@interface CALayer(Private)
- (void)setContentsChanged;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- (void)setAcceleratesDrawing:(BOOL)flag;
- (BOOL)acceleratesDrawing;
#endif
bool PlatformCALayer::acceleratesDrawing() const
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
return [m_layer.get() acceleratesDrawing];
#else
return false;
void PlatformCALayer::setAcceleratesDrawing(bool acceleratesDrawing)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
BEGIN_BLOCK_OBJC_EXCEPTIONS
[m_layer.get() setAcceleratesDrawing:acceleratesDrawing];
END_BLOCK_OBJC_EXCEPTIONS
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// Building on 10.6 or later: kCGInterpolationMedium is defined in the CGInterpolationQuality enum.
#define HAVE_CG_INTERPOLATION_MEDIUM 1
#endif
-#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
+#ifndef TARGETING_LEOPARD
// Targeting 10.6 or later: use kCGInterpolationMedium.
#define WTF_USE_CG_INTERPOLATION_MEDIUM 1
#endif
CGColorSpaceRef sRGBColorSpaceRef()
{
// FIXME: Windows should be able to use kCGColorSpaceSRGB, this is tracked by http://webkit.org/b/31363.
-#if PLATFORM(WIN) || defined(BUILDING_ON_TIGER)
+#if PLATFORM(WIN)
return deviceRGBColorSpaceRef();
#else
static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
CGColorSpaceRef linearRGBColorSpaceRef()
{
// FIXME: Windows should be able to use kCGColorSpaceGenericRGBLinear, this is tracked by http://webkit.org/b/31363.
-#if PLATFORM(WIN) || defined(BUILDING_ON_TIGER)
+#if PLATFORM(WIN)
return deviceRGBColorSpaceRef();
#else
static CGColorSpaceRef linearRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear);
void GraphicsContext::setAllowsFontSmoothing(bool allowsFontSmoothing)
{
UNUSED_PARAM(allowsFontSmoothing);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD)
CGContextRef context = platformContext();
CGContextSetAllowsFontSmoothing(context, allowsFontSmoothing);
#endif
CGContextSetShouldSmoothFonts(platformContext(), enable);
}
-#ifndef BUILDING_ON_TIGER // Tiger's setPlatformCompositeOperation() is defined in GraphicsContextMac.mm.
void GraphicsContext::setPlatformCompositeOperation(CompositeOperator mode)
{
if (paintingDisabled())
}
CGContextSetBlendMode(platformContext(), target);
}
-#endif
}
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
-#if (PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
+#if (PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
#define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1
#endif
// Adjust the color space.
subImage = imageWithColorSpace(subImage.get(), styleColorSpace);
-#ifndef BUILDING_ON_TIGER
// Leopard has an optimized call for the tiling of image patterns, but we can only use it if the image has been decoded enough that
// its buffer is the same size as the overall image. Because a partially decoded CGImageRef with a smaller width or height than the
// overall image buffer needs to tile with "gaps", we can't use the optimized tiling call in that case.
- // FIXME: Could create WebKitSystemInterface SPI for CGCreatePatternWithImage2 and probably make Tiger tile faster as well.
// FIXME: We cannot use CGContextDrawTiledImage with scaled tiles on Leopard, because it suffers from rounding errors. Snow Leopard is ok.
float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a());
float w = CGImageGetWidth(tileImage);
#endif
CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get());
else {
-#endif
- // On Leopard, this code now only runs for partially decoded images whose buffers do not yet match the overall size of the image.
- // On Tiger this code runs all the time. This code is suboptimal because the pattern does not reference the image directly, and the
- // pattern is destroyed before exiting the function. This means any decoding the pattern does doesn't end up cached anywhere, so we
- // redecode every time we paint.
+ // On Leopard and newer, this code now only runs for partially decoded images whose buffers do not yet match the overall size of the image.
static const CGPatternCallbacks patternCallbacks = { 0, drawPatternCallback, NULL };
CGAffineTransform matrix = CGAffineTransformMake(narrowPrecisionToCGFloat(patternTransform.a()), 0, 0, narrowPrecisionToCGFloat(patternTransform.d()), adjustedX, adjustedY);
matrix = CGAffineTransformConcat(matrix, CGContextGetCTM(context));
CGContextSetFillColorWithColor(context, color.get());
CGContextFillRect(context, CGContextGetClipBoundingBox(context));
-#ifndef BUILDING_ON_TIGER
}
-#endif
stateSaver.restore();
void ImageSource::clear(bool destroyAllFrames, size_t, SharedBuffer* data, bool allDataReceived)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD)
// Recent versions of ImageIO discard previously decoded image frames if the client
// application no longer holds references to them, so there's no need to throw away
// the decoder unless we're explicitly asked to destroy all of the frames.
void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFontRef& cgFont)
{
outNSFont = nsFont;
-#ifndef BUILDING_ON_TIGER
cgFont = CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0);
-#else
- cgFont = wkGetCGFontFromNSFont(nsFont);
-#endif
}
#endif // PLATFORM(MAC)
, m_size(size)
, m_widthVariant(widthVariant)
, m_font(nsFont)
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
// FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
// have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().
, m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait)
if (m_font)
CFRetain(m_font);
-#ifndef BUILDING_ON_TIGER
m_cgFont.adoptCF(cgFont);
-#else
- m_cgFont = cgFont;
-#endif
}
FontPlatformData:: ~FontPlatformData()
}
#endif
-#ifndef BUILDING_ON_TIGER
m_cgFont.adoptCF(cgFont);
-#else
- m_cgFont = cgFont;
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait;
#endif
m_CTFont = 0;
bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD)
// See <rdar://problem/7389945>
return false;
#else
ComplexTextRun(const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr);
#if USE(ATSUI)
-#ifdef BUILDING_ON_TIGER
- typedef UInt32 URefCon;
-#endif
static OSStatus overrideLayoutOperation(ATSULayoutOperationSelector, ATSULineRef, URefCon, void*, ATSULayoutOperationCallbackStatus*);
#endif
static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
ProviderInfo info = { cp, length, fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation()) };
RetainPtr<CTTypesetterRef> typesetter(AdoptCF, wkCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
#else
#import <AppKit/AppKit.h>
#import <wtf/StdLibExtras.h>
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-#endif
namespace WebCore {
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD)
static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef)
{
ASSERT_UNUSED(observer, observer == fontCache());
void FontCache::platformInit()
{
wkSetUpFontCache();
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD)
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
#else
// kCTFontManagerRegisteredFontsChangedNotification does not exist on Leopard and earlier.
FontCustomPlatformData::~FontCustomPlatformData()
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if (m_atsContainer)
ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault);
#endif
RetainPtr<CGFontRef> cgFontRef;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
RetainPtr<CFDataRef> bufferData(AdoptCF, buffer->createCFData());
RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
}
cgFontRef.adoptCF(CGFontCreateWithPlatformFont(&fontRef));
-#ifndef BUILDING_ON_TIGER
// Workaround for <rdar://problem/5675504>.
if (cgFontRef && !CGFontGetNumberOfGlyphs(cgFontRef.get()))
cgFontRef = 0;
-#endif
if (!cgFontRef) {
ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
return 0;
}
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD)
return new FontCustomPlatformData(containerRef, cgFontRef.releaseRef());
}
} else
CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
else {
if (!count)
return;
namespace WebCore {
-#ifndef BUILDING_ON_TIGER
static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
return false;
}
-#endif
bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
bool haveGlyphs = false;
-#ifndef BUILDING_ON_TIGER
if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
Vector<CGGlyph, 512> glyphs(bufferLength);
wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
}
}
}
-#else
- // Use an array of long so we get good enough alignment.
- long glyphVector[(GLYPH_VECTOR_SIZE + sizeof(long) - 1) / sizeof(long)];
-
- OSStatus status = wkInitializeGlyphVector(GlyphPage::size, &glyphVector);
- if (status != noErr)
- // This should never happen, perhaps indicates a bad font! If it does the
- // font substitution code will find an alternate font.
- return false;
-
- wkConvertCharToGlyphs(fontData->m_styleGroup, buffer, bufferLength, &glyphVector);
-
- unsigned numGlyphs = wkGetGlyphVectorNumGlyphs(&glyphVector);
- if (numGlyphs != length) {
- // This should never happen, perhaps indicates a bad font?
- // If it does happen, the font substitution code will find an alternate font.
- wkClearGlyphVector(&glyphVector);
- return false;
- }
-
- ATSLayoutRecord* glyphRecord = (ATSLayoutRecord*)wkGetGlyphVectorFirstRecord(glyphVector);
- for (unsigned i = 0; i < length; i++) {
- Glyph glyph = glyphRecord->glyphID;
- if (!glyph)
- setGlyphDataForIndex(offset + i, 0, 0);
- else {
- setGlyphDataForIndex(offset + i, glyph, fontData);
- haveGlyphs = true;
- }
- glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector));
- }
- wkClearGlyphVector(&glyphVector);
-#endif
return haveGlyphs;
}
static void drawFocusRingToContext(CGContextRef context, CGPathRef focusRingPath, CGColorRef color, int radius)
{
-#ifdef BUILDING_ON_TIGER
- CGContextBeginTransparencyLayer(context, 0);
-#endif
CGContextBeginPath(context);
CGContextAddPath(context, focusRingPath);
wkDrawFocusRing(context, color, radius);
-#ifdef BUILDING_ON_TIGER
- CGContextEndTransparencyLayer(context);
-#endif
}
void GraphicsContext::drawFocusRing(const Path& path, int width, int /*offset*/, const Color& color)
drawFocusRingToContext(platformContext(), focusRingPath.get(), colorRef, radius);
}
-#ifdef BUILDING_ON_TIGER // Post-Tiger's setPlatformCompositeOperation() is defined in GraphicsContextCG.cpp.
-void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op)
-{
- if (paintingDisabled())
- return;
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- [[NSGraphicsContext graphicsContextWithGraphicsPort:platformContext() flipped:YES]
- setCompositingOperation:(NSCompositingOperation)op];
- [pool drain];
-}
-#endif
static NSColor* createPatternColor(NSString* name, NSColor* defaultColor, bool& usingDot)
{
patternColor = grammarPatternColor.get();
break;
}
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
// To support correction panel.
case TextCheckingReplacementLineStyle:
{
return 0;
bool useIconFromFirstFile;
-#ifdef BUILDING_ON_TIGER
- // FIXME: find a better image for multiple files to use on Tiger.
- useIconFromFirstFile = true;
-#else
useIconFromFirstFile = filenames.size() == 1;
-#endif
if (useIconFromFirstFile) {
// Don't pass relative filenames -- we don't want a result that depends on the current directory.
// Need 0U here to disambiguate String::operator[] from operator(NSString*, int)[]
return adoptRef(new Icon(image));
}
-#ifdef BUILDING_ON_TIGER
- return 0;
-#else
NSImage* image = [NSImage imageNamed:NSImageNameMultipleDocuments];
if (!image)
return 0;
return adoptRef(new Icon(image));
-#endif
}
void Icon::paint(GraphicsContext* context, const IntRect& rect)
#include "DocumentLoader.h"
#endif
-#ifdef BUILDING_ON_TIGER
-#import "AutodrainedPool.h"
-#endif
#import "BlockExceptions.h"
#import "DocumentLoader.h"
#import "RenderStyle.h"
#endif
-#ifdef BUILDING_ON_TIGER
-static IMP method_setImplementation(Method m, IMP imp)
-{
- IMP result = m->method_imp;
- m->method_imp = imp;
- return result;
-}
-#endif
SOFT_LINK_FRAMEWORK(QTKit)
SOFT_LINK_POINTER(QTKit, QTMovieVolumeDidChangeNotification, NSString *)
SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoCrossSiteAttribute, NSString *)
SOFT_LINK_POINTER(QTKit, QTVideoRendererWebKitOnlyNewImageAvailableNotification, NSString *)
-#ifndef BUILDING_ON_TIGER
SOFT_LINK_POINTER(QTKit, QTMovieApertureModeClean, NSString *)
SOFT_LINK_POINTER(QTKit, QTMovieApertureModeAttribute, NSString *)
-#endif
#define QTMovie getQTMovieClass()
#define QTMovieView getQTMovieViewClass()
#define QTMovieVolumeDidChangeNotification getQTMovieVolumeDidChangeNotification()
#define QTSecurityPolicyNoCrossSiteAttribute getQTSecurityPolicyNoCrossSiteAttribute()
#define QTVideoRendererWebKitOnlyNewImageAvailableNotification getQTVideoRendererWebKitOnlyNewImageAvailableNotification()
-#ifndef BUILDING_ON_TIGER
#define QTMovieApertureModeClean getQTMovieApertureModeClean()
#define QTMovieApertureModeAttribute getQTMovieApertureModeAttribute()
-#endif
// Older versions of the QTKit header don't have these constants.
#if !defined QTKIT_VERSION_MAX_ALLOWED || QTKIT_VERSION_MAX_ALLOWED <= QTKIT_VERSION_7_0
namespace WebCore {
-#ifdef BUILDING_ON_TIGER
-static const long minimumQuickTimeVersion = 0x07300000; // 7.3
-#endif
MediaPlayerPrivateInterface* MediaPlayerPrivateQTKit::create(MediaPlayer* player)
[NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute,
[NSNumber numberWithBool:NO], QTMovieLoopsAttribute,
[NSNumber numberWithBool:!m_privateBrowsing], @"QTMovieAllowPersistentCacheAttribute",
-#ifndef BUILDING_ON_TIGER
QTMovieApertureModeClean, QTMovieApertureModeAttribute,
-#endif
nil];
}
setSize(m_player->size());
NSView* parentView = m_player->frameView()->documentView();
[parentView addSubview:m_qtMovieView.get()];
-#ifdef BUILDING_ON_TIGER
- // setDelegate: isn't a public call in Tiger, so use performSelector to keep the compiler happy
- [m_qtMovieView.get() performSelector:@selector(setDelegate:) withObject:m_objcObserver.get()];
-#else
[m_qtMovieView.get() setDelegate:m_objcObserver.get()];
-#endif
[m_objcObserver.get() setView:m_qtMovieView.get()];
[m_qtMovieView.get() setMovie:m_qtMovie.get()];
[m_qtMovieView.get() setControllerVisible:NO];
{
if (m_qtMovieView) {
[m_objcObserver.get() setView:nil];
-#ifdef BUILDING_ON_TIGER
- // setDelegate: isn't a public call in Tiger, so use performSelector to keep the compiler happy
- [m_qtMovieView.get() performSelector:@selector(setDelegate:) withObject:nil];
-#else
[m_qtMovieView.get() setDelegate:nil];
-#endif
[m_qtMovieView.get() removeFromSuperview];
m_qtMovieView = nil;
}
bool MediaPlayerPrivateQTKit::supportsFullscreen() const
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
return true;
#else
// See <rdar://problem/7389945>
if (metaDataAvailable()) {
wkQTMovieSetShowClosedCaptions(m_qtMovie.get(), closedCaptionsVisible);
-#if USE(ACCELERATED_COMPOSITING) && (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#if USE(ACCELERATED_COMPOSITING) && !defined(BUILDING_ON_LEOPARD)
if (closedCaptionsVisible && m_qtVideoLayer) {
// Captions will be rendered upside down unless we flag the movie as flipped (again). See <rdar://7408440>.
[m_qtVideoLayer.get() setGeometryFlipped:YES];
NSSize initialSize = NSZeroSize;
NSSize naturalSize = [[m_qtMovie.get() attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// QTMovieCurrentSizeAttribute is not allowed with instances of QTMovie that have been
// opened with QTMovieOpenForPlaybackAttribute, so ask for the display transform attribute instead.
NSAffineTransform *displayTransform = [m_qtMovie.get() attributeForKey:@"QTMoviePreferredTransformAttribute"];
context->setImageInterpolationQuality(InterpolationLow);
IntRect paintRect(IntPoint(0, 0), IntSize(r.width(), r.height()));
-#ifdef BUILDING_ON_TIGER
- AutodrainedPool pool;
-#endif
NSGraphicsContext* newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context->platformContext() flipped:NO];
// draw the current video frame
bool MediaPlayerPrivateQTKit::isAvailable()
{
-#ifdef BUILDING_ON_TIGER
- SInt32 version;
- OSErr result;
- result = Gestalt(gestaltQuickTime, &version);
- if (result != noErr) {
- LOG_ERROR("No QuickTime available. Disabling <video> and <audio> support.");
- return false;
- }
- if (version < minimumQuickTimeVersion) {
- LOG_ERROR("QuickTime version %x detected, at least %x required. Disabling <video> and <audio> support.", version, minimumQuickTimeVersion);
- return false;
- }
- return true;
-#else
// On 10.5 and higher, QuickTime will always be new enough for <video> and <audio> support, so we just check that the framework can be loaded.
return QTKitLibrary();
-#endif
}
void MediaPlayerPrivateQTKit::getSitesInMediaCache(Vector<String>& sites)
if (!fontData->platformData().cgFont())
return false;
-#ifdef BUILDING_ON_TIGER
- ATSUStyle fontStyle;
- if (ATSUCreateStyle(&fontStyle) != noErr)
- return false;
-
- ATSUFontID fontId = fontData->platformData().m_atsuFontID;
- if (!fontId) {
- ATSUDisposeStyle(fontStyle);
- return false;
- }
-
- ATSUAttributeTag tag = kATSUFontTag;
- ByteCount size = sizeof(ATSUFontID);
- ATSUFontID *valueArray[1] = {&fontId};
- OSStatus status = ATSUSetAttributes(fontStyle, 1, &tag, &size, (void* const*)valueArray);
- if (status != noErr) {
- ATSUDisposeStyle(fontStyle);
- return false;
- }
-
- if (wkGetATSStyleGroup(fontStyle, &fontData->m_styleGroup) != noErr) {
- ATSUDisposeStyle(fontStyle);
- return false;
- }
-
- ATSUDisposeStyle(fontStyle);
-#endif
return true;
}
}
#if !ERROR_DISABLED
-#if defined(__LP64__) || (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
+#if defined(__LP64__) || (!defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
static NSString* pathFromFont(NSFont*)
{
// FMGetATSFontRefFromFont is not available. As pathFromFont is only used for debugging purposes,
#else
static NSString* pathFromFont(NSFont *font)
{
-#ifndef BUILDING_ON_TIGER
ATSFontRef atsFont = FMGetATSFontRefFromFont(CTFontGetPlatformFont(toCTFontRef(font), 0));
-#else
- ATSFontRef atsFont = FMGetATSFontRefFromFont(wkGetNSFontATSUFontId(font));
-#endif
FSRef fileRef;
-#ifndef BUILDING_ON_TIGER
OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
if (status != noErr)
return nil;
-#else
- FSSpec oFile;
- OSStatus status = ATSFontGetFileSpecification(atsFont, &oFile);
- if (status != noErr)
- return nil;
-
- status = FSpMakeFSRef(&oFile, &fileRef);
- if (status != noErr)
- return nil;
-#endif
UInt8 filePathBuffer[PATH_MAX];
status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
void SimpleFontData::platformInit()
{
-#ifdef BUILDING_ON_TIGER
- m_styleGroup = 0;
-#endif
#if USE(ATSUI)
m_ATSUMirrors = false;
m_checkedShapesArabic = false;
int iDescent;
int iLineGap;
unsigned unitsPerEm;
-#ifdef BUILDING_ON_TIGER
- wkGetFontMetrics(m_platformData.cgFont(), &iAscent, &iDescent, &iLineGap, &unitsPerEm);
-#else
iAscent = CGFontGetAscent(m_platformData.cgFont());
iDescent = CGFontGetDescent(m_platformData.cgFont());
iLineGap = CGFontGetLeading(m_platformData.cgFont());
unitsPerEm = CGFontGetUnitsPerEm(m_platformData.cgFont());
-#endif
float pointSize = m_platformData.m_size;
float ascent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
static CFDataRef copyFontTableForTag(FontPlatformData& platformData, FourCharCode tableName)
{
-#ifdef BUILDING_ON_TIGER
- ATSFontRef atsFont = FMGetATSFontRefFromFont(platformData.m_atsuFontID);
-
- ByteCount tableSize;
- if (ATSFontGetTable(atsFont, tableName, 0, 0, NULL, &tableSize) != noErr)
- return 0;
-
- CFMutableDataRef data = CFDataCreateMutable(kCFAllocatorDefault, tableSize);
- if (!data)
- return 0;
-
- CFDataIncreaseLength(data, tableSize);
- if (ATSFontGetTable(atsFont, tableName, 0, tableSize, CFDataGetMutableBytePtr(data), &tableSize) != noErr) {
- CFRelease(data);
- return 0;
- }
-
- return data;
-#else
return CGFontCopyTableForTag(platformData.cgFont(), tableName);
-#endif
}
void SimpleFontData::platformCharWidthInit()
fontCache()->releaseFontData(m_derivedFontData->emphasisMark.leakPtr());
}
-#ifdef BUILDING_ON_TIGER
- if (m_styleGroup)
- wkReleaseStyleGroup(m_styleGroup);
-#endif
#if USE(ATSUI)
HashMap<unsigned, ATSUStyle>::iterator end = m_ATSUStyleMap.end();
for (HashMap<unsigned, ATSUStyle>::iterator it = m_ATSUStyleMap.begin(); it != end; ++it)
class NSFont;
#endif
-#ifndef BUILDING_ON_TIGER
inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
-#endif
#endif
return CGColorSpaceCreateDeviceRGB();
RetainPtr<CFDataRef> data(AdoptCF, CFDataCreate(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(colorProfile.data()), colorProfile.size()));
-#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
+#ifndef TARGETING_LEOPARD
return CGColorSpaceCreateWithICCProfile(data.get());
#else
RetainPtr<CGDataProviderRef> profileDataProvider(AdoptCF, CGDataProviderCreateWithCFData(data.get()));
#import "SecurityOrigin.h"
#import "WebCoreSystemInterface.h"
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#endif
namespace WebCore {
#import "WebCoreSystemInterface.h"
#import <wtf/RetainPtr.h>
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#endif
@interface NSHTTPCookie (WebCoreHTTPOnlyCookies)
- (BOOL)isHTTPOnly;
static NSArray *types = nil;
if (!types) {
types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType,
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
NSPICTPboardType,
#endif
NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, kUTTypePNG, nil];
@protocol NAME <NSObject> \
@end
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
EMPTY_PROTOCOL(NSTableViewDataSource)
EMPTY_PROTOCOL(NSTableViewDelegate)
#endif
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
EMPTY_PROTOCOL(NSURLConnectionDelegate)
EMPTY_PROTOCOL(NSURLDownloadDelegate)
bool canExcludeFromBackup()
{
-#ifdef BUILDING_ON_TIGER
- return false;
-#else
return true;
-#endif
}
bool excludeFromBackup(const String& path)
{
-#ifdef BUILDING_ON_TIGER
- UNUSED_PARAM(path);
- return false;
-#else
// It is critical to pass FALSE for excludeByPath because excluding by path requires root privileges.
CSBackupSetItemExcluded(pathAsURL(path).get(), TRUE, FALSE);
return true;
-#endif
}
} // namespace WebCore
} _flags;
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD)
- (id)init;
- (id)initWithDOMRange:(DOMRange *)domRange;
static NSFileWrapper *fileWrapperForURL(DocumentLoader *, NSURL *);
static NSFileWrapper *fileWrapperForElement(Element*);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// Additional control Unicode characters
const unichar WebNextLineCharacter = 0x0085;
@implementation WebHTMLConverter
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
static NSFont *_fontForNameAndSize(NSString *fontName, CGFloat size, NSMutableDictionary *cache)
{
return (0 == _errorCode) ? [[_attrStr retain] autorelease] : nil;
}
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD)
// This function uses TextIterator, which makes offsets in its result compatible with HTML editing.
+ (NSAttributedString *)editingAttributedStringFromRange:(Range*)range
NSString *WebURLPboardType = @"public.url";
NSString *WebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
-#ifndef BUILDING_ON_TIGER
static NSArray* selectionPasteboardTypes(bool canSmartCopyOrDelete, bool selectionContainsAttachments)
{
if (selectionContainsAttachments) {
return [NSArray arrayWithObjects:WebArchivePboardType, NSRTFPboardType, NSStringPboardType, nil];
}
}
-#endif
static NSArray* writableTypesForURL()
{
NSAttributedString *attributedString = nil;
if (frame->view()->platformWidget())
attributedString = [[[NSAttributedString alloc] _initWithDOMRange:kit(selectedRange)] autorelease];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
else {
// In WebKit2 we are using a different way to create the NSAttributedString from the DOMrange that doesn't require access to the WebView.
RetainPtr<WebHTMLConverter> converter = [[WebHTMLConverter alloc] initWithDOMRange:kit(selectedRange)];
}
#endif
-#ifdef BUILDING_ON_TIGER
- // 4930197: Mail overrides [WebHTMLView pasteboardTypesForSelection] in order to add another type to the pasteboard
- // after WebKit does. On Tiger we must call this function so that Mail code will be executed, meaning that
- // we can't call WebCore::Pasteboard's method for setting types.
- UNUSED_PARAM(canSmartCopyOrDelete);
-
- NSArray *types = pasteboardTypes ? pasteboardTypes : frame->editor()->client()->pasteboardTypesForSelection(frame);
- // Don't write RTFD to the pasteboard when the copied attributed string has no attachments.
- NSMutableArray *mutableTypes = nil;
- if (![attributedString containsAttachments]) {
- mutableTypes = [[types mutableCopy] autorelease];
- [mutableTypes removeObject:NSRTFDPboardType];
- types = mutableTypes;
- }
- [pasteboard declareTypes:types owner:nil];
-#else
NSArray *types = pasteboardTypes ? pasteboardTypes : selectionPasteboardTypes(canSmartCopyOrDelete, [attributedString containsAttachments]);
[pasteboard declareTypes:types owner:nil];
frame->editor()->client()->didSetSelectionTypesForPasteboard();
-#endif
// Put HTML on the pasteboard.
if ([types containsObject:WebArchivePboardType]) {
(fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:NSPDFPboardType] copy] autorelease]), uniqueURLWithRelativePart(@"application.pdf"), "application/pdf", "", ""))))
return fragment.release();
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if ([types containsObject:NSPICTPboardType] &&
(fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:NSPICTPboardType] copy] autorelease]), uniqueURLWithRelativePart(@"image.pict"), "image/pict", "", ""))))
return fragment.release();
if (!client()->shouldPopOver())
[m_popup.get() addItemWithTitle:@""];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
TextDirection menuTextDirection = client()->menuStyle().textDirection();
[m_popup.get() setUserInterfaceLayoutDirection:menuTextDirection == LTR ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft];
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD)
ASSERT(client());
int size = client()->listSize();
[attributes setObject:font forKey:NSFontAttributeName];
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
RetainPtr<NSMutableParagraphStyle> paragraphStyle(AdoptNS, [[NSParagraphStyle defaultParagraphStyle] mutableCopy]);
[paragraphStyle.get() setAlignment:menuTextDirection == LTR ? NSLeftTextAlignment : NSRightTextAlignment];
NSWritingDirection writingDirection = style.textDirection() == LTR ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft;
[attributes setObject:writingDirectionArray.get() forKey:NSWritingDirectionAttributeName];
}
[attributes setObject:paragraphStyle.get() forKey:NSParagraphStyleAttributeName];
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD)
// FIXME: Add support for styling the foreground and background colors.
// FIXME: Find a way to customize text color when an item is highlighted.
}
-#endif // BUILDING_ON_TIGER
+#endif
#include <string.h>
#include <wtf/PassRefPtr.h>
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#endif
using namespace WebCore;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (void)dealloc
#include <stdio.h>
// On Snow Leopard and newer we'll ask IOKit to deliver notifications on a queue.
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
#define IOKIT_WITHOUT_LIBDISPATCH 1
#endif
#import "config.h"
#import "SuddenTermination.h"
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
namespace WebCore {
{
// This method relies on threading being initialized by the caller, otherwise
// WebCoreObjCScheduleDeallocateOnMainThread will crash.
-#if !defined(BUILDING_ON_TIGER) && !defined(DONT_FINALIZE_ON_MAIN_THREAD)
+#ifndef DONT_FINALIZE_ON_MAIN_THREAD
objc_finalizeOnMainThread(cls);
#else
UNUSED_PARAM(cls);
#endif
}
-#ifdef BUILDING_ON_TIGER
-static inline IMP method_getImplementation(Method method)
-{
- return method->method_imp;
-}
-#endif
typedef std::pair<Class, id> ClassAndIdPair;
#include <ApplicationServices/ApplicationServices.h>
#include <objc/objc.h>
-#if PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#include <IOSurface/IOSurface.h>
#endif
extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
-#ifndef BUILDING_ON_TIGER
extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
-#else
-#define GLYPH_VECTOR_SIZE (50 * 32)
-
-extern void (*wkClearGlyphVector)(void* glyphs);
-extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
-extern CFStringRef (*wkCopyFullFontName)(CGFontRef font);
-extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
-extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
-extern void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
-extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
-extern void* wkGetGlyphsForCharacters;
-extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
-extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
-extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
-extern void (*wkReleaseStyleGroup)(void* group);
-extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
-#endif
extern BOOL (*wkUseSharedMediaUI)();
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
extern void* wkGetHyphenationLocationBeforeIndex;
#else
extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
extern CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
extern CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
-#ifndef BUILDING_ON_TIGER
void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
-#else
-void (*wkClearGlyphVector)(void* glyphs);
-OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
-CFStringRef (*wkCopyFullFontName)(CGFontRef font);
-OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
-CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
-void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
-ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
-void* wkGetGlyphsForCharacters;
-int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
-size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
-OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
-void (*wkReleaseStyleGroup)(void* group);
-ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
-BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
void* wkGetHyphenationLocationBeforeIndex;
#else
CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
using namespace WebCore;
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-#endif
#define SYNTHESIZED_FONT_TRAITS (NSBoldFontMask | NSItalicFontMask)
// Workaround for <rdar://problem/5781372>.
static inline void fixUpWeight(NSInteger& weight, NSString *fontName)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
UNUSED_PARAM(weight);
UNUSED_PARAM(fontName);
#else
+ (NSFont *)fontWithFamily:(NSString *)desiredFamily traits:(NSFontTraitMask)desiredTraits weight:(int)desiredWeight size:(float)size
{
-#ifndef BUILDING_ON_TIGER
NSFont *font = [self internalFontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
if (font)
return font;
// Auto activate the font before looking for it a second time.
// Ignore the result because we want to use our own algorithm to actually find the font.
[NSFont fontWithName:desiredFamily size:size];
-#endif
return [self internalFontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
}
#import "config.h"
#import "Widget.h"
-#ifdef BUILDING_ON_TIGER
-#import "AutodrainedPool.h"
-#endif
#import "BlockExceptions.h"
#import "Chrome.h"
BEGIN_BLOCK_OBJC_EXCEPTIONS;
{
-#ifdef BUILDING_ON_TIGER
- AutodrainedPool pool;
-#endif
NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES];
[view displayRectIgnoringOpacity:dirtyRect inContext:nsContext];
}
#include "PlatformString.h"
-#define CERTIFICATE_CREDENTIALS_SUPPORTED ((PLATFORM(MAC) || PLATFORM(IOS)) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#define CERTIFICATE_CREDENTIALS_SUPPORTED ((PLATFORM(MAC) || PLATFORM(IOS)) && !defined(BUILDING_ON_LEOPARD))
#if CERTIFICATE_CREDENTIALS_SUPPORTED
#include <Security/SecBase.h>
#include <SystemConfiguration/SystemConfiguration.h>
#endif
-#ifdef BUILDING_ON_TIGER
-// This function is available on Tiger, but not declared in the CFRunLoop.h header on Tiger.
-extern "C" CFRunLoopRef CFRunLoopGetMain();
-#endif
namespace WebCore {
namespace WebCore {
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
static void addProxyServersForURL(Vector<ProxyServer>& proxyServers, const KURL& url)
{
RetainPtr<CFDictionaryRef> proxySettings(AdoptCF, CFNetworkCopySystemProxySettings());
s_httpPipeliningEnabled = flag;
}
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
static inline bool readBooleanPreference(CFStringRef key)
{
Boolean keyExistsAndHasValidFormat;
// Always set the connection count per host, even when pipelining.
unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
static const unsigned unlimitedConnectionCount = 10000;
if (!ResourceRequest::httpPipeliningEnabled() && readBooleanPreference(CFSTR("WebKitEnableHTTPPipelining")))
void createStreams();
void scheduleStreams();
void chooseProxy();
-#ifndef BUILDING_ON_TIGER
void chooseProxyFromArray(CFArrayRef);
void executePACFileURL(CFURLRef);
void removePACRunLoopSource();
static void pacExecutionCallback(void* client, CFArrayRef proxyList, CFErrorRef error);
static void pacExecutionCallbackMainThread(void*);
static CFStringRef copyPACExecutionDescription(void*);
-#endif
bool shouldUseSSL() const { return m_url.protocolIs("wss"); }
unsigned short port() const;
void readStreamCallback(CFStreamEventType);
void writeStreamCallback(CFStreamEventType);
-#ifndef BUILDING_ON_TIGER
void reportErrorToClient(CFErrorRef);
-#endif
// No authentication for streams per se, but proxy may ask for credentials.
virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
#include <wtf/MainThread.h>
#include <wtf/text/StringConcatenate.h>
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
#include <SystemConfiguration/SystemConfiguration.h>
#endif
#include "WebCoreSystemInterface.h"
#endif
-#ifdef BUILDING_ON_TIGER
-#define CFN_EXPORT extern
-#endif
namespace WebCore {
CFReadStreamOpen(m_readStream.get());
CFWriteStreamOpen(m_writeStream.get());
-#ifndef BUILDING_ON_TIGER
if (m_pacRunLoopSource)
removePACRunLoopSource();
-#endif
m_connectingSubstate = WaitingForConnect;
}
-#ifndef BUILDING_ON_TIGER
CFStringRef SocketStreamHandle::copyPACExecutionDescription(void*)
{
return CFSTR("WebSocket proxy PAC file execution");
m_connectionType = Direct;
}
-#else // BUILDING_ON_TIGER
-
-void SocketStreamHandle::chooseProxy()
-{
- // We don't need proxy information often, so there is no need to set up a permanent dynamic store session.
- RetainPtr<CFDictionaryRef> proxyDictionary(AdoptCF, SCDynamicStoreCopyProxies(0));
-
- // SOCKS or HTTPS (AKA CONNECT) proxies are supported.
- // WebSocket protocol relies on handshake being transferred unchanged, so we need a proxy that will not modify headers.
- // Since HTTP proxies must add Via headers, they are highly unlikely to work.
- // Many CONNECT proxies limit connectivity to port 443, so we prefer SOCKS, if configured.
-
- if (!proxyDictionary) {
- m_connectionType = Direct;
- return;
- }
-
- // FIXME: check proxy bypass list and ExcludeSimpleHostnames.
- // FIXME: Support PAC files.
-
- CFTypeRef socksEnableCF = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesSOCKSEnable);
- int socksEnable;
- if (socksEnableCF && CFGetTypeID(socksEnableCF) == CFNumberGetTypeID() && CFNumberGetValue(static_cast<CFNumberRef>(socksEnableCF), kCFNumberIntType, &socksEnable) && socksEnable) {
- CFTypeRef proxyHost = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesSOCKSProxy);
- CFTypeRef proxyPort = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesSOCKSPort);
- if (proxyHost && CFGetTypeID(proxyHost) == CFStringGetTypeID() && proxyPort && CFGetTypeID(proxyPort) == CFNumberGetTypeID()) {
- m_proxyHost = static_cast<CFStringRef>(proxyHost);
- m_proxyPort = static_cast<CFNumberRef>(proxyPort);
- m_connectionType = SOCKSProxy;
- return;
- }
- }
-
- CFTypeRef httpsEnableCF = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesHTTPSEnable);
- int httpsEnable;
- if (httpsEnableCF && CFGetTypeID(httpsEnableCF) == CFNumberGetTypeID() && CFNumberGetValue(static_cast<CFNumberRef>(httpsEnableCF), kCFNumberIntType, &httpsEnable) && httpsEnable) {
- CFTypeRef proxyHost = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesHTTPSProxy);
- CFTypeRef proxyPort = CFDictionaryGetValue(proxyDictionary.get(), kSCPropNetProxiesHTTPSPort);
-
- if (proxyHost && CFGetTypeID(proxyHost) == CFStringGetTypeID() && proxyPort && CFGetTypeID(proxyPort) == CFNumberGetTypeID()) {
- m_proxyHost = static_cast<CFStringRef>(proxyHost);
- m_proxyPort = static_cast<CFNumberRef>(proxyPort);
- m_connectionType = CONNECTProxy;
- return;
- }
- }
-
- m_connectionType = Direct;
-}
-#endif // BUILDING_ON_TIGER
void SocketStreamHandle::createStreams()
{
return ProtectionSpaceAuthenticationSchemeHTTPBasic;
if (CFEqual(method, kCFHTTPAuthenticationSchemeDigest))
return ProtectionSpaceAuthenticationSchemeHTTPDigest;
-#ifndef BUILDING_ON_TIGER
if (CFEqual(method, kCFHTTPAuthenticationSchemeNTLM))
return ProtectionSpaceAuthenticationSchemeNTLM;
if (CFEqual(method, kCFHTTPAuthenticationSchemeNegotiate))
return ProtectionSpaceAuthenticationSchemeNegotiate;
-#endif
ASSERT_NOT_REACHED();
return ProtectionSpaceAuthenticationSchemeUnknown;
}
ASSERT_NOT_REACHED();
break;
case kCFStreamEventErrorOccurred: {
-#ifndef BUILDING_ON_TIGER
RetainPtr<CFErrorRef> error(AdoptCF, CFReadStreamCopyError(m_readStream.get()));
reportErrorToClient(error.get());
-#else
- CFStreamError error = CFReadStreamGetError(m_readStream.get());
- m_client->didFail(this, SocketStreamError(error.error)); // FIXME: Provide a sensible error.
-#endif
break;
}
case kCFStreamEventEndEncountered:
break;
}
case kCFStreamEventErrorOccurred: {
-#ifndef BUILDING_ON_TIGER
RetainPtr<CFErrorRef> error(AdoptCF, CFWriteStreamCopyError(m_writeStream.get()));
reportErrorToClient(error.get());
-#else
- CFStreamError error = CFWriteStreamGetError(m_writeStream.get());
- m_client->didFail(this, SocketStreamError(error.error)); // FIXME: Provide a sensible error.
-#endif
break;
}
case kCFStreamEventEndEncountered:
}
}
-#ifndef BUILDING_ON_TIGER
void SocketStreamHandle::reportErrorToClient(CFErrorRef error)
{
CFIndex errorCode = CFErrorGetCode(error);
m_client->didFail(this, SocketStreamError(static_cast<int>(errorCode), m_url.string(), description));
}
-#endif // BUILDING_ON_TIGER
SocketStreamHandle::~SocketStreamHandle()
{
LOG(Network, "SocketStreamHandle %p dtor", this);
-#ifndef BUILDING_ON_TIGER
ASSERT(!m_pacRunLoopSource);
-#endif
}
int SocketStreamHandle::platformSend(const char* data, int length)
{
LOG(Network, "SocketStreamHandle %p platformClose", this);
-#ifndef BUILDING_ON_TIGER
if (m_pacRunLoopSource)
removePACRunLoopSource();
-#endif
ASSERT(!m_readStream == !m_writeStream);
if (!m_readStream)
namespace WebCore {
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
// There is no constant in headers, but NTLM is supported.
NSString * const NSURLAuthenticationMethodNTLM = @"NSURLAuthenticationMethodNTLM";
#endif
#include <SystemConfiguration/SystemConfiguration.h>
-#ifdef BUILDING_ON_TIGER
-// This function is available on Tiger, but not declared in the CFRunLoop.h header on Tiger.
-extern "C" CFRunLoopRef CFRunLoopGetMain();
-#endif
namespace WebCore {
#import <wtf/text/CString.h>
#import <wtf/UnusedParam.h>
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-#endif
using namespace WebCore;
- (id)_propertyForKey:(NSString *)key;
@end
-#ifndef BUILDING_ON_TIGER
class WebCoreSynchronousLoaderClient : public ResourceHandleClient {
public:
static NSString *WebCoreSynchronousLoaderRunLoopMode = @"WebCoreSynchronousLoaderRunLoopMode";
-#endif
namespace WebCore {
-#ifdef BUILDING_ON_TIGER
-static unsigned inNSURLConnectionCallback;
-#endif
#ifndef NDEBUG
static bool isInitializingConnection;
public:
CallbackGuard()
{
-#ifdef BUILDING_ON_TIGER
- ++inNSURLConnectionCallback;
-#endif
}
~CallbackGuard()
{
-#ifdef BUILDING_ON_TIGER
- ASSERT(inNSURLConnectionCallback > 0);
- --inNSURLConnectionCallback;
-#endif
}
};
-#ifndef BUILDING_ON_TIGER
static String encodeBasicAuthorization(const String& user, const String& password)
{
return base64Encode((user + ":" + password).utf8());
}
-#endif
ResourceHandleInternal::~ResourceHandleInternal()
{
void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff)
{
// Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
- if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty())
-#ifndef BUILDING_ON_TIGER
- && !firstRequest().url().protocolInHTTPFamily() // On Tiger, always pass credentials in URL, so that they get stored even if the request gets cancelled right away.
-#endif
- ) {
+ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolInHTTPFamily()) {
KURL urlWithCredentials(firstRequest().url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
if (shouldRelaxThirdPartyCookiePolicy(firstRequest().url()))
firstRequest().setFirstPartyForCookies(firstRequest().url());
-#if !defined(BUILDING_ON_TIGER)
if (shouldUseCredentialStorage && firstRequest().url().protocolInHTTPFamily()) {
if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
d->m_connection.adoptNS([[NSURLConnection alloc] initWithRequest:nsRequest delegate:delegate startImmediately:NO]);
return;
-#else
- // Building on Tiger. Don't use WebCore credential storage, don't try to disable content sniffing.
- UNUSED_PARAM(shouldUseCredentialStorage);
- UNUSED_PARAM(shouldContentSniff);
- d->m_connection.adoptNS([[NSURLConnection alloc] initWithRequest:firstRequest().nsURLRequest() delegate:delegate]);
-#endif
}
bool ResourceHandle::start(NetworkingContext* context)
if (!ResourceHandle::didSendBodyDataDelegateExists())
associateStreamWithResourceHandle([firstRequest().nsURLRequest() HTTPBodyStream], this);
-#ifdef BUILDING_ON_TIGER
- // A conditional request sent by WebCore (e.g. to update appcache) can be for a resource that is not cacheable by NSURLConnection,
- // which can get confused and fail to load it in this case.
- if (firstRequest().isConditional())
- firstRequest().setCachePolicy(ReloadIgnoringCacheData);
-#endif
d->m_needsSiteSpecificQuirks = context->needsSiteSpecificQuirks();
shouldUseCredentialStorage,
d->m_shouldContentSniff || context->localFileContentSniffingEnabled());
-#ifndef BUILDING_ON_TIGER
bool scheduled = false;
if (SchedulePairHashSet* scheduledPairs = context->scheduledRunLoopPairs()) {
SchedulePairHashSet::iterator end = scheduledPairs->end();
[connection() start];
else
d->m_startWhenScheduled = true;
-#endif
#ifndef NDEBUG
isInitializingConnection = NO;
void ResourceHandle::schedule(SchedulePair* pair)
{
-#ifndef BUILDING_ON_TIGER
NSRunLoop *runLoop = pair->nsRunLoop();
if (!runLoop)
return;
[d->m_connection.get() start];
d->m_startWhenScheduled = false;
}
-#else
- UNUSED_PARAM(pair);
-#endif
}
void ResourceHandle::unschedule(SchedulePair* pair)
{
-#ifndef BUILDING_ON_TIGER
if (NSRunLoop *runLoop = pair->nsRunLoop())
[d->m_connection.get() unscheduleFromRunLoop:runLoop forMode:(NSString *)pair->mode()];
-#else
- UNUSED_PARAM(pair);
-#endif
}
WebCoreResourceHandleAsDelegate *ResourceHandle::delegate()
bool ResourceHandle::loadsBlocked()
{
-#ifndef BUILDING_ON_TIGER
return false;
-#else
- // On Tiger, if we're in an NSURLConnection callback, that blocks all other NSURLConnection callbacks.
- // On Leopard and newer, it blocks only callbacks on that same NSURLConnection object, which is not
- // a problem in practice.
- return inNSURLConnectionCallback != 0;
-#endif
}
bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*)
{
-#ifndef BUILDING_ON_TIGER
request.setCachePolicy(ReturnCacheDataDontLoad);
NSURLResponse *nsURLResponse = nil;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
END_BLOCK_OBJC_EXCEPTIONS;
return nsURLResponse;
-#else
- // <rdar://problem/6803217> - Re-enable after <rdar://problem/6786454> is resolved.
- UNUSED_PARAM(request);
- return false;
-#endif
}
void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
ASSERT(!request.isEmpty());
-#ifndef BUILDING_ON_TIGER
OwnPtr<WebCoreSynchronousLoaderClient> client = WebCoreSynchronousLoaderClient::create();
client->setAllowStoredCredentials(storedCredentials == AllowStoredCredentials);
[handle->connection() cancel];
-#else
- UNUSED_PARAM(storedCredentials);
- UNUSED_PARAM(context);
- NSURLRequest *firstRequest = request.nsURLRequest();
-
- if (shouldRelaxThirdPartyCookiePolicy([firstRequest URL])) {
- NSMutableURLRequest *mutableRequest = [[firstRequest mutableCopy] autorelease];
- [mutableRequest setMainDocumentURL:[mutableRequest URL]];
- firstRequest = mutableRequest;
- }
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- result = [NSURLConnection sendSynchronousRequest:firstRequest returningResponse:&nsURLResponse error:&nsError];
- END_BLOCK_OBJC_EXCEPTIONS;
-#endif
if (!nsError)
response = nsURLResponse;
return;
}
-#ifndef BUILDING_ON_TIGER
if (!client() || client()->shouldUseCredentialStorage(this)) {
if (!d->m_initialCredential.isEmpty() || challenge.previousFailureCount()) {
// The stored credential wasn't accepted, stop using it.
}
}
}
-#endif
d->m_currentMacChallenge = challenge.nsURLAuthenticationChallenge();
d->m_currentWebChallenge = core(d->m_currentMacChallenge);
return;
}
-#ifdef BUILDING_ON_TIGER
- if (credential.persistence() == CredentialPersistenceNone) {
- // NSURLCredentialPersistenceNone doesn't work on Tiger, so we have to use session persistence.
- Credential webCredential(credential.user(), credential.password(), CredentialPersistenceForSession);
- [[d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];
- } else
-#else
if (credential.persistence() == CredentialPersistenceForSession && (!d->m_needsSiteSpecificQuirks || ![[[mac(challenge) protectionSpace] host] isEqualToString:@"gallery.me.com"])) {
// Manage per-session credentials internally, because once NSURLCredentialPersistenceForSession is used, there is no way
// to ignore it for a particular request (short of removing it altogether).
CredentialStorage::set(webCredential, core([d->m_currentMacChallenge protectionSpace]), urlToStore);
[[d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];
} else
-#endif
[[d->m_currentMacChallenge sender] useCredential:mac(credential) forAuthenticationChallenge:d->m_currentMacChallenge];
clearAuthentication();
m_handle->client()->didFail(m_handle, error);
}
-#ifdef BUILDING_ON_TIGER
-- (void)_callConnectionWillCacheResponseWithInfo:(NSMutableDictionary *)info
-{
- NSURLConnection *connection = [info objectForKey:@"connection"];
- NSCachedURLResponse *cachedResponse = [info objectForKey:@"cachedResponse"];
- NSCachedURLResponse *result = [self connection:connection willCacheResponse:cachedResponse];
- if (result)
- [info setObject:result forKey:@"result"];
-}
-#endif
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse
{
LOG(Network, "Handle %p delegate connection:%p willCacheResponse:%p", m_handle, connection, cachedResponse);
-#ifdef BUILDING_ON_TIGER
- // On Tiger CFURLConnection can sometimes call the connection:willCacheResponse: delegate method on
- // a secondary thread instead of the main thread. If this happens perform the work on the main thread.
- if (!pthread_main_np()) {
- NSMutableDictionary *info = [[NSMutableDictionary alloc] init];
- if (connection)
- [info setObject:connection forKey:@"connection"];
- if (cachedResponse)
- [info setObject:cachedResponse forKey:@"cachedResponse"];
-
- // Include synchronous url connection's mode as an acceptable run loopmode
- // <rdar://problem/5511842>
- NSArray *modes = [[NSArray alloc] initWithObjects:(NSString *)kCFRunLoopCommonModes, @"NSSynchronousURLConnection_PrivateMode", nil];
- [self performSelectorOnMainThread:@selector(_callConnectionWillCacheResponseWithInfo:) withObject:info waitUntilDone:YES modes:modes];
- [modes release];
-
- NSCachedURLResponse *result = [[info valueForKey:@"result"] retain];
- [info release];
-
- return [result autorelease];
- }
-#else
UNUSED_PARAM(connection);
-#endif
#ifndef NDEBUG
if (isInitializingConnection)
@end
-#ifndef BUILDING_ON_TIGER
WebCoreSynchronousLoaderClient::~WebCoreSynchronousLoaderClient()
{
m_isDone = true;
}
-#endif // BUILDING_ON_TIGER
#endif // !USE(CFNETWORK)
#import <Foundation/Foundation.h>
-#ifdef BUILDING_ON_TIGER
-typedef unsigned NSUInteger;
-#endif
@interface NSURLRequest (WebNSURLRequestDetails)
- (NSArray *)contentDispositionEncodingFallbackArray;
m_httpMethod = method;
m_allowCookies = [m_nsRequest.get() HTTPShouldHandleCookies];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
if (ResourceRequest::httpPipeliningEnabled())
m_priority = toResourceLoadPriority(wkGetHTTPPipeliningPriority(m_nsRequest.get()));
#endif
else
nsRequest = [[NSMutableURLRequest alloc] initWithURL:url()];
-#ifdef BUILDING_ON_TIGER
- wkSupportsMultipartXMixedReplace(nsRequest);
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
if (ResourceRequest::httpPipeliningEnabled())
wkSetHTTPPipeliningPriority(nsRequest, toHTTPPipeliningPriority(m_priority));
#endif
- (NSTimeInterval)_calculatedExpiration;
@end
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-#endif
namespace WebCore {
return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position);
}
-#ifndef BUILDING_ON_TIGER
static TextBreakIterator* setUpIteratorWithRules(bool& createdIterator, TextBreakIterator*& iterator,
const char* breakRules, const UChar* string, int length)
{
return iterator;
}
-#endif // BUILDING_ON_TIGER
TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
{
-#ifdef BUILDING_ON_TIGER
- // ICU 3.2 cannot compile the below rules.
- return characterBreakIterator(string, length);
-#else
// This rule set is based on character-break iterator rules of ICU 4.0
// <http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt>.
// The major differences from the original ones are listed below:
static bool createdCursorMovementIterator = false;
static TextBreakIterator* staticCursorMovementIterator;
return setUpIteratorWithRules(createdCursorMovementIterator, staticCursorMovementIterator, kRules, string, length);
-#endif // BUILDING_ON_TIGER
}
}
namespace WebCore {
-#if !defined(BUILDING_ON_TIGER)
#define WTF_USE_GRAMMAR_CHECKING 1
-#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
#define WTF_USE_UNIFIED_TEXT_CHECKING 1
#define WTF_USE_AUTOMATIC_TEXT_REPLACEMENT 1
#endif
#include "TextEncoding.h"
#include <wtf/UnusedParam.h>
-#ifndef BUILDING_ON_TIGER
#include "unicode/ucnv.h"
#include "unicode/ucsdet.h"
-#endif
namespace WebCore {
TextEncoding* detectedEncoding)
{
*detectedEncoding = TextEncoding();
-#ifdef BUILDING_ON_TIGER
- // Tiger came with ICU 3.2 and does not have the encoding detector.
- UNUSED_PARAM(data);
- UNUSED_PARAM(len);
- UNUSED_PARAM(hintEncodingName);
- return false;
-#else
int matchesCount = 0;
UErrorCode status = U_ZERO_ERROR;
UCharsetDetector* detector = ucsdet_open(&status);
}
ucsdet_close(detector);
return false;
-#endif
}
}
#include "config.h"
#include "Hyphenation.h"
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#include "AtomicStringKeyedMRUCache.h"
#include "TextBreakIteratorInternalICU.h"
} // namespace WebCore
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)
+#if PLATFORM(MAC)
#include <objc/objc-auto.h>
#endif
static CFAllocatorRef create()
{
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)
+#if PLATFORM(MAC)
// Since garbage collection isn't compatible with custom allocators, don't use this at all when garbage collection is active.
if (objc_collectingEnabled())
return 0;
#import "config.h"
#import "Hyphenation.h"
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
#import "AtomicStringKeyedMRUCache.h"
#import "TextBreakIteratorInternalICU.h"
} // namespace WebCore
-#endif // defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#endif // defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
int iDescent;
int iLineGap;
unsigned unitsPerEm;
-#ifdef BUILDING_ON_TIGER
- wkGetFontMetrics(cgFont, &iAscent, &iDescent, &iLineGap, &unitsPerEm);
-#else
iAscent = CGFontGetAscent(cgFont);
iDescent = CGFontGetDescent(cgFont);
iLineGap = CGFontGetLeading(cgFont);
unitsPerEm = CGFontGetUnitsPerEm(cgFont);
-#endif
float pointSize = font->GetPointSize();
float fAscent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
float fDescent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo())
return hasBoxDecorationsOrBackground(renderer());
#endif
-#if PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#elif ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS)
if (isAcceleratedCanvas(renderer()))
return hasBoxDecorationsOrBackground(renderer());
if (result == TextBreakDone)
result = current - 1;
-#ifdef BUILDING_ON_TIGER
- // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
- if (static_cast<unsigned>(result) < si->length()) {
- UChar character = (*si)[result];
- if (character == 0xFF9E || character == 0xFF9F)
- --result;
- }
-#endif
return result;
}
if (result == TextBreakDone)
result = current + 1;
-#ifdef BUILDING_ON_TIGER
- // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
- if (static_cast<unsigned>(result) < si->length()) {
- UChar character = (*si)[result];
- if (character == 0xFF9E || character == 0xFF9F)
- ++result;
- }
-#endif
return result;
}
#include "HTMLMeterElement.h"
#endif
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-typedef unsigned NSUInteger;
-#endif
using namespace std;
GraphicsContextStateSaver stateSaver(*paintInfo.context);
-#ifndef BUILDING_ON_TIGER
// On Leopard, the cell will draw outside of the given rect, so we have to clip to the rect
paintInfo.context->clip(inflatedRect);
-#endif
if (zoomLevel != 1.0f) {
inflatedRect.setWidth(inflatedRect.width() / zoomLevel);
[search setSearchButtonCell:nil];
[search drawWithFrame:NSRect(unzoomedRect) inView:documentViewFor(o)];
-#ifdef BUILDING_ON_TIGER
- if ([search showsFirstResponder])
- wkDrawTextFieldCellFocusRing(search, NSRect(unzoomedRect));
-#endif
[search setControlView:nil];
[search resetSearchButtonCell];
Boolean validKey;
Boolean useQTMediaUIPref = CFPreferencesGetAppBooleanValue(CFSTR("UseQuickTimeMediaUI"), CFSTR("com.apple.WebCore"), &validKey);
-#if !defined(BUILDING_ON_TIGER)
if (validKey && !useQTMediaUIPref)
return controllerTheme;
-#else
- if (!validKey || !useQTMediaUIPref)
- return controllerTheme;
-#endif
controllerTheme = MediaControllerThemeQuickTime;
return controllerTheme;
bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
return true;
#else
return false;
return ch > asciiLineBreakTableLastChar && ch != noBreakSpace;
}
-#if PLATFORM(MAC) && defined(BUILDING_ON_TIGER)
-static inline TextBreakLocatorRef lineBreakLocator()
-{
- TextBreakLocatorRef locator = 0;
- UCCreateTextBreakLocator(0, 0, kUCTextBreakLineMask, &locator);
- return locator;
-}
-#endif
-
int nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator, int pos, bool treatNoBreakSpaceAsBreak)
{
const UChar* str = lazyBreakIterator.string();
if (needsLineBreakIterator(ch) || needsLineBreakIterator(lastCh)) {
if (nextBreak < i && i) {
-#if !PLATFORM(MAC) || !defined(BUILDING_ON_TIGER)
TextBreakIterator* breakIterator = lazyBreakIterator.get();
if (breakIterator)
nextBreak = textBreakFollowing(breakIterator, i - 1);
-#else
- static TextBreakLocatorRef breakLocator = lineBreakLocator();
- if (breakLocator) {
- UniCharArrayOffset nextUCBreak;
- if (UCFindTextBreak(breakLocator, kUCTextBreakLineMask, 0, str, len, i, &nextUCBreak) == 0)
- nextBreak = nextUCBreak;
- }
-#endif
}
if (i == nextBreak && !isBreakableSpace(lastCh, treatNoBreakSpaceAsBreak))
return i;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
// Given a reference to a Carbon window that is to be encapsulated, and an indicator of whether or not this object should take responsibility for disposing of the Carbon window, initialize.
*/
static const OSType NSCarbonWindowPropertyTag = 'win ';
-#ifdef BUILDING_ON_TIGER
-const int typeByteCount = typeSInt32;
-#endif
static SEL _NSSelectorForHICommand( const HICommand* hiCommand );
}
}
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
#define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 1
#else
#define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 0
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)init
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)init
endif
REPLACE_RULES = -e s/\<WebCore/\<WebKit/ -e s/DOMDOMImplementation/DOMImplementation/
-HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $< $(PROCESS_HEADER_FOR_MACOSX_TARGET_CMD) > $@
-
-ifeq ($(MACOSX_DEPLOYMENT_TARGET),10.4)
-PROCESS_HEADER_FOR_MACOSX_TARGET_CMD = | ( unifdef -DBUILDING_ON_TIGER || exit 0 )
-else
-PROCESS_HEADER_FOR_MACOSX_TARGET_CMD = | ( unifdef -UBUILDING_ON_TIGER || exit 0 )
-endif
+HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $< > $@
$(PUBLIC_HEADERS_DIR)/DOM% : DOMDOM% MigrateHeaders.make
$(HEADER_MIGRATE_CMD)
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
+ (void)initializeLookupTable
[userInfo setObject:localizedDescription forKey:NSLocalizedDescriptionKey];
if (contentURL) {
[userInfo setObject:contentURL forKey:@"NSErrorFailingURLKey"];
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
[userInfo setObject:[contentURL _web_userVisibleString] forKey:NSErrorFailingURLStringKey];
#else
[userInfo setObject:[contentURL _web_userVisibleString] forKey:NSURLErrorFailingURLStringErrorKey];
NSString *cacheDir = [defaults objectForKey:WebKitLocalCacheDefaultsKey];
if (!cacheDir || ![cacheDir isKindOfClass:[NSString class]]) {
-#ifdef BUILDING_ON_TIGER
- cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
-#else
char cacheDirectory[MAXPATHLEN];
size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN);
if (cacheDirectoryLen)
cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1];
-#endif
}
return [cacheDir stringByAppendingPathComponent:bundleIdentifier];
@end
-#ifdef BUILDING_ON_TIGER
-@interface NSFileManager (WebNSFileManagerTigerForwardCompatibility)
-- (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error;
-- (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error;
-- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error;
-- (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error;
-- (NSString *)destinationOfSymbolicLinkAtPath:(NSString *)path error:(NSError **)error;
-- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error;
-@end
-#endif
@end
-#ifdef BUILDING_ON_TIGER
-
-@implementation NSFileManager (WebNSFileManagerTigerForwardCompatibility)
-
-- (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error
-{
- // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
- ASSERT_ARG(error, !error);
-
- return [self directoryContentsAtPath:path];
-}
-
-- (NSString *)destinationOfSymbolicLinkAtPath:(NSString *)path error:(NSError **)error
-{
- // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
- ASSERT_ARG(error, !error);
-
- return [self pathContentOfSymbolicLinkAtPath:path];
-}
-
-- (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error
-{
- // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
- ASSERT_ARG(error, !error);
-
- return [self fileSystemAttributesAtPath:path];
-}
-
-- (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error
-{
- // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so.
- ASSERT_ARG(error, !error);
-
- return [self fileAttributesAtPath:path traverseLink:NO];
-}
-
-- (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error
-{
- // The implementation of moveItemAtPath:toPath:error: interacts with the NSFileManager's delegate.
- // We are not matching that behaviour at the moment, but it should not be a problem as any client
- // expecting that would need to call setDelegate: first which will generate a compile-time warning,
- // as that method is not available on Tiger.
- return [self movePath:srcPath toPath:dstPath handler:nil];
-}
-
-- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error
-{
- // The implementation of removeItemAtPath:error: interacts with the NSFileManager's delegate.
- // We are not matching that behaviour at the moment, but it should not be a problem as any client
- // expecting that would need to call setDelegate: first which will generate a compile-time warning,
- // as that method is not available on Tiger.
- return [self removeFileAtPath:path handler:nil];
-}
-
-@end
-
-#endif
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef BUILDING_ON_TIGER
-typedef int NSInteger;
-typedef unsigned int NSUInteger;
-#endif
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
WKSendUserChangeNotifications();
}
- (NSRect)actualVisibleRectInWindow; // takes transforms into account.
-#ifndef BUILDING_ON_TIGER
- (CALayer *)pluginLayer;
-#endif
@end
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
WKSendUserChangeNotifications();
}
_baseURL.adoptNS([baseURL copy]);
_MIMEType.adoptNS([MIME copy]);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// Enable "kiosk mode" when instantiating the QT plug-in inside of Dashboard. See <rdar://problem/6878105>
if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.dashboard.client"] &&
[_pluginPackage.get() bundleIdentifier] == "com.apple.QuickTime Plugin.plugin") {
ASSERT(!_isHalted);
ASSERT(_isStarted);
Element *element = [self element];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
CGImageRef cgImage = CGImageRetain([core([self webFrame])->nodeImage(element).get() CGImageForProposedRect:nil context:nil hints:nil]);
#else
RetainPtr<CGImageSourceRef> imageRef(AdoptCF, CGImageSourceCreateWithData((CFDataRef)[core([self webFrame])->nodeImage(element).get() TIFFRepresentation], 0));
return intersection(toRenderWidget(renderer)->windowClipRect(), widgetRect);
}
-#ifndef BUILDING_ON_TIGER
- (CALayer *)pluginLayer
{
ASSERT_NOT_REACHED();
return nil;
}
-#endif
@end
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
+ (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath
#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBasePluginPackage.h"
-#ifdef BUILDING_ON_TIGER
-typedef short ResFileRefNum;
-#endif
#if defined(__ppc__) && !defined(__LP64__)
#define SUPPORT_CFM
@interface WebNetscapePluginView : WebBaseNetscapePluginView<WebPluginManualLoader, WebPluginContainerCheckController>
{
RefPtr<WebNetscapePluginStream> _manualStream;
-#ifndef BUILDING_ON_TIGER
RetainPtr<CALayer> _pluginLayer;
-#endif
unsigned _dataLengthReceived;
RetainPtr<NSError> _error;
@interface WebNetscapePluginView (WebInternal)
- (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect;
- (NPEventModel)eventModel;
-#ifndef BUILDING_ON_TIGER
- (CALayer *)pluginLayer;
-#endif
- (NPError)loadRequest:(NSURLRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification;
- (NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData;
- (NPError)getURL:(const char *)URL target:(const char *)target;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
WKSendUserChangeNotifications();
}
}
#endif // NP_NO_CARBON
-#ifndef BUILDING_ON_TIGER
if (drawingModel == NPDrawingModelCoreAnimation) {
void *value = 0;
if ([_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) {
ASSERT(_pluginLayer);
}
-#endif
// Create the event handler
_eventHandler = WebNetscapePluginEventHandler::create(self);
return YES;
}
-#ifndef BUILDING_ON_TIGER
// FIXME: This method is an ideal candidate to move up to the base class
- (CALayer *)pluginLayer
{
[newLayer addSublayer:_pluginLayer.get()];
}
}
-#endif
- (void)loadStream
{
// Setting the window type to 0 ensures that NPP_SetWindow will be called if the plug-in is restarted.
lastSetWindow.type = (NPWindowType)0;
-#ifndef BUILDING_ON_TIGER
_pluginLayer = 0;
-#endif
[self _destroyPlugin];
[_pluginPackage.get() close];
[self cancelCheckIfAllowedToLoadURL:[[check contextInfo] checkRequestID]];
}
-#ifdef BUILDING_ON_TIGER
-// The Tiger compiler requires these two methods be present. Otherwise it doesn't think WebNetscapePluginView
-// conforms to the WebPluginContainerCheckController protocol.
-- (WebView *)webView
-{
- return [super webView];
-}
-
-- (WebFrame *)webFrame
-{
- return [super webFrame];
-}
-#endif
// MARK: NSVIEW
case NPNVsupportsCoreAnimationBool:
{
-#ifdef BUILDING_ON_TIGER
- *(NPBool *)value = FALSE;
-#else
*(NPBool *)value = TRUE;
-#endif
return NPERR_NO_ERROR;
}
case NPDrawingModelQuickDraw:
#endif
case NPDrawingModelCoreGraphics:
-#ifndef BUILDING_ON_TIGER
case NPDrawingModelCoreAnimation:
-#endif
drawingModel = newDrawingModel;
return NPERR_NO_ERROR;
break;
}
case NPNURLVProxy: {
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
if (!value)
break;
// For now, we'll distinguish older broken versions of Silverlight by asking the plug-in if it resolved its full screen badness.
- (void)_workaroundSilverlightFullscreenBug:(BOOL)initializedPlugin
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
ASSERT(_isSilverlight);
NPBool isFullscreenPerformanceIssueFixed = 0;
NPPluginFuncs *pluginFuncs = [_pluginPackage.get() pluginFuncs];
#ifndef CorrectionPanel_h
#define CorrectionPanel_h
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#import <AppKit/NSSpellChecker.h>
#import <WebCore/SpellingCorrectionController.h>
#import <wtf/RetainPtr.h>
RetainPtr<NSCondition> m_resultCondition;
};
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#endif // CorrectionPanel_h
#import "WebViewPrivate.h"
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
using namespace WebCore;
static inline NSCorrectionIndicatorType correctionIndicatorType(CorrectionPanelInfo::PanelType panelType)
[m_resultCondition.get() unlock];
}
-#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#endif // !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
bool WebChromeClient::selectItemWritingDirectionIsNatural()
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
return false;
#else
return true;
bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
return true;
#else
return false;
virtual void setInsertionPasteboard(NSPasteboard *);
virtual NSURL* canonicalizeURL(NSURL*);
virtual NSURL* canonicalizeURLString(NSString*);
-#ifdef BUILDING_ON_TIGER
- virtual NSArray *pasteboardTypesForSelection(WebCore::Frame*);
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
virtual void uppercaseWord();
virtual void lowercaseWord();
virtual void capitalizeWord();
virtual void willSetInputMethodState();
virtual void setInputMethodState(bool enabled);
virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel);
virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel);
RetainPtr<WebEditorUndoTarget> m_undoTarget;
bool m_haveUndoRedoOperations;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
CorrectionPanel m_correctionPanel;
#endif
};
using namespace HTMLNames;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
@interface NSSpellChecker (WebNSSpellCheckerDetails)
- (NSString *)languageForWordRange:(NSRange)range inString:(NSString *)string orthography:(NSOrthography *)orthography;
@end
static const int InvalidCorrectionPanelTag = 0;
-#ifdef BUILDING_ON_TIGER
-@interface NSSpellChecker (NotYetPublicMethods)
-- (void)learnWord:(NSString *)word;
-@end
-#endif
@interface WebEditCommand : NSObject
{
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)initWithEditCommand:(PassRefPtr<EditCommand>)command
WebEditorClient::~WebEditorClient()
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
dismissCorrectionPanel(ReasonForDismissingCorrectionPanelIgnored);
#endif
}
bool WebEditorClient::isGrammarCheckingEnabled()
{
-#ifdef BUILDING_ON_TIGER
- return false;
-#else
return [m_webView isGrammarCheckingEnabled];
-#endif
}
void WebEditorClient::toggleGrammarChecking()
{
-#ifndef BUILDING_ON_TIGER
[m_webView toggleGrammarChecking:nil];
-#endif
}
int WebEditorClient::spellCheckerDocumentTag()
[m_webView _setInsertionPasteboard:pasteboard];
}
-#ifdef BUILDING_ON_TIGER
-NSArray *WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
-{
- WebFrame* frame = kit(selectedFrame);
- return [[[frame frameView] documentView] pasteboardTypesForSelection];
-}
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
void WebEditorClient::uppercaseWord()
{
[m_webView uppercaseWord:nil];
void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector<GrammarDetail>& details, int* badGrammarLocation, int* badGrammarLength)
{
-#ifndef BUILDING_ON_TIGER
NSArray *grammarDetails;
NSString* textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
NSRange range = [[NSSpellChecker sharedSpellChecker] checkGrammarOfString:textString startingAt:0 language:nil wrap:NO inSpellDocumentWithTag:spellCheckerDocumentTag() details:&grammarDetails];
grammarDetail.guesses.append(String(guess));
details.append(grammarDetail);
}
-#endif
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
static Vector<TextCheckingResult> core(NSArray *incomingResults, TextCheckingTypeMask checkingTypes)
{
Vector<TextCheckingResult> results;
void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
[textString release];
void WebEditorClient::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
{
-#ifndef BUILDING_ON_TIGER
NSMutableArray* corrections = [NSMutableArray array];
for (unsigned i = 0; i < grammarDetail.guesses.size(); i++) {
NSString* guess = grammarDetail.guesses[i];
NSMutableDictionary* grammarDetailDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithRange:grammarRange], NSGrammarRange, grammarUserDescription, NSGrammarUserDescription, corrections, NSGrammarCorrections, nil];
[[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithGrammarString:badGrammarPhrase detail:grammarDetailDict];
-#endif
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
void WebEditorClient::showCorrectionPanel(CorrectionPanelInfo::PanelType panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
{
m_correctionPanel.show(m_webView, panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
void WebEditorClient::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) {
guesses.clear();
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
NSString* language = nil;
NSOrthography* orthography = nil;
NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
{
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
@interface WebEditorSpellCheckResponder : NSObject
{
WebCore::SpellChecker* _sender;
void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, WebCore::TextCheckingTypeMask checkingTypes, const String& text)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSRange range = NSMakeRange(0, text.length());
NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
[[NSSpellChecker sharedSpellChecker] requestCheckingOfString:text range:range types:NSTextCheckingAllSystemTypes options:0 inSpellDocumentWithTag:0
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)initWithWebCoreFrame:(Frame*)frame
[preferences setTabsToLinks:NO];
[preferences setMinimumFontSize:0];
[preferences setMinimumLogicalFontSize:9];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[preferences setFixedFontFamily:@"Menlo"];
[preferences setDefaultFixedFontSize:11];
#else
NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask);
-#ifndef BUILDING_ON_TIGER
styleMask |= NSTexturedBackgroundWindowMask;
-#endif
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
[window setDelegate:self];
[window setMinSize:NSMakeSize(400.0, 400.0)];
-#ifndef BUILDING_ON_TIGER
[window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
[window setContentBorderThickness:55. forEdge:NSMaxYEdge];
WKNSWindowMakeBottomCornersSquare(window);
-#endif
[self setWindow:window];
[window release];
INIT(QTClearMediaDownloadCacheForSite);
INIT(QTClearMediaDownloadCache);
-#ifndef BUILDING_ON_TIGER
INIT(GetGlyphsForCharacters);
-#else
- INIT(ClearGlyphVector);
- INIT(ConvertCharToGlyphs);
- INIT(CopyFullFontName);
- INIT(GetATSStyleGroup);
- INIT(GetCGFontFromNSFont);
- INIT(GetFontMetrics);
- INIT(GetGlyphVectorFirstRecord);
- INIT(GetGlyphVectorNumGlyphs);
- INIT(GetGlyphVectorRecordSize);
- INIT(GetNSFontATSUFontId);
- INIT(InitializeGlyphVector);
- INIT(ReleaseStyleGroup);
- INIT(SupportsMultipartXMixedReplace);
-#endif
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
INIT(GetHyphenationLocationBeforeIndex);
INIT(GetNSEventMomentumPhase);
#endif
INIT(CreateCTLineWithUniCharProvider);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
INIT(IOSurfaceContextCreate);
INIT(IOSurfaceContextCreateImage);
INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)init
- (void)_immediateScrollToPoint:(NSPoint)newOrigin;
@end
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
@interface NSWindow (WebNSWindowDetails)
- (void)_disableDelayedWindowDisplay;
- (void)_enableDelayedWindowDisplay;
{
_isScrolling = YES;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[[self window] _disableDelayedWindowDisplay];
#endif
[super _immediateScrollToPoint:newOrigin];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[[self window] _enableDelayedWindowDisplay];
#endif
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (void)dealloc
static inline bool needsDataLoadWorkaround(WebView *webView)
{
-#ifdef BUILDING_ON_TIGER
- // Tiger has to be a little less efficient.
- id frameLoadDelegate = [webView frameLoadDelegate];
- if (!frameLoadDelegate)
- return false;
-
- NSString *bundleIdentifier = [[NSBundle bundleForClass:[frameLoadDelegate class]] bundleIdentifier];
-
- if ([bundleIdentifier isEqualToString:@"com.apple.AppKit"])
- return true;
- if ([bundleIdentifier isEqualToString:@"com.adobe.Installers.Setup"])
- return true;
- return false;
-#else
static bool needsWorkaround = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_ADOBE_INSTALLER_QUIRK)
&& [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.adobe.Installers.Setup"];
return needsWorkaround;
-#endif
}
void WebDocumentLoaderMac::setDataSource(WebDataSource *dataSource, WebView *webView)
{
_private->suppressScrollers = suppressed;
- // This code was originally changes for a Leopard performance imporvement. We decided to
- // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>.
-#ifndef BUILDING_ON_TIGER
if (suppressed) {
[[self verticalScroller] setNeedsDisplay:NO];
[[self horizontalScroller] setNeedsDisplay:NO];
if (!suppressed && repaint)
[super reflectScrolledClipView:[self contentView]];
-#else
- if (suppressed || repaint) {
- [[self verticalScroller] setNeedsDisplay:!suppressed];
- [[self horizontalScroller] setNeedsDisplay:!suppressed];
- }
-#endif
}
- (void)adjustForScrollOriginChange
[self updateScrollers];
}
- // This code was originally changed for a Leopard performance imporvement. We decided to
- // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>.
-#ifndef BUILDING_ON_TIGER
// Update the scrollers if they're not being suppressed.
if (!_private->suppressScrollers)
[super reflectScrolledClipView:clipView];
-#else
- [super reflectScrolledClipView:clipView];
-
- // Validate the scrollers if they're being suppressed.
- if (_private->suppressScrollers) {
- [[self verticalScroller] setNeedsDisplay:NO];
- [[self horizontalScroller] setNeedsDisplay:NO];
- }
-#endif
// The call to [NSView reflectScrolledClipView] sets the scrollbar thumb
// position to 0 (the left) when the view is initially displayed.
BOOL isContinuous;
WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
NSEventPhase momentumPhase = [event momentumPhase];
BOOL isLatchingEvent = momentumPhase & NSEventPhaseBegan || momentumPhase & NSEventPhaseChanged;
#else
return _private->internalLoadDelegate;
}
-#ifndef BUILDING_ON_TIGER
- (void)_unmarkAllBadGrammar
{
Frame* coreFrame = _private->coreFrame;
document->markers()->removeMarkers(DocumentMarker::Grammar);
}
}
-#endif
- (void)_unmarkAllMisspellings
{
- (void)_updateBackgroundAndUpdatesWhileOffscreen;
- (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
- (id)_internalLoadDelegate;
-#ifndef BUILDING_ON_TIGER
- (void)_unmarkAllBadGrammar;
-#endif
- (void)_unmarkAllMisspellings;
- (BOOL)_hasSelection;
// FIXME: Remove the NSAppKitVersionNumberWithDeferredWindowDisplaySupport check once
// once AppKit's Deferred Window Display support is available.
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || !defined(NSAppKitVersionNumberWithDeferredWindowDisplaySupport)
+#if defined(BUILDING_ON_LEOPARD) || !defined(NSAppKitVersionNumberWithDeferredWindowDisplaySupport)
// CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is NO
// or has no value. For compatibility with Mac OS X 10.5 and lower, deferred updates are off by default.
if (![[NSUserDefaults standardUserDefaults] boolForKey:WebKitEnableDeferredUpdatesPreferenceKey])
#endif
@interface WebFullscreenWindow : NSWindow
-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER)
+#ifndef BUILDING_ON_LEOPARD
<NSAnimationDelegate>
#endif
{
- (void)windowDidLoad
{
-#ifdef BUILDING_ON_TIGER
- // WebFullScreenController is not supported on Tiger:
- ASSERT_NOT_REACHED();
-#else
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp];
-#endif
}
#pragma mark -
- (void)setElement:(PassRefPtr<Element>)element
{
-#ifdef BUILDING_ON_TIGER
- // WebFullScreenController is not supported on Tiger:
- ASSERT_NOT_REACHED();
-#else
// When a new Element is set as the current full screen element, register event
// listeners on that Element's window, listening for changes in media play states.
// We will use these events to determine whether to disable the screensaver and
window->addEventListener(eventNames.endedEvent, _mediaEventListener, true);
}
}
-#endif
}
- (RenderBox*)renderer
- (void)setRenderer:(RenderBox*)renderer
{
-#ifdef BUILDING_ON_TIGER
- // WebFullScreenController is not supported on Tiger:
- ASSERT_NOT_REACHED();
-#else
_renderer = renderer;
-#endif
}
#pragma mark -
- (void)_updateMenuAndDockForFullscreen
{
// NSApplicationPresentationOptions is available on > 10.6 only:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
NSScreen* fullscreenScreen = [[self window] screen];
SetSystemUIMode(_isFullscreen ? kUIModeNormal : kUIModeAllHidden, 0);
}
-#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5
- (void)_disableIdleDisplaySleep
{
if (_idleDisplaySleepAssertion == kIOPMNullAssertionID)
{
UpdateSystemActivity(OverallAct);
}
-#endif
- (void)_updatePowerAssertions
{
-#if !defined(BUILDING_ON_TIGER)
BOOL isPlaying = [self _isAnyMoviePlaying];
if (isPlaying && _isFullscreen) {
[self _enableIdleDisplaySleep];
[self _disableTickleTimer];
}
-#endif
}
- (void)_requestExit
{
static const CFTimeInterval defaultDuration = 0.5;
CFTimeInterval duration = defaultDuration;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSUInteger modifierFlags = [NSEvent modifierFlags];
#else
NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags];
[self setAcceptsMouseMovedEvents:YES];
[self setReleasedWhenClosed:NO];
[self setHasShadow:YES];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[self setMovable:NO];
#else
[self setMovableByWindowBackground:NO];
_backgroundLayer = [[CALayer alloc] init];
[contentLayer addSublayer:_backgroundLayer];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[contentLayer setGeometryFlipped:YES];
#else
[contentLayer setSublayerTransform:CATransform3DMakeScale(1, -1, 1)];
return true;
}
-#ifndef BUILDING_ON_TIGER
static IMP oldSetCursorForMouseLocationIMP;
oldSetCursorForMouseLocationIMP(self, cmd, point);
}
-#else
-
-static IMP oldResetCursorRectsIMP;
-static IMP oldSetCursorIMP;
-static BOOL canSetCursor = YES;
-
-static void resetCursorRects(NSWindow* self, SEL cmd)
-{
- canSetCursor = needsCursorRectsSupportAtPoint(self, [self mouseLocationOutsideOfEventStream]);
- oldResetCursorRectsIMP(self, cmd);
- canSetCursor = YES;
-}
-
-static void setCursor(NSCursor* self, SEL cmd)
-{
- if (canSetCursor)
- oldSetCursorIMP(self, cmd);
-}
-
-#endif
extern "C" {
- (void)_web_clearPrintingModeRecursive;
@end
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
@interface WebHTMLView (WebHTMLViewTextCheckingInternal)
- (void)orderFrontSubstitutionsPanel:(id)sender;
BOOL _forceUpdateSecureInputState;
NSPoint lastScrollPosition;
-#ifndef BUILDING_ON_TIGER
BOOL inScrollPositionChanged;
-#endif
WebPluginController *pluginController;
NSMutableDictionary *highlighters;
-#ifdef BUILDING_ON_TIGER
- BOOL nextResponderDisabledOnce;
-#endif
WebTextCompletionController *completionController;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
-#ifndef BUILDING_ON_TIGER
if (!oldSetCursorForMouseLocationIMP) {
Method setCursorMethod = class_getInstanceMethod([NSWindow class], @selector(_setCursorForMouseLocation:));
ASSERT(setCursorMethod);
}
#endif // USE(ACCELERATED_COMPOSITING)
-#else // defined(BUILDING_ON_TIGER)
- if (!oldSetCursorIMP) {
- Method setCursorMethod = class_getInstanceMethod([NSCursor class], @selector(set));
- ASSERT(setCursorMethod);
- oldSetCursorIMP = method_setImplementation(setCursorMethod, (IMP)setCursor);
- ASSERT(oldSetCursorIMP);
- }
- if (!oldResetCursorRectsIMP) {
- Method resetCursorRectsMethod = class_getInstanceMethod([NSWindow class], @selector(resetCursorRects));
- ASSERT(resetCursorRectsMethod);
- oldResetCursorRectsIMP = method_setImplementation(resetCursorRectsMethod, (IMP)resetCursorRects);
- ASSERT(oldResetCursorRectsIMP);
- }
-#endif
}
subresources:0]))
return fragment;
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if ([types containsObject:NSPICTPboardType] &&
(fragment = [self _documentFragmentFromPasteboard:pasteboard
forType:NSPICTPboardType
DOMRange *range = [self _selectedRange];
Frame* coreFrame = core([self _frame]);
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText];
if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted])
coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false);
if (!NSEqualPoints(_private->lastScrollPosition, origin) && ![scrollView inProgrammaticScroll]) {
if (Frame* coreFrame = core([self _frame])) {
if (FrameView* coreView = coreFrame->view()) {
-#ifndef BUILDING_ON_TIGER
_private->inScrollPositionChanged = YES;
-#endif
coreView->scrollPositionChangedViaPlatformWidget();
-#ifndef BUILDING_ON_TIGER
_private->inScrollPositionChanged = NO;
-#endif
}
}
}
#endif
-#ifdef BUILDING_ON_TIGER
-
-// This is called when we are about to draw, but before our dirty rect is propagated to our ancestors.
-// That's the perfect time to do a layout, except that ideally we'd want to be sure that we're dirty
-// before doing it. As a compromise, when we're opaque we do the layout only when actually asked to
-// draw, but when we're transparent we do the layout at this stage so views behind us know that they
-// need to be redrawn (in case the layout causes some things to get dirtied).
-- (void)_propagateDirtyRectsToOpaqueAncestors
-{
- if (![[self _webView] drawsBackground])
- [self _web_updateLayoutAndStyleIfNeededRecursive];
- [super _propagateDirtyRectsToOpaqueAncestors];
-}
-
-#else
- (void)viewWillDraw
{
[super viewWillDraw];
}
-#endif
// Don't let AppKit even draw subviews. We take care of that.
- (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView
if (isPrinting) {
if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
-#ifndef BUILDING_ON_TIGER
else
[self _web_updateLayoutAndStyleIfNeededRecursive];
-#endif
} else if (wasInPrintingMode)
[self _web_clearPrintingModeRecursive];
-#ifndef BUILDING_ON_TIGER
// There are known cases where -viewWillDraw is not called on all views being drawn.
// See <rdar://problem/6964278> for example. Performing layout at this point prevents us from
// trying to paint without layout (which WebCore now refuses to do, instead bailing out without
[self _web_updateLayoutAndStyleIfNeededRecursive];
}
}
-#else
- // Because Tiger does not have viewWillDraw we need to do layout here.
- [self _web_updateLayoutAndStyleIfNeededRecursive];
- [_subviews makeObjectsPerformSelector:@selector(_propagateDirtyRectsToOpaqueAncestors)];
-#endif
[self _setAsideSubviews];
[super _recursiveDisplayRectIfNeededIgnoringOpacity:rect isVisibleRect:isVisibleRect rectIsVisibleRectForView:visibleView topView:topView];
if (isPrinting) {
if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
-#ifndef BUILDING_ON_TIGER
else
[self _web_updateLayoutAndStyleIfNeededRecursive];
-#endif
} else if (wasInPrintingMode)
[self _web_clearPrintingModeRecursive];
-#ifdef BUILDING_ON_TIGER
-
- // Because Tiger does not have viewWillDraw we need to do layout here.
- NSRect boundsBeforeLayout = [self bounds];
- if (!NSIsEmptyRect(visRect))
- [self _web_updateLayoutAndStyleIfNeededRecursive];
-
- // If layout changes the view's bounds, then we need to recompute the visRect.
- // That's because the visRect passed to us was based on the bounds at the time
- // we were called. This method is only displayed to draw "all", so it's safe
- // to just call visibleRect to compute the entire rectangle.
- if (!NSEqualRects(boundsBeforeLayout, [self bounds]))
- visRect = [self visibleRect];
-
-#endif
[self _setAsideSubviews];
}
// Don't let AppKit even draw subviews. We take care of that.
- (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView
{
-#ifdef BUILDING_ON_TIGER
- // Because Tiger does not have viewWillDraw we need to do layout here.
- [self _web_updateLayoutAndStyleIfNeededRecursive];
-#endif
[self _setAsideSubviews];
[super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context topView:topView];
static NSArray *types = nil;
if (!types) {
types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType,
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
NSPICTPboardType,
#endif
NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, kUTTypePNG, nil];
[resource release];
return fragment;
}
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
if (pboardType == NSPICTPboardType) {
WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:NSPICTPboardType]
URL:uniqueURLWithRelativePart(@"image.pict")
&& [filename _webkit_hasCaseInsensitiveSuffix:@".jpg"]);
}
-#ifdef BUILDING_ON_TIGER
-
-// The following is a workaround for
-// <rdar://problem/3429631> window stops getting mouse moved events after first tooltip appears
-// The trick is to define a category on NSToolTipPanel that implements setAcceptsMouseMovedEvents:.
-// Since the category will be searched before the real class, we'll prevent the flag from being
-// set on the tool tip panel.
-
-@interface NSToolTipPanel : NSPanel
-@end
-
-@interface NSToolTipPanel (WebHTMLViewFileInternal)
-@end
-
-@implementation NSToolTipPanel (WebHTMLViewFileInternal)
-
-- (void)setAcceptsMouseMovedEvents:(BOOL)flag
-{
- // Do nothing, preventing the tool tip panel from trying to accept mouse-moved events.
-}
-
-@end
-
-#endif
@implementation WebHTMLView
returnTypes:[[self class] _insertablePasteboardTypes]];
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)initWithFrame:(NSRect)frame
return [self _canEdit];
if (action == @selector(showGuessPanel:)) {
-#ifndef BUILDING_ON_TIGER
// Match OS X AppKit behavior for post-Tiger. Don't change Tiger behavior.
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
? UI_STRING_INTERNAL("Hide Spelling and Grammar", "menu item title")
: UI_STRING_INTERNAL("Show Spelling and Grammar", "menu item title")];
}
-#endif
return [self _canEdit];
}
if (action == @selector(stopSpeaking:))
return [NSApp isSpeaking];
-#ifndef BUILDING_ON_TIGER
if (action == @selector(toggleGrammarChecking:)) {
// FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must validate
// the selector here because we implement it here, and we must implement it here because the AppKit
[menuItem setState:[self isGrammarCheckingEnabled] ? NSOnState : NSOffState];
return YES;
}
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
if (action == @selector(orderFrontSubstitutionsPanel:)) {
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
}
#endif
-#ifndef BUILDING_ON_TIGER
- (void)setNeedsDisplayInRect:(NSRect)invalidRect
{
if (_private->inScrollPositionChanged) {
}
[super setNeedsDisplayInRect:invalidRect];
}
-#endif
- (void)setNeedsLayout: (BOOL)flag
{
}
NSPanel *spellingPanel = [checker spellingPanel];
-#ifndef BUILDING_ON_TIGER
- // Post-Tiger, this menu item is a show/hide toggle, to match AppKit. Leave Tiger behavior alone
- // to match rest of OS X.
if ([spellingPanel isVisible]) {
[spellingPanel orderOut:sender];
return;
}
-#endif
if (Frame* coreFrame = core([self _frame]))
coreFrame->editor()->advanceToNextMisspelling(true);
static BOOL writingDirectionKeyBindingsEnabled()
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
return YES;
#else
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[self _changeBaseWritingDirectionTo:NSWritingDirectionRightToLeft];
}
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
- (void)changeBaseWritingDirectionToLTR:(id)sender
{
[self makeBaseWritingDirectionLeftToRight:sender];
#endif
-#ifndef BUILDING_ON_TIGER
// Override this so that AppKit will send us arrow keys as key down events so we can
// support them via the key bindings mechanism.
return haveWebCoreFrame;
}
-#else
-
-// Super-hack alert.
-// All this code accomplishes the same thing as the _wantsKeyDownForEvent method above.
-
-// Returns a selector only if called while:
-// 1) first responder is self
-// 2) handling a key down event
-// 3) not yet inside keyDown: method
-// 4) key is an arrow key
-// The selector is the one that gets sent by -[NSWindow _processKeyboardUIKey] for this key.
-- (SEL)_arrowKeyDownEventSelectorIfPreprocessing
-{
- NSWindow *w = [self window];
- if ([w firstResponder] != self)
- return NULL;
- NSEvent *e = [w currentEvent];
- if ([e type] != NSKeyDown)
- return NULL;
- if (e == _private->keyDownEvent)
- return NULL;
- NSString *s = [e charactersIgnoringModifiers];
- if ([s length] == 0)
- return NULL;
- switch ([s characterAtIndex:0]) {
- case NSDownArrowFunctionKey:
- return @selector(moveDown:);
- case NSLeftArrowFunctionKey:
- return @selector(moveLeft:);
- case NSRightArrowFunctionKey:
- return @selector(moveRight:);
- case NSUpArrowFunctionKey:
- return @selector(moveUp:);
- default:
- return NULL;
- }
-}
-
-// Returns NO instead of YES if called on the selector that the
-// _arrowKeyDownEventSelectorIfPreprocessing method returns.
-// This should only happen inside -[NSWindow _processKeyboardUIKey],
-// and together with the change below should cause that method
-// to return NO rather than handling the key.
-// Also set a 1-shot flag for the nextResponder check below.
-- (BOOL)respondsToSelector:(SEL)selector
-{
- if (![super respondsToSelector:selector])
- return NO;
- SEL arrowKeySelector = [self _arrowKeyDownEventSelectorIfPreprocessing];
- if (selector != arrowKeySelector)
- return YES;
- _private->nextResponderDisabledOnce = YES;
- return NO;
-}
-
-// Returns nil instead of the next responder if called when the
-// one-shot flag is set, and _arrowKeyDownEventSelectorIfPreprocessing
-// returns something other than NULL. This should only happen inside
-// -[NSWindow _processKeyboardUIKey] and together with the change above
-// should cause that method to return NO rather than handling the key.
-- (NSResponder *)nextResponder
-{
- BOOL disabled = _private->nextResponderDisabledOnce;
- _private->nextResponderDisabledOnce = NO;
- if (disabled && [self _arrowKeyDownEventSelectorIfPreprocessing] != NULL)
- return nil;
- return [super nextResponder];
-}
-
-#endif
- (void)_updateControlTints
{
return [self _documentFragmentFromPasteboard:pasteboard inContext:nil allowPlainText:NO];
}
-#ifndef BUILDING_ON_TIGER
- (BOOL)isGrammarCheckingEnabled
{
return CGPointMake(point.x, NSMaxY([[screens objectAtIndex:0] frame]) - point.y);
}
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
- (void)orderFrontSubstitutionsPanel:(id)sender
{
NSRect rect = coreFrame->selection()->bounds();
-#ifndef BUILDING_ON_TIGER
NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
NSFont *font = [attributes objectForKey:NSFontAttributeName];
if (font)
rect.origin.y += [font ascender];
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[self showDefinitionForAttributedString:attrString atPoint:rect.origin];
return;
#endif
// penalty of linking to another framework. This function changed signature as well as framework between Tiger and Leopard,
// so the two cases are handled separately.
-#ifdef BUILDING_ON_TIGER
- typedef OSStatus (*ServiceWindowShowFunction)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection);
- const char *frameworkPath = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LangAnalysis.framework/LangAnalysis";
- const char *functionName = "DCMDictionaryServiceWindowShow";
-#else
typedef void (*ServiceWindowShowFunction)(id unusedDictionaryRef, id inWordString, CFRange selectionRange, id unusedFont, CGPoint textOrigin, Boolean verticalText, id unusedTransform);
const char *frameworkPath = "/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox";
const char *functionName = "HIDictionaryWindowShow";
-#endif
static bool lookedForFunction = false;
static ServiceWindowShowFunction dictionaryServiceWindowShow = NULL;
return;
}
-#ifdef BUILDING_ON_TIGER
- // FIXME: must check for right-to-left here
- NSWritingDirection writingDirection = NSWritingDirectionLeftToRight;
-
- // FIXME: the dictionary API expects the rect for the first line of selection. Passing
- // the rect for the entire selection, as we do here, positions the pop-up window near
- // the bottom of the selection rather than at the selected word.
- rect = [self convertRect:rect toView:nil];
- rect.origin = [[self window] convertBaseToScreen:rect.origin];
- NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
- dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
-#else
// The HIDictionaryWindowShow function requires the origin, in CG screen coordinates, of the first character of text in the selection.
// FIXME 4945808: We approximate this in a way that works well when a single word is selected, and less well in some other cases
// (but no worse than we did in Tiger)
dictionaryServiceWindowShow(nil, attrString, CFRangeMake(0, [attrString length]), nil,
coreGraphicsScreenPointForAppKitScreenPoint(screenPoint), false, nil);
-#endif
}
- (void)_hoverFeedbackSuspendedChanged
{
if (!_private->layerHostingView) {
NSView* hostingView = [[NSView alloc] initWithFrame:[self bounds]];
-#if !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[hostingView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
#endif
[self addSubview:hostingView];
// Make a container layer, which will get sized/positioned by AppKit and CA.
CALayer* viewLayer = [CALayer layer];
-#if defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
// Turn off default animations.
NSNull *nullValue = [NSNull null];
NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
[viewLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]];
#endif
-#if !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// If we aren't in the window yet, we'll use the screen's scale factor now, and reset the scale
// via -viewDidMoveToWindow.
NSWindow *window = [self window];
CGFloat scaleFactor;
-#if !defined(BUILDING_ON_SNOW_LEOPARD)
+#ifndef BUILDING_ON_SNOW_LEOPARD
if (window)
scaleFactor = [window backingScaleFactor];
else
if ([[self _webView] _postsAcceleratedCompositingNotifications])
[[NSNotificationCenter defaultCenter] postNotificationName:_WebViewDidStartAcceleratedCompositingNotification object:[self _webView] userInfo:nil];
-#if defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
[viewLayer setSublayerTransform:CATransform3DMakeScale(1, -1, 1)]; // setGeometryFlipped: doesn't exist on Leopard.
[self _updateLayerHostingViewPosition];
#else
}
}
-#if defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
// This method is necessary on Leopard to work around <rdar://problem/7067892>.
- (void)_updateLayerHostingViewPosition
{
return result;
}
-// test for 10.4 because of <rdar://problem/4243463>
-#ifdef BUILDING_ON_TIGER
-- (long)conversationIdentifier
-{
- return (long)self;
-}
-#else
- (NSInteger)conversationIdentifier
{
return (NSInteger)self;
}
-#endif
- (BOOL)hasMarkedText
{
- (BOOL)_interpretKeyEvent:(WebCore::KeyboardEvent *)event savingCommands:(BOOL)savingCommands;
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard;
- (NSEvent *)_mouseDownEvent;
-#ifndef BUILDING_ON_TIGER
- (BOOL)isGrammarCheckingEnabled;
- (void)setGrammarCheckingEnabled:(BOOL)flag;
- (void)toggleGrammarChecking:(id)sender;
-#endif
- (WebCore::CachedImage*)promisedDragTIFFDataSource;
- (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source;
- (void)_web_updateLayoutAndStyleIfNeededRecursive;
#import <PDFKit/PDFDocument.h>
#import <objc/objc-runtime.h>
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
@interface PDFDocument (Internal)
- (CGPDFDocumentRef)documentRef;
@end
@"0", WebKitUseSiteSpecificSpoofingPreferenceKey,
[NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey,
[NSNumber numberWithInt:WebKitEditingMacBehavior], WebKitEditingBehaviorPreferenceKey,
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded],
#else
[NSNumber numberWithInt:WebTextDirectionSubmenuNeverIncluded],
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)init
#import "WebResourcePrivate.h"
#import <wtf/PassRefPtr.h>
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
#define MAIL_THREAD_WORKAROUND 1
#endif
#define WebNSUInteger NSUInteger
#endif
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
typedef int WebSourceId;
#else
typedef intptr_t WebSourceId;
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
@end
static const NSTimeInterval tickleTimerInterval = 1.0;
@interface WebVideoFullscreenWindow : NSWindow
-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER)
+#ifndef BUILDING_ON_LEOPARD
<NSAnimationDelegate>
#endif
{
- (void)windowDidLoad
{
-#ifdef BUILDING_ON_TIGER
- // WebVideoFullscreenController is not supported on Tiger:
- ASSERT_NOT_REACHED();
-#else
WebVideoFullscreenWindow *window = [self fullscreenWindow];
[window setHasShadow:YES]; // This is nicer with a shadow.
[window setLevel:NSPopUpMenuWindowLevel-1];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp];
#endif
-#endif
}
- (WebCore::HTMLMediaElement*)mediaElement
- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement
{
-#ifdef BUILDING_ON_TIGER
- // WebVideoFullscreenController is not supported on Tiger:
- ASSERT_NOT_REACHED();
-#else
_mediaElement = mediaElement;
if ([self isWindowLoaded]) {
QTMovieLayer *movieLayer = (QTMovieLayer *)[[[self fullscreenWindow] contentView] layer];
object:[movieLayer movie]];
#endif
}
-#endif
}
- (id <WebVideoFullscreenControllerDelegate>)delegate
- (void)updateMenuAndDockForFullscreen
{
// NSApplicationPresentationOptions is available on > 10.6 only:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
NSScreen* fullscreenScreen = [[self window] screen];
SetSystemUIMode(_isEndingFullscreen ? kUIModeNormal : kUIModeAllHidden, 0);
}
-#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5
- (void)_disableIdleDisplaySleep
{
if (_idleDisplaySleepAssertion == kIOPMNullAssertionID)
{
UpdateSystemActivity(OverallAct);
}
-#endif
- (void)updatePowerAssertions
{
-#if !defined(BUILDING_ON_TIGER)
float rate = 0;
if (_mediaElement && _mediaElement->platformMedia().type == WebCore::PlatformMedia::QTMovieType)
rate = [_mediaElement->platformMedia().media.qtMovie rate];
[self _enableIdleDisplaySleep];
[self _disableTickleTimer];
}
-#endif
}
// MARK: -
- (void)animationDidEnd:(NSAnimation *)animation
{
-#if !defined(BUILDING_ON_TIGER) // Animations are never threaded on Tiger.
if (![NSThread isMainThread]) {
[self performSelectorOnMainThread:@selector(animationDidEnd:) withObject:animation waitUntilDone:NO];
return;
}
-#endif
if (animation != _fullscreenAnimation)
return;
{
id <WebVideoFullscreenHUDWindowControllerDelegate> _delegate;
NSTimer *_timelineUpdateTimer;
-#if !defined(BUILDING_ON_TIGER)
NSTrackingArea *_area;
-#endif
BOOL _mouseIsInHUD;
BOOL _isEndingFullscreen;
BOOL _isScrubbing;
return floor(value);
}
-#define HAVE_MEDIA_CONTROL (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+#define HAVE_MEDIA_CONTROL (!defined(BUILDING_ON_LEOPARD))
@interface WebVideoFullscreenHUDWindowController (Private) <NSWindowDelegate>
- (void)dealloc
{
ASSERT(!_timelineUpdateTimer);
-#if !defined(BUILDING_ON_TIGER)
ASSERT(!_area);
-#endif
ASSERT(!_isScrubbing);
[_timeline release];
[_remainingTimeText release];
[super dealloc];
}
-#if !defined(BUILDING_ON_TIGER)
- (void)setArea:(NSTrackingArea *)area
{
if (area == _area)
[_area release];
_area = [area retain];
}
-#endif
- (void)keyDown:(NSEvent *)event
{
// Note that this creates a retain cycle between the window and us.
_timelineUpdateTimer = [[NSTimer timerWithTimeInterval:0.25 target:self selector:@selector(updateTime) userInfo:nil repeats:YES] retain];
-#if defined(BUILDING_ON_TIGER)
- [[NSRunLoop currentRunLoop] addTimer:_timelineUpdateTimer forMode:(NSString *)kCFRunLoopCommonModes];
-#else
[[NSRunLoop currentRunLoop] addTimer:_timelineUpdateTimer forMode:NSRunLoopCommonModes];
-#endif
}
- (void)unscheduleTimeUpdate
[window setAlphaValue:0];
[window makeKeyAndOrderFront:self];
-#if defined(BUILDING_ON_TIGER)
- [window setAlphaValue:1];
-#else
[[window animator] setAlphaValue:1];
-#endif
[self scheduleTimeUpdate];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(fadeWindowOut) object:nil];
- (void)fadeWindowOut
{
[NSCursor setHiddenUntilMouseMoves:YES];
-#if defined(BUILDING_ON_TIGER)
- [[self window] setAlphaValue:0];
-#else
[[[self window] animator] setAlphaValue:0];
-#endif
[self performSelector:@selector(unscheduleTimeUpdate) withObject:nil afterDelay:1];
}
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(fadeWindowOut) object:nil];
[self unscheduleTimeUpdate];
NSWindow *window = [self window];
-#if !defined(BUILDING_ON_TIGER)
[[window contentView] removeTrackingArea:_area];
[self setArea:nil];
-#endif
[window close];
[window setDelegate:nil];
[self setWindow:nil];
NSView *background = [[NSView alloc] init];
#endif
[window setContentView:background];
-#if !defined(BUILDING_ON_TIGER)
_area = [[NSTrackingArea alloc] initWithRect:[background bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways owner:self userInfo:nil];
[background addTrackingArea:_area];
-#endif
[background release];
NSView *contentView = [window contentView];
@end
static BOOL continuousSpellCheckingEnabled;
-#ifndef BUILDING_ON_TIGER
static BOOL grammarCheckingEnabled;
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
static BOOL automaticQuoteSubstitutionEnabled;
static BOOL automaticLinkDetectionEnabled;
static BOOL automaticDashSubstitutionEnabled;
static bool runningTigerMail()
{
-#ifdef BUILDING_ON_TIGER
- return applicationIsAppleMail();
-#endif
return NO;
}
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
-#ifndef BUILDING_ON_TIGER
NSRunLoop *runLoop = [NSRunLoop mainRunLoop];
-#else
- NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
-#endif
if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES))
[self scheduleInRunLoop:runLoop forMode:(NSString *)kCFRunLoopCommonModes];
[super setFrameSize:size];
}
-#if USE(ACCELERATED_COMPOSITING) || !defined(BUILDING_ON_TIGER)
-
- (void)_viewWillDrawInternal
{
Frame* frame = [self _mainCoreFrame];
frame->view()->updateLayoutAndStyleIfNeededRecursive();
}
-#endif
-
-#ifndef BUILDING_ON_TIGER
-
- (void)viewWillDraw
{
if (!_private->usesDocumentViews)
[super viewWillDraw];
}
-#endif
- (void)drawRect:(NSRect)rect
#if ENABLE(FULLSCREEN_API)
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
// Asynchronous spell checking API is available for 10.6 or later.
settings->setAsynchronousSpellCheckingEnabled([preferences asynchronousSpellCheckingEnabled]);
#endif
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];
continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled];
-#ifndef BUILDING_ON_TIGER
grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
automaticQuoteSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticQuoteSubstitutionEnabled];
automaticLinkDetectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticLinkDetectionEnabled];
automaticDashSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticDashSubstitutionEnabled];
automaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
if ([bundleIdentifier _webkit_hasCaseInsensitivePrefix:@"com.apple.Automator."])
return true;
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
// Mail.
if ([bundleIdentifier _webkit_isCaseInsensitiveEqualToString:@"com.apple.Mail"])
return true;
[menuItem setState:checkMark ? NSOnState : NSOffState];
}
return YES;
-#ifndef BUILDING_ON_TIGER
} else if (action == @selector(toggleGrammarChecking:)) {
BOOL checkMark = [self isGrammarCheckingEnabled];
if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) {
[menuItem setState:checkMark ? NSOnState : NSOffState];
}
return YES;
-#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
} else if (action == @selector(toggleAutomaticQuoteSubstitution:)) {
BOOL checkMark = [self isAutomaticQuoteSubstitutionEnabled];
if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) {
// FIXME: This method should be merged into WebViewEditing when we're not in API freeze
- (BOOL)isGrammarCheckingEnabled
{
-#ifdef BUILDING_ON_TIGER
- return NO;
-#else
return grammarCheckingEnabled;
-#endif
}
-#ifndef BUILDING_ON_TIGER
// FIXME: This method should be merged into WebViewEditing when we're not in API freeze
- (void)setGrammarCheckingEnabled:(BOOL)flag
{
{
[self setGrammarCheckingEnabled:![self isGrammarCheckingEnabled]];
}
-#endif
@end
- (BOOL)isAutomaticQuoteSubstitutionEnabled
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
return NO;
#else
return automaticQuoteSubstitutionEnabled;
- (BOOL)isAutomaticLinkDetectionEnabled
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
return NO;
#else
return automaticLinkDetectionEnabled;
- (BOOL)isAutomaticDashSubstitutionEnabled
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
return NO;
#else
return automaticDashSubstitutionEnabled;
- (BOOL)isAutomaticTextReplacementEnabled
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
return NO;
#else
return automaticTextReplacementEnabled;
- (BOOL)isAutomaticSpellingCorrectionEnabled
{
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
return NO;
#else
return automaticSpellingCorrectionEnabled;
#endif
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
- (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag
{
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- (void)handleCorrectionPanelResult:(NSString*)result
{
WebFrame *webFrame = [self _selectedOrMainFrame];
ASSERT_NOT_REACHED();
};
-#ifdef BUILDING_ON_TIGER
- // Don't use a big Foundation disk cache on Tiger because, according to the
- // PLT, the Foundation disk cache on Tiger is slower than the network.
- nsurlCacheDiskCapacity = [nsurlCache diskCapacity];
-#endif
// Don't shrink a big disk cache, since that would cause churn.
nsurlCacheDiskCapacity = max(nsurlCacheDiskCapacity, [nsurlCache diskCapacity]);
if (![selectedString length])
return;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[[NSWorkspace sharedWorkspace] showSearchResultsForQueryString:selectedString];
#else
(void)HISearchWindowShow((CFStringRef)selectedString, kNilOptions);
{
JSC::initializeThreading();
WTF::initializeMainThreadToProcessMainThread();
-#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
-#endif
}
- (id)init
dashboardBehaviorAllowWheelScrolling = YES;
#endif
-#if !defined(BUILDING_ON_TIGER)
shouldCloseWithWindow = objc_collectingEnabled();
-#else
- shouldCloseWithWindow = NO;
-#endif
smartInsertDeleteEnabled = ![[NSUserDefaults standardUserDefaults] objectForKey:WebSmartInsertDeleteEnabled]
|| [[NSUserDefaults standardUserDefaults] boolForKey:WebSmartInsertDeleteEnabled];
- (NSTextInputContext *)inputContext;
@end
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
@interface NSObject (NSTextInputContextDetails)
- (BOOL)wantsToHandleMouseEvents;
- (BOOL)handleMouseEvent:(NSEvent *)event;
// FIXME: These two methods should be merged into WebViewEditing when we're not in API freeze
- (BOOL)isGrammarCheckingEnabled;
-#ifndef BUILDING_ON_TIGER
- (void)setGrammarCheckingEnabled:(BOOL)flag;
// FIXME: This method should be merged into WebIBActions when we're not in API freeze
- (void)toggleGrammarChecking:(id)sender;
-#endif
@end
- (BOOL)isAutomaticDashSubstitutionEnabled;
- (BOOL)isAutomaticTextReplacementEnabled;
- (BOOL)isAutomaticSpellingCorrectionEnabled;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
- (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag;
- (void)toggleAutomaticQuoteSubstitution:(id)sender;
- (void)setAutomaticLinkDetectionEnabled:(BOOL)flag;
- (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag;
- (void)toggleAutomaticSpellingCorrection:(id)sender;
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- (void)handleCorrectionPanelResult:(NSString*)result;
#endif
@end
self = [super init];
if (!self)
return nil;
-#ifndef BUILDING_ON_TIGER
[self setAnimationBlockingMode:NSAnimationNonblockingThreaded];
-#endif
[self setFrameRate:60.];
return self;
}
[super setCurrentProgress:progress];
NSRect currentRect = [self currentFrame];
-#ifndef BUILDING_ON_TIGER
WKWindowSetScaledFrame(_window, currentRect, _realFrame);
-#else
- [_window setFrame:currentRect display:YES];
-#endif
[_subAnimation setCurrentProgress:progress];
}
self = [super init];
if (!self)
return nil;
-#ifndef BUILDING_ON_TIGER
[self setAnimationBlockingMode:NSAnimationNonblockingThreaded];
-#endif
[self setFrameRate:60];
[self setAnimationCurve:NSAnimationEaseInOut];
return self;
ASSERT(_window);
[super setCurrentProgress:progress];
-#ifndef BUILDING_ON_TIGER
WKWindowSetAlpha(_window, [self currentAlpha]);
-#else
- [_window setAlphaValue:[self currentAlpha]];
-#endif
}
- (void)setWindow:(NSWindow*)window
NSArray* PasteboardTypes::forEditing()
{
static NSArray *types = retain([NSArray arrayWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType,
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
NSPICTPboardType,
#endif
NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, kUTTypePNG, nil]);
- (void)_updateMenuAndDockForFullScreen
{
// NSApplicationPresentationOptions is available on > 10.6 only:
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
NSScreen* fullScreenScreen = [[self window] screen];
SetSystemUIMode(_isFullScreen ? kUIModeNormal : kUIModeAllHidden, 0);
}
-#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5
- (void)_disableIdleDisplaySleep
{
if (_idleDisplaySleepAssertion == kIOPMNullAssertionID)
{
UpdateSystemActivity(OverallAct);
}
-#endif
- (void)_updatePowerAssertions
{
-#if !defined(BUILDING_ON_TIGER)
if (_isPlaying && _isFullScreen) {
[self _disableIdleSystemSleep];
[self _disableIdleDisplaySleep];
[self _enableIdleDisplaySleep];
[self _disableTickleTimer];
}
-#endif
}
- (WebFullScreenManagerProxy*)_manager
{
static const CFTimeInterval defaultDuration = 0.5;
CFTimeInterval duration = defaultDuration;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
NSUInteger modifierFlags = [NSEvent modifierFlags];
#else
NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags];
[self setAcceptsMouseMovedEvents:YES];
[self setReleasedWhenClosed:NO];
[self setHasShadow:YES];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[self setMovable:NO];
#else
[self setMovableByWindowBackground:NO];
NSString *cacheDir = [defaults objectForKey:WebKitLocalCacheDefaultsKey];
if (!cacheDir || ![cacheDir isKindOfClass:[NSString class]]) {
-#ifdef BUILDING_ON_TIGER
- cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
-#else
char cacheDirectory[MAXPATHLEN];
size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN);
if (cacheDirectoryLen)
cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1];
-#endif
}
return [cacheDir stringByAppendingPathComponent:appName];
virtual void setInsertionPasteboard(NSPasteboard *);
virtual NSURL* canonicalizeURL(NSURL*);
virtual NSURL* canonicalizeURLString(NSString*);
-#ifdef BUILDING_ON_TIGER
- virtual NSArray *pasteboardTypesForSelection(WebCore::Frame*);
-#endif
#endif
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
virtual void uppercaseWord();
virtual void lowercaseWord();
virtual void capitalizeWord();
virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord);
virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
virtual void checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<WebCore::TextCheckingResult>& results);
#endif
virtual void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail& detail);
notImplemented();
}
-#ifdef BUILDING_ON_TIGER
-NSArray *WebEditorClient::pasteboardTypesForSelection(Frame*)
-{
- notImplemented();
- return nil;
-}
-#endif
static void changeWordCase(WebPage* page, SEL selector)
{
#include <stdarg.h>
#if defined(XP_MACOSX)
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
#define BUILDING_ON_LEOPARD 1
#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
#define BUILDING_ON_SNOW_LEOPARD 1
#ifdef XP_MACOSX
NPEventModel eventModel;
#endif
-#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+#ifdef XP_MACOSX
void* coreAnimationLayer;
#endif
NPWindow lastWindow;
extern bool testDocumentOpen(NPP npp);
extern bool testWindowOpen(NPP npp);
-#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+#ifdef XP_MACOSX
extern void* createCoreAnimationLayer();
#endif
#include "PluginObject.h"
-#if !defined(BUILDING_ON_TIGER)
#include <QuartzCore/QuartzCore.h>
return caLayer;
}
-#endif // !defined(BUILDING_ON_TIGER)
#ifdef XP_MACOSX
obj->eventModel = eventModel;
-#if !defined(BUILDING_ON_TIGER)
obj->coreAnimationLayer = 0;
-#endif
#endif // XP_MACOSX
string testIdentifier;
else if (strcasecmp(argn[i], "testwindowopen") == 0)
obj->testWindowOpen = TRUE;
else if (strcasecmp(argn[i], "drawingmodel") == 0) {
-#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+#ifdef XP_MACOSX
const char* value = argv[i];
if (strcasecmp(value, "coreanimation") == 0) {
if (supportsCoreAnimation)
#ifdef XP_MACOSX
browser->setvalue(instance, NPPVpluginDrawingModel, (void *)drawingModelToUse);
-#if !defined(BUILDING_ON_TIGER)
if (drawingModelToUse == NPDrawingModelCoreAnimation)
obj->coreAnimationLayer = createCoreAnimationLayer();
-#endif
#endif
browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
if (obj->logDestroy)
pluginLog(instance, "NPP_Destroy");
-#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+#ifdef XP_MACOSX
if (obj->coreAnimationLayer)
CFRelease(obj->coreAnimationLayer);
#endif
return NPERR_NO_ERROR;
}
-#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+#ifdef XP_MACOSX
if (variable == NPPVpluginCoreAnimationLayer) {
if (!obj->coreAnimationLayer)
return NPERR_GENERIC_ERROR;
CFErrorRef error = 0;
CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0;
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
CFIndex bytesCount = CFDataGetLength(webArchiveData);
RetainPtr<CFReadStreamRef> readStream(AdoptCF, CFReadStreamCreateWithBytesNoCopy(kCFAllocatorDefault, CFDataGetBytePtr(webArchiveData), bytesCount, kCFAllocatorNull));
CFReadStreamOpen(readStream.get());
error = 0;
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+#ifdef BUILDING_ON_LEOPARD
RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateXMLData(kCFAllocatorDefault, propertyList.get()));
#else
RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateData(kCFAllocatorDefault, propertyList.get(), kCFPropertyListXMLFormat_v1_0, 0, &error));
#if PLATFORM(MAC)
#define WTF_USE_CF 1
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
#define BUILDING_ON_LEOPARD 1
#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
#define BUILDING_ON_SNOW_LEOPARD 1
#import <wtf/RetainPtr.h>
#import <wtf/Vector.h>
-#ifdef BUILDING_ON_TIGER
-#define NSAccessibilityValueDescriptionAttribute @"AXValueDescription"
-#endif
#ifndef NSAccessibilityOwnsAttribute
#define NSAccessibilityOwnsAttribute @"AXOwns"
return savedRealloc(zone, ptr, size);
}
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
static vm_prot_t protectionOfRegion(mach_vm_address_t address)
{
mach_vm_size_t regionSize = 0;
{
malloc_zone_t* zone = malloc_default_zone();
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
mach_vm_address_t pageStart = reinterpret_cast<vm_address_t>(zone) & static_cast<vm_size_t>(~(getpagesize() - 1));
vm_prot_t initialProtection = protectionOfRegion(pageStart);
zone->malloc = checkedMalloc;
zone->realloc = checkedRealloc;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
if (mach_vm_protect(mach_task_self(), pageStart, len, 0, initialProtection))
CRASH();
#endif
static void activateFonts()
{
-#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_TIGER)
+#ifdef BUILDING_ON_LEOPARD
static const char* fontSectionNames[] = {
"Ahem",
"WeightWatcher100",
NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#ifndef BUILDING_ON_LEOPARD
[window setColorSpace:[[NSScreen mainScreen] colorSpace]];
#endif
// So, turn it off for now, but we might want to turn it back on some day