diff options
Diffstat (limited to 'Source/WebCore/platform/mac')
8 files changed, 42 insertions, 15 deletions
diff --git a/Source/WebCore/platform/mac/ClipboardMac.h b/Source/WebCore/platform/mac/ClipboardMac.h index 75517c161..305a92ff9 100644 --- a/Source/WebCore/platform/mac/ClipboardMac.h +++ b/Source/WebCore/platform/mac/ClipboardMac.h @@ -62,7 +62,7 @@ public: virtual bool hasData(); // extensions beyond IE's API - virtual HashSet<String> types() const; + virtual ListHashSet<String> types() const; virtual PassRefPtr<FileList> files() const; void setDragImage(CachedImage*, const IntPoint&); diff --git a/Source/WebCore/platform/mac/ClipboardMac.mm b/Source/WebCore/platform/mac/ClipboardMac.mm index 1af14df9c..bd8802044 100644 --- a/Source/WebCore/platform/mac/ClipboardMac.mm +++ b/Source/WebCore/platform/mac/ClipboardMac.mm @@ -65,6 +65,8 @@ ClipboardMac::ClipboardMac(ClipboardType clipboardType, const String& pasteboard ClipboardMac::~ClipboardMac() { + if (m_dragImage) + m_dragImage->removeClient(this); } bool ClipboardMac::hasData() @@ -120,7 +122,7 @@ static String utiTypeFromCocoaType(const String& type) return String(); } -static void addHTMLClipboardTypesForCocoaType(HashSet<String>& resultTypes, const String& cocoaType, const String& pasteboardName) +static void addHTMLClipboardTypesForCocoaType(ListHashSet<String>& resultTypes, const String& cocoaType, const String& pasteboardName) { // UTI may not do these right, so make sure we get the right, predictable result if (cocoaType == String(NSStringPboardType)) { @@ -282,10 +284,10 @@ bool ClipboardMac::setData(const String &type, const String &data) return false; } -HashSet<String> ClipboardMac::types() const +ListHashSet<String> ClipboardMac::types() const { if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) - return HashSet<String>(); + return ListHashSet<String>(); Vector<String> types; platformStrategies()->pasteboardStrategy()->getTypes(types, m_pasteboardName); @@ -293,9 +295,9 @@ HashSet<String> ClipboardMac::types() const // Enforce changeCount ourselves for security. We check after reading instead of before to be // sure it doesn't change between our testing the change count and accessing the data. if (m_changeCount != platformStrategies()->pasteboardStrategy()->changeCount(m_pasteboardName)) - return HashSet<String>(); + return ListHashSet<String>(); - HashSet<String> result; + ListHashSet<String> result; // FIXME: This loop could be split into two stages. One which adds all the HTML5 specified types // and a second which adds all the extra types from the cocoa clipboard (which is Mac-only behavior). for (size_t i = 0; i < types.size(); i++) { diff --git a/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h b/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h index d4df7e60e..824f2ff8d 100644 --- a/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h +++ b/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h @@ -39,6 +39,7 @@ public: private: GraphicsContext* m_savedGraphicsContext; NSGraphicsContext* m_savedNSGraphicsContext; + bool m_didSetGraphicsContext; #if USE(SKIA) gfx::SkiaBitLocker m_skiaBitLocker; #endif diff --git a/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm b/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm index 5f1d07c67..f033df32c 100644 --- a/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm +++ b/Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm @@ -30,8 +30,9 @@ namespace WebCore { LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphicsContext) + : m_didSetGraphicsContext(false) #if USE(SKIA) - : m_skiaBitLocker(graphicsContext->platformContext()->canvas()) + , m_skiaBitLocker(graphicsContext->platformContext()->canvas()) #endif { m_savedGraphicsContext = graphicsContext; @@ -42,20 +43,21 @@ LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphi m_savedNSGraphicsContext = 0; return; } - + m_savedNSGraphicsContext = [[NSGraphicsContext currentContext] retain]; NSGraphicsContext* newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES]; [NSGraphicsContext setCurrentContext:newContext]; + m_didSetGraphicsContext = true; } LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext() { - m_savedGraphicsContext->restore(); - - if (m_savedNSGraphicsContext) { + if (m_didSetGraphicsContext) { [NSGraphicsContext setCurrentContext:m_savedNSGraphicsContext]; [m_savedNSGraphicsContext release]; } + + m_savedGraphicsContext->restore(); } CGContextRef LocalCurrentGraphicsContext::cgContext() diff --git a/Source/WebCore/platform/mac/PasteboardMac.mm b/Source/WebCore/platform/mac/PasteboardMac.mm index 750130fc4..95af8f6c7 100644 --- a/Source/WebCore/platform/mac/PasteboardMac.mm +++ b/Source/WebCore/platform/mac/PasteboardMac.mm @@ -49,6 +49,7 @@ #import "MIMETypeRegistry.h" #import "Page.h" #import "RenderImage.h" +#import "ResourceBuffer.h" #import "Text.h" #import "WebCoreNSStringExtras.h" #import "WebNSAttributedStringExtras.h" @@ -260,7 +261,7 @@ void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame) static NSFileWrapper* fileWrapperForImage(CachedResource* resource, NSURL *url) { - SharedBuffer* coreData = resource->data(); + ResourceBuffer* coreData = resource->resourceBuffer(); NSData *data = [[[NSData alloc] initWithBytes:coreData->data() length:coreData->size()] autorelease]; NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease]; String coreMIMEType = resource->response().mimeType(); diff --git a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm index 96aa12a26..84fd0feb3 100644 --- a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm +++ b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm @@ -86,8 +86,8 @@ static ScrollbarPainterMap* scrollbarMap() return; ScrollbarPainterMap::iterator end = scrollbarMap()->end(); for (ScrollbarPainterMap::iterator it = scrollbarMap()->begin(); it != end; ++it) { - it->first->styleChanged(); - it->first->invalidate(); + it->key->styleChanged(); + it->key->invalidate(); } } @@ -477,6 +477,7 @@ void ScrollbarThemeMac::updateEnabledState(ScrollbarThemeClient* scrollbar) [scrollbarMap()->get(scrollbar).get() setEnabled:scrollbar->enabled()]; } +#if !PLATFORM(CHROMIUM) static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enabled, double value, CGFloat proportion, CGRect frameRect) { [scrollbarPainter setEnabled:enabled]; @@ -494,7 +495,6 @@ static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enable [scrollbarPainter drawKnob]; } -#if !PLATFORM(CHROMIUM) bool ScrollbarThemeMac::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect) { if (isScrollbarOverlayAPIAvailable()) { diff --git a/Source/WebCore/platform/mac/WebCoreSystemInterface.h b/Source/WebCore/platform/mac/WebCoreSystemInterface.h index 940e4a625..c5df5d199 100644 --- a/Source/WebCore/platform/mac/WebCoreSystemInterface.h +++ b/Source/WebCore/platform/mac/WebCoreSystemInterface.h @@ -120,6 +120,9 @@ typedef enum { wkPatternTilingConstantSpacing } wkPatternTiling; extern void (*wkCGContextResetClip)(CGContextRef); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +extern bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef); +#endif extern CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int); extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), void (*formFinalize)(CFReadStreamRef, void *), @@ -232,6 +235,17 @@ extern int (*wkGetNSEventMomentumPhase)(NSEvent *); extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 +enum { + wkCTFontTransformApplyShaping = (1 << 0), + wkCTFontTransformApplyPositioning = (1 << 1) +}; + +typedef int wkCTFontTransformOptions; + +extern bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options); +#endif + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 extern CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options); diff --git a/Source/WebCore/platform/mac/WebCoreSystemInterface.mm b/Source/WebCore/platform/mac/WebCoreSystemInterface.mm index 379b6830e..a467a4b16 100644 --- a/Source/WebCore/platform/mac/WebCoreSystemInterface.mm +++ b/Source/WebCore/platform/mac/WebCoreSystemInterface.mm @@ -33,6 +33,9 @@ void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef conte #endif BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef); void (*wkCGContextResetClip)(CGContextRef); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef); +#endif CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int); CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef); NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*); @@ -133,6 +136,10 @@ int (*wkGetNSEventMomentumPhase)(NSEvent *); #endif CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 +bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options); +#endif + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options); |