Unreviewed, rolling out r121547.
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 18:14:47 +0000 (18:14 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 18:14:47 +0000 (18:14 +0000)
http://trac.webkit.org/changeset/121547
https://bugs.webkit.org/show_bug.cgi?id=90256

Breaks Chromium Mac build

* platform/LocalizedStrings.cpp:
(WebCore::imageTitle):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setAllowsFontSmoothing):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::clear):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::boundingRect):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore):
(WebCore::canSetCascadeListForCustomFont):
(WebCore::FontPlatformData::ctFont):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/mac/ComplexTextController.cpp:
* platform/graphics/mac/FontCacheMac.mm:
(WebCore):
(WebCore::fontCacheATSNotificationCallback):
(WebCore::FontCache::platformInit):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::~FontCustomPlatformData):
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/mac/WebLayer.h:
* platform/mac/CursorMac.mm:
(WebCore::Cursor::ensurePlatformCursor):
* platform/mac/DisplaySleepDisabler.cpp:
(WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
(WebCore):
(WebCore::DisplaySleepDisabler::systemActivityTimerFired):
* platform/mac/DisplaySleepDisabler.h:
(DisplaySleepDisabler):
* platform/mac/HTMLConverter.h:
* platform/mac/HTMLConverter.mm:
* platform/mac/PopupMenuMac.mm:
(WebCore::PopupMenuMac::populate):
* platform/mac/ScrollElasticityController.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121575 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp
Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp
Source/WebCore/platform/graphics/cg/PathCG.cpp
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
Source/WebCore/platform/graphics/mac/FontCacheMac.mm
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
Source/WebCore/platform/graphics/mac/WebLayer.h
Source/WebCore/platform/mac/CursorMac.mm
Source/WebCore/platform/mac/DisplaySleepDisabler.cpp
Source/WebCore/platform/mac/DisplaySleepDisabler.h
Source/WebCore/platform/mac/HTMLConverter.h
Source/WebCore/platform/mac/HTMLConverter.mm
Source/WebCore/platform/mac/PopupMenuMac.mm
Source/WebCore/platform/mac/ScrollElasticityController.mm

index d6ddbee..069f25a 100644 (file)
@@ -1,3 +1,53 @@
+2012-06-29  Tony Chang  <tony@chromium.org>
+
+        Unreviewed, rolling out r121547.
+        http://trac.webkit.org/changeset/121547
+        https://bugs.webkit.org/show_bug.cgi?id=90256
+
+        Breaks Chromium Mac build
+
+        * platform/LocalizedStrings.cpp:
+        (WebCore::imageTitle):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::setAllowsFontSmoothing):
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::Image::drawPattern):
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::clear):
+        * platform/graphics/cg/PathCG.cpp:
+        (WebCore::Path::boundingRect):
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore):
+        (WebCore::canSetCascadeListForCustomFont):
+        (WebCore::FontPlatformData::ctFont):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        * platform/graphics/mac/ComplexTextController.cpp:
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore):
+        (WebCore::fontCacheATSNotificationCallback):
+        (WebCore::FontCache::platformInit):
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
+        (WebCore::createFontCustomPlatformData):
+        * platform/graphics/mac/FontCustomPlatformData.h:
+        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::SimpleFontData::platformInit):
+        * platform/graphics/mac/WebLayer.h:
+        * platform/mac/CursorMac.mm:
+        (WebCore::Cursor::ensurePlatformCursor):
+        * platform/mac/DisplaySleepDisabler.cpp:
+        (WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
+        (WebCore):
+        (WebCore::DisplaySleepDisabler::systemActivityTimerFired):
+        * platform/mac/DisplaySleepDisabler.h:
+        (DisplaySleepDisabler):
+        * platform/mac/HTMLConverter.h:
+        * platform/mac/HTMLConverter.mm:
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenuMac::populate):
+        * platform/mac/ScrollElasticityController.mm:
+
 2012-06-29  Eric Penner  <epenner@google.com>
 
         [chromium] Adding PrioritizedTexture and replacing ContentsTextureManager
