Diff
Modified: trunk/Source/WebCore/ChangeLog (121574 => 121575)
--- trunk/Source/WebCore/ChangeLog 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/ChangeLog 2012-06-29 18:14:47 UTC (rev 121575)
@@ -1,3 +1,53 @@
+2012-06-29 Tony Chang <[email protected]>
+
+ 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 <[email protected]>
[chromium] Adding PrioritizedTexture and replacing ContentsTextureManager
Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/LocalizedStrings.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -755,6 +755,7 @@
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 @@
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
}
Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -1597,8 +1597,11 @@
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)
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -262,13 +262,22 @@
// 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 @@
CGContextSetFillColorWithColor(context, color.get());
CGContextFillRect(context, CGContextGetClipBoundingBox(context));
+
}
stateSaver.restore();
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -85,12 +85,22 @@
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);
m_decoder = 0;
Modified: trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -171,8 +171,15 @@
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;
}
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -240,6 +240,24 @@
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 @@
#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 @@
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;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -1617,7 +1617,12 @@
bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
{
+#if defined(BUILDING_ON_LEOPARD)
+ // See <rdar://problem/7389945>
+ return false;
+#else
return true;
+#endif
}
PlatformMedia MediaPlayerPrivateGStreamer::platformMedia() const
Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -33,6 +33,11 @@
#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 {
Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -52,17 +52,30 @@
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)
Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -78,6 +78,10 @@
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 @@
}
#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.
- FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(cgFontRef.leakRef());
+ // 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(containerRef, cgFontRef.leakRef());
#if USE(SKIA_ON_MAC_CHROMIUM)
RemoteFontStream* stream = new RemoteFontStream(buffer);
fontCustomPlatformData->m_typeface = SkTypeface::CreateFromStream(stream);
Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h 2012-06-29 18:14:47 UTC (rev 121575)
@@ -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 @@
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
Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -233,6 +233,15 @@
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));
Modified: trunk/Source/WebCore/platform/graphics/mac/WebLayer.h (121574 => 121575)
--- trunk/Source/WebCore/platform/graphics/mac/WebLayer.h 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/graphics/mac/WebLayer.h 2012-06-29 18:14:47 UTC (rev 121575)
@@ -36,6 +36,13 @@
class PlatformCALayerClient;
}
+#if defined(BUILDING_ON_LEOPARD)
+@interface CALayer(WebLayerInternal)
+- (CGAffineTransform)contentsTransform;
+- (void)setContentsTransform:(CGAffineTransform)t;
+@end
+#endif
+
@interface WebLayer : CALayer
{
}
Modified: trunk/Source/WebCore/platform/mac/CursorMac.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/CursorMac.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/CursorMac.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -254,7 +254,11 @@
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 @@
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 @@
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:
Modified: trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp 2012-06-29 18:14:47 UTC (rev 121575)
@@ -29,20 +29,40 @@
#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
}
Modified: trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h 2012-06-29 18:14:47 UTC (rev 121575)
@@ -29,6 +29,10 @@
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#ifdef BUILDING_ON_LEOPARD
+#include "Timer.h"
+#endif
+
namespace WebCore {
class DisplaySleepDisabler {
@@ -36,11 +40,18 @@
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
};
}
Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.h (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/HTMLConverter.h 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.h 2012-06-29 18:14:47 UTC (rev 121575)
@@ -79,10 +79,12 @@
} _flags;
}
+#if !defined(BUILDING_ON_LEOPARD)
- (id)init;
- (id)initWithDOMRange:(DOMRange *)domRange;
- (NSAttributedString *)attributedString;
+#endif
+ (NSAttributedString *)editingAttributedStringFromRange:(WebCore::Range*)range;
@end
Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -50,6 +50,7 @@
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 @@
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 @@
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
{
Modified: trunk/Source/WebCore/platform/mac/PopupMenuMac.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/PopupMenuMac.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/PopupMenuMac.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -75,8 +75,10 @@
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 @@
[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 @@
[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.
Modified: trunk/Source/WebCore/platform/mac/ScrollElasticityController.mm (121574 => 121575)
--- trunk/Source/WebCore/platform/mac/ScrollElasticityController.mm 2012-06-29 17:55:46 UTC (rev 121574)
+++ trunk/Source/WebCore/platform/mac/ScrollElasticityController.mm 2012-06-29 18:14:47 UTC (rev 121575)
@@ -33,6 +33,12 @@
#if ENABLE(RUBBER_BANDING)
+#ifdef BUILDING_ON_LEOPARD
+@interface NSProcessInfo (ScrollAnimatorMacExt)
+- (NSTimeInterval)systemUptime;
+@end
+#endif
+
#if ENABLE(RUBBER_BANDING)
static NSTimeInterval systemUptime()
{