index f77efa6..9c4bdf3 100644 (file)
@@ -755,6 +755,7 @@ String htmlSelectMultipleItems(size_t count)
 String imageTitle(const String& filename, const IntSize& size)
 {
 #if USE(CF)
+#if !defined(BUILDING_ON_LEOPARD)
     RetainPtr<CFStringRef> filenameCFString(AdoptCF, filename.createCFString());
     RetainPtr<CFLocaleRef> locale(AdoptCF, CFLocaleCopyCurrent());
     RetainPtr<CFNumberFormatterRef> formatter(AdoptCF, CFNumberFormatterCreate(0, locale.get(), kCFNumberFormatterDecimalStyle));
@@ -769,6 +770,10 @@ String imageTitle(const String& filename, const IntSize& size)
 
     return formatLocalizedString(WEB_UI_STRING("%@ %@×%@ pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCFString.get(), widthString.get(), heightString.get());
 #else
+    RetainPtr<CFStringRef> filenameCFString(AdoptCF, filename.createCFString());
+    return formatLocalizedString(WEB_UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCFString.get(), size.width(), size.height());
+#endif
+#else
     return formatLocalizedString(WEB_UI_STRING("<filename> %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height()).replace("<filename>", filename);
 #endif
 }
index 019fad8..7489468 100644 (file)
@@ -1597,8 +1597,11 @@ InterpolationQuality GraphicsContext::imageInterpolationQuality() const
 
 void GraphicsContext::setAllowsFontSmoothing(bool allowsFontSmoothing)
 {
+    UNUSED_PARAM(allowsFontSmoothing);
+#if !defined(BUILDING_ON_LEOPARD)
     CGContextRef context = platformContext();
     CGContextSetAllowsFontSmoothing(context, allowsFontSmoothing);
+#endif
 }
 
 void GraphicsContext::setIsCALayerContext(bool isLayerContext)
index cd12e45..fed911a 100644 (file)
@@ -262,13 +262,22 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
 
     // Adjust the color space.
     subImage = Image::imageWithColorSpace(subImage.get(), styleColorSpace);
-
+    
+    // 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: 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);
+#ifdef BUILDING_ON_LEOPARD
+    if (w == size().width() && h == size().height() && scaledTileWidth == tileRect.width() && scaledTileHeight == tileRect.height())
+#else
     if (w == size().width() && h == size().height())
+#endif
         CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get());
     else {
-    // This code now only runs for partially decoded images whose buffers do not yet match the overall size of the image.
+
+    // 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));
@@ -292,6 +301,7 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
 
     CGContextSetFillColorWithColor(context, color.get());
     CGContextFillRect(context, CGContextGetClipBoundingBox(context));
+
     }
 
     stateSaver.restore();
index 1d80cc1..4335365 100644 (file)
@@ -85,11 +85,21 @@ ImageSource::~ImageSource()
 
 void ImageSource::clear(bool destroyAllFrames, size_t, SharedBuffer* data, bool allDataReceived)
 {
-    // ImageIO discards previously decoded image frames if the client
+#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.
+
     if (!destroyAllFrames)
         return;
+#else
+    // Older versions of ImageIO hold references to previously decoded image frames.
+    // There is no API to selectively release some of the frames it is holding, and
+    // if we don't release the frames we use too much memory on large images.
+    // Destroying the decoder is the only way to release previous frames.
+
+    UNUSED_PARAM(destroyAllFrames);
+#endif
 
     if (m_decoder) {
         CFRelease(m_decoder);
index d4acf31..6cc9378 100644 (file)
@@ -171,8 +171,15 @@ void Path::translate(const FloatSize& size)
 
 FloatRect Path::boundingRect() const
 {
-    // CGPathGetPathBoundingBox does not include the path's control points.
-    CGRect bound = CGPathGetPathBoundingBox(m_path);
+    // CGPathGetBoundingBox includes the path's control points, CGPathGetPathBoundingBox
+    // does not, but only exists on 10.6 and above.
+
+    CGRect bound = CGRectZero;
+#if !defined(BUILDING_ON_LEOPARD)
+    bound = CGPathGetPathBoundingBox(m_path);
+#else
+    bound = CGPathGetBoundingBox(m_path);
+#endif
     return CGRectIsNull(bound) ? CGRectZero : bound;
 }
 
index 46d10b4..f30b181 100644 (file)
@@ -240,6 +240,24 @@ static CTFontDescriptorRef cascadeToLastResortAndDisableSwashesFontDescriptor()
     return descriptor;
 }
 
+// Adding a cascade list breaks the font on Leopard
+static bool canSetCascadeListForCustomFont()
+{
+#if PLATFORM(CHROMIUM)
+    static SInt32 systemVersion;
+    if (!systemVersion) {
+        if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
+            return false;
+    }
+
+    return systemVersion >= 0x1060;
+#elif !defined(BUILDING_ON_LEOPARD)
+    return true;
+#else
+    return false;
+#endif
+}
+
 CTFontRef FontPlatformData::ctFont() const
 {
     if (m_CTFont)
@@ -247,7 +265,7 @@ CTFontRef FontPlatformData::ctFont() const
 
 #if PLATFORM(CHROMIUM)
     if (m_inMemoryFont) {
-        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, cascadeToLastResortFontDescriptor()));
+        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor() : 0));
         return m_CTFont.get();
     }
 #endif
@@ -263,7 +281,7 @@ CTFontRef FontPlatformData::ctFont() const
             fontDescriptor = cascadeToLastResortFontDescriptor();
         m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor));
     } else
-        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
+        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor() : 0));
 
     if (m_widthVariant != RegularWidth) {
         int featureTypeValue = kTextSpacingType;
index 5c29164..e9d1bc1 100644 (file)
@@ -1617,7 +1617,12 @@ bool MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin() const
 
 bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
 {
+#if defined(BUILDING_ON_LEOPARD)
+    // See <rdar://problem/7389945>
+    return false;
+#else
     return true;
+#endif
 }
 
 PlatformMedia MediaPlayerPrivateGStreamer::platformMedia() const
index a07090a..6614adb 100644 (file)
 #include <wtf/StdLibExtras.h>
 #include <wtf/unicode/CharacterNames.h>
 
+#if defined(BUILDING_ON_LEOPARD)
+// Undefined when compiling agains the 10.5 SDK.
+#define kCTVersionNumber10_6 0x00030000
+#endif
+
 using namespace std;
 
 namespace WebCore {
index 591822e..91dd426 100644 (file)
@@ -52,17 +52,30 @@ static void invalidateFontCache(void*)
     fontCache()->invalidate();
 }
 
+#if !defined(BUILDING_ON_LEOPARD)
 static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef)
 {
     ASSERT_UNUSED(observer, observer == fontCache());
     ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotification));
     invalidateFontCache(0);
 }
+#else
+static void fontCacheATSNotificationCallback(ATSFontNotificationInfoRef, void*)
+{
+    invalidateFontCache(0);
+}
+#endif
 
 void FontCache::platformInit()
 {
     wkSetUpFontCache();
+#if !defined(BUILDING_ON_LEOPARD)
     CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
+#else
+    // kCTFontManagerRegisteredFontsChangedNotification does not exist on Leopard and earlier.
+    // FIXME: Passing kATSFontNotifyOptionReceiveWhileSuspended may be an overkill and does not seem to work anyway.
+    ATSFontNotificationSubscribe(fontCacheATSNotificationCallback, kATSFontNotifyOptionReceiveWhileSuspended, 0, 0);
+#endif
 }
 
 static int toAppKitFontWeight(FontWeight fontWeight)
index f825ced..cfddf36 100644 (file)
@@ -78,6 +78,10 @@ private:
 
 FontCustomPlatformData::~FontCustomPlatformData()
 {
+#ifdef BUILDING_ON_LEOPARD
+    if (m_atsContainer)
+        ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault);
+#endif
 #if USE(SKIA_ON_MAC_CHROMIUM)
     SkSafeUnref(m_typeface);
 #endif
@@ -111,15 +115,51 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
     }
 #endif
 
+    ATSFontContainerRef containerRef = 0;
+
     RetainPtr<CGFontRef> cgFontRef;
+
+#ifndef BUILDING_ON_LEOPARD
     RetainPtr<CFDataRef> bufferData(AdoptCF, buffer->createCFData());
     RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
 
     cgFontRef.adoptCF(CGFontCreateWithDataProvider(dataProvider.get()));
     if (!cgFontRef)
         return 0;
+#else
+    // Use ATS to activate the font.
+
+    // The value "3" means that the font is private and can't be seen by anyone else.
+    ATSFontActivateFromMemory((void*)buffer->data(), buffer->size(), 3, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &containerRef);
+    if (!containerRef)
+        return 0;
+    ItemCount fontCount;
+    ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 0, NULL, &fontCount);
+    
+    // We just support the first font in the list.
+    if (fontCount == 0) {
+        ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
+        return 0;
+    }
+    
+    ATSFontRef fontRef = 0;
+    ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 1, &fontRef, NULL);
+    if (!fontRef) {
+        ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
+        return 0;
+    }
+    
+    cgFontRef.adoptCF(CGFontCreateWithPlatformFont(&fontRef));
+    // Workaround for <rdar://problem/5675504>.
+    if (cgFontRef && !CGFontGetNumberOfGlyphs(cgFontRef.get()))
+        cgFontRef = 0;
+    if (!cgFontRef) {
+        ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
+        return 0;
+    }
+#endif // !defined(BUILDING_ON_LEOPARD)
 
-    FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(cgFontRef.leakRef());
+    FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(containerRef, cgFontRef.leakRef());
 #if USE(SKIA_ON_MAC_CHROMIUM)
     RemoteFontStream* stream = new RemoteFontStream(buffer);
     fontCustomPlatformData->m_typeface = SkTypeface::CreateFromStream(stream);
index b6e611d..562eb1f 100644 (file)
@@ -30,6 +30,8 @@
 #include <wtf/Noncopyable.h>
 
 typedef struct CGFont* CGFontRef;
+typedef UInt32 ATSFontContainerRef;
+typedef UInt32 ATSFontRef;
 
 #if USE(SKIA_ON_MAC_CHROMIUM)
 class SkTypeface;
@@ -43,8 +45,9 @@ class SharedBuffer;
 struct FontCustomPlatformData {
     WTF_MAKE_NONCOPYABLE(FontCustomPlatformData);
 public:
-    explicit FontCustomPlatformData(CGFontRef cgFont)
-        : m_cgFont(cgFont)
+    FontCustomPlatformData(ATSFontContainerRef container, CGFontRef cgFont)
+        : m_atsContainer(container)
+        , m_cgFont(cgFont)
 #if USE(SKIA_ON_MAC_CHROMIUM)
         , m_typeface(0)
 #endif
index 5d9a146..d5d5560 100644 (file)
@@ -233,6 +233,15 @@ void SimpleFontData::platformInit()
     NSString *familyName = [m_platformData.font() familyName];
     if ([familyName isEqualToString:@"Times"] || [familyName isEqualToString:@"Helvetica"] || [familyName isEqualToString:@"Courier"])
         ascent += floorf(((ascent + descent) * 0.15f) + 0.5f);
+#if defined(BUILDING_ON_LEOPARD)
+    else if ([familyName isEqualToString:@"Geeza Pro"]) {
+        // Geeza Pro has glyphs that draw slightly above the ascent or far below the descent. Adjust
+        // those vertical metrics to better match reality, so that diacritics at the bottom of one line
+        // do not overlap diacritics at the top of the next line.
+        ascent *= 1.08f;
+        descent *= 2.f;
+    }
+#endif
 
     // Compute and store line spacing, before the line metrics hacks are applied.
     m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
index 65569ce..bb0f444 100644 (file)
@@ -36,6 +36,13 @@ namespace WebCore {
     class PlatformCALayerClient;
 }
 
+#if defined(BUILDING_ON_LEOPARD)
+@interface CALayer(WebLayerInternal)
+- (CGAffineTransform)contentsTransform;
+- (void)setContentsTransform:(CGAffineTransform)t;
+@end
+#endif
+
 @interface WebLayer : CALayer 
 {
 }
index 07875f2..d208533 100644 (file)
@@ -254,7 +254,11 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::ContextMenu:
+#if !defined(BUILDING_ON_LEOPARD)
         m_platformCursor = [NSCursor contextualMenuCursor];
+#else
+        m_platformCursor = createNamedCursor("contextMenuCursor", 3, 2);
+#endif
         break;
 
     case Cursor::Alias:
@@ -274,11 +278,19 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::NoDrop:
+#if !defined(BUILDING_ON_LEOPARD)
         m_platformCursor = [NSCursor operationNotAllowedCursor];
+#else
+        m_platformCursor = createNamedCursor("noDropCursor", 3, 1);
+#endif
         break;
 
     case Cursor::Copy:
+#if !defined(BUILDING_ON_LEOPARD)
         m_platformCursor = [NSCursor dragCopyCursor];
+#else
+        m_platformCursor = createNamedCursor("copyCursor", 3, 2);
+#endif
         break;
 
     case Cursor::None:
@@ -286,7 +298,11 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::NotAllowed:
+#if !defined(BUILDING_ON_LEOPARD)
         m_platformCursor = [NSCursor operationNotAllowedCursor];
+#else
+        m_platformCursor = createNamedCursor("notAllowedCursor", 11, 11);
+#endif
         break;
 
     case Cursor::ZoomIn:
index e65615d..1073087 100644 (file)
 #include <IOKit/pwr_mgt/IOPMLib.h>
 #include <wtf/RetainPtr.h>
 
+#ifdef BUILDING_ON_LEOPARD
+#include <wtf/UnusedParam.h>
+#endif
+
 namespace WebCore {
 
 static const double systemActivityInterval = 1;
 
 DisplaySleepDisabler::DisplaySleepDisabler(const char* reason)
     : m_disableDisplaySleepAssertion(0)
+#ifdef BUILDING_ON_LEOPARD
+    , m_systemActivityTimer(this, &DisplaySleepDisabler::systemActivityTimerFired)
+#endif
 {
+#ifndef BUILDING_ON_LEOPARD
     RetainPtr<CFStringRef> reasonCF(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, reason, kCFStringEncodingUTF8));
     IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonCF.get(), &m_disableDisplaySleepAssertion);
+#else
+    UNUSED_PARAM(reason);
+    IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &m_disableDisplaySleepAssertion);
+    m_systemActivityTimer.startRepeating(systemActivityInterval);
+#endif
 }
 
 DisplaySleepDisabler::~DisplaySleepDisabler()
 {
     IOPMAssertionRelease(m_disableDisplaySleepAssertion);
 }
+    
+#ifdef BUILDING_ON_LEOPARD
+void DisplaySleepDisabler::systemActivityTimerFired(Timer<DisplaySleepDisabler>*)
+{
+    UpdateSystemActivity(OverallAct);
+}
+#endif
 
 }
index 3958a9f..2e466dc 100644 (file)
 #include <wtf/Noncopyable.h>
 #include <wtf/PassOwnPtr.h>
 
+#ifdef BUILDING_ON_LEOPARD
+#include "Timer.h"
+#endif
+
 namespace WebCore {
 
 class DisplaySleepDisabler {
@@ -36,11 +40,18 @@ class DisplaySleepDisabler {
 public:
     static PassOwnPtr<DisplaySleepDisabler> create(const char* reason) { return adoptPtr(new DisplaySleepDisabler(reason)); }
     ~DisplaySleepDisabler();
-
+    
 private:
     DisplaySleepDisabler(const char* reason);
+
+#ifdef BUILDING_ON_LEOPARD
+    void systemActivityTimerFired(Timer<DisplaySleepDisabler>*);
+#endif
     
     uint32_t m_disableDisplaySleepAssertion;
+#ifdef BUILDING_ON_LEOPARD
+    Timer<DisplaySleepDisabler> m_systemActivityTimer;
+#endif
 };
 
 }
index ddcd3b9..ea1b85d 100644 (file)
@@ -79,10 +79,12 @@ namespace WebCore {
     } _flags;
 }
 
+#if !defined(BUILDING_ON_LEOPARD)
 - (id)init;
 - (id)initWithDOMRange:(DOMRange *)domRange;
 
 - (NSAttributedString *)attributedString;
+#endif
 
 + (NSAttributedString *)editingAttributedStringFromRange:(WebCore::Range*)range;
 @end
index d3a9f75..22db81c 100644 (file)
@@ -50,6 +50,7 @@ using namespace HTMLNames;
 static NSFileWrapper *fileWrapperForURL(DocumentLoader *, NSURL *);
 static NSFileWrapper *fileWrapperForElement(Element*);
 
+#ifndef BUILDING_ON_LEOPARD
 
 // Additional control Unicode characters
 const unichar WebNextLineCharacter = 0x0085;
@@ -95,8 +96,12 @@ static NSFont *WebDefaultFont()
     return defaultFont;
 }
 
+#endif
+
 @implementation WebHTMLConverter
 
+#ifndef BUILDING_ON_LEOPARD
+
 static NSFont *_fontForNameAndSize(NSString *fontName, CGFloat size, NSMutableDictionary *cache)
 {
     NSFontManager *fontManager = [NSFontManager sharedFontManager];
@@ -1652,6 +1657,8 @@ static NSInteger _colCompare(id block1, id block2, void *)
     return (0 == _errorCode) ? [[_attrStr retain] autorelease] : nil;
 }
 
+#endif // !defined(BUILDING_ON_LEOPARD)
+
 // This function uses TextIterator, which makes offsets in its result compatible with HTML editing.
 + (NSAttributedString *)editingAttributedStringFromRange:(Range*)range
 {
index 4d21732..4607781 100644 (file)
@@ -75,8 +75,10 @@ void PopupMenuMac::populate()
     if (!client()->shouldPopOver())
         [m_popup.get() addItemWithTitle:@""];
 
+#ifndef BUILDING_ON_LEOPARD
     TextDirection menuTextDirection = client()->menuStyle().textDirection();
     [m_popup.get() setUserInterfaceLayoutDirection:menuTextDirection == LTR ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft];
+#endif // !defined(BUILDING_ON_LEOPARD)
 
     ASSERT(client());
     int size = client()->listSize();
@@ -96,6 +98,7 @@ void PopupMenuMac::populate()
                 [attributes setObject:font forKey:NSFontAttributeName];
             }
 
+#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;
@@ -106,6 +109,7 @@ void PopupMenuMac::populate()
                 [attributes setObject:writingDirectionArray.get() forKey:NSWritingDirectionAttributeName];
             }
             [attributes setObject:paragraphStyle.get() forKey:NSParagraphStyleAttributeName];
+#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.
index e4aec76..7a75384 100644 (file)
 
 #if ENABLE(RUBBER_BANDING)
 
+#ifdef BUILDING_ON_LEOPARD
+@interface NSProcessInfo (ScrollAnimatorMacExt)
+- (NSTimeInterval)systemUptime;
+@end
+#endif
+
 #if ENABLE(RUBBER_BANDING)
 static NSTimeInterval systemUptime()
 {