summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/mac')
-rw-r--r--WebCore/platform/mac/GeolocationServiceMac.mm2
-rw-r--r--WebCore/platform/mac/KeyEventMac.mm16
-rw-r--r--WebCore/platform/mac/LocalizedStringsMac.mm17
-rw-r--r--WebCore/platform/mac/PasteboardMac.mm8
-rw-r--r--WebCore/platform/mac/PlatformMouseEventMac.mm18
-rw-r--r--WebCore/platform/mac/PopupMenuMac.mm21
-rw-r--r--WebCore/platform/mac/RuntimeApplicationChecks.h1
-rw-r--r--WebCore/platform/mac/RuntimeApplicationChecks.mm6
-rw-r--r--WebCore/platform/mac/ScrollViewMac.mm17
-rw-r--r--WebCore/platform/mac/ScrollbarThemeMac.mm2
-rw-r--r--WebCore/platform/mac/ThemeMac.mm2
-rw-r--r--WebCore/platform/mac/WebCoreObjCExtras.mm5
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.h9
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.mm7
-rw-r--r--WebCore/platform/mac/WidgetMac.mm62
15 files changed, 117 insertions, 76 deletions
diff --git a/WebCore/platform/mac/GeolocationServiceMac.mm b/WebCore/platform/mac/GeolocationServiceMac.mm
index 1093e69..9c781ad 100644
--- a/WebCore/platform/mac/GeolocationServiceMac.mm
+++ b/WebCore/platform/mac/GeolocationServiceMac.mm
@@ -25,7 +25,7 @@
#import "config.h"
-#if ENABLE(GEOLOCATION)
+#if ENABLE(GEOLOCATION) && !ENABLE(CLIENT_BASED_GEOLOCATION)
#import "GeolocationServiceMac.h"
diff --git a/WebCore/platform/mac/KeyEventMac.mm b/WebCore/platform/mac/KeyEventMac.mm
index b6c3b21..2e1579b 100644
--- a/WebCore/platform/mac/KeyEventMac.mm
+++ b/WebCore/platform/mac/KeyEventMac.mm
@@ -368,6 +368,9 @@ static bool isKeypadEvent(NSEvent* event)
return false;
}
+ if ([event modifierFlags] & NSNumericPadKeyMask)
+ return true;
+
switch ([event keyCode]) {
case 71: // Clear
case 81: // =
@@ -808,6 +811,19 @@ static inline String unmodifiedTextFromEvent(NSEvent* event)
return [event charactersIgnoringModifiers];
}
+PlatformKeyboardEvent::PlatformKeyboardEvent()
+ : m_type(KeyDown)
+ , m_autoRepeat(false)
+ , m_windowsVirtualKeyCode(0)
+ , m_nativeVirtualKeyCode(0)
+ , m_isKeypad(false)
+ , m_shiftKey(false)
+ , m_ctrlKey(false)
+ , m_altKey(false)
+ , m_metaKey(false)
+{
+}
+
PlatformKeyboardEvent::PlatformKeyboardEvent(NSEvent *event)
: m_type(isKeyUpEvent(event) ? PlatformKeyboardEvent::KeyUp : PlatformKeyboardEvent::KeyDown)
, m_text(textFromEvent(event))
diff --git a/WebCore/platform/mac/LocalizedStringsMac.mm b/WebCore/platform/mac/LocalizedStringsMac.mm
index c438d6b..55fdd21 100644
--- a/WebCore/platform/mac/LocalizedStringsMac.mm
+++ b/WebCore/platform/mac/LocalizedStringsMac.mm
@@ -683,6 +683,23 @@ String AXLinkActionVerb()
return String();
}
+String AXMenuListPopupActionVerb()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] AXMenuListPopupActionVerb];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String AXMenuListActionVerb()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] AXMenuListActionVerb];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+
String multipleFileUploadText(unsigned numberOfFiles)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
diff --git a/WebCore/platform/mac/PasteboardMac.mm b/WebCore/platform/mac/PasteboardMac.mm
index f048791..8aa7f2c 100644
--- a/WebCore/platform/mac/PasteboardMac.mm
+++ b/WebCore/platform/mac/PasteboardMac.mm
@@ -136,7 +136,7 @@ static NSAttributedString *stripAttachmentCharacters(NSAttributedString *string)
void Pasteboard::writeSelection(NSPasteboard* pasteboard, Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
{
if (!WebArchivePboardType)
- Pasteboard::generalPasteboard(); // Initialises pasteboard types
+ Pasteboard::generalPasteboard(); // Initializes pasteboard types.
ASSERT(selectedRange);
NSAttributedString *attributedString = [[[NSAttributedString alloc] _initWithDOMRange:kit(selectedRange)] autorelease];
@@ -206,7 +206,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
void Pasteboard::writePlainText(const String& text)
{
if (!WebArchivePboardType)
- Pasteboard::generalPasteboard(); // Initialises pasteboard types
+ Pasteboard::generalPasteboard(); // Initializes pasteboard types.
NSArray *types = [NSArray arrayWithObject:NSStringPboardType];
NSPasteboard *pasteboard = m_pasteboard.get();
@@ -218,7 +218,7 @@ void Pasteboard::writePlainText(const String& text)
void Pasteboard::writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame)
{
if (!WebArchivePboardType)
- Pasteboard::generalPasteboard(); // Initialises pasteboard types
+ Pasteboard::generalPasteboard(); // Initializes pasteboard types.
if (!types) {
types = writableTypesForURL();
@@ -372,7 +372,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
}
}
if ([HTMLString length] != 0) {
- RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(frame->document(), HTMLString, "");
+ RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(frame->document(), HTMLString, "", FragmentScriptingNotAllowed);
if (fragment)
return fragment.release();
}
diff --git a/WebCore/platform/mac/PlatformMouseEventMac.mm b/WebCore/platform/mac/PlatformMouseEventMac.mm
index 74f694e..5b84b4f 100644
--- a/WebCore/platform/mac/PlatformMouseEventMac.mm
+++ b/WebCore/platform/mac/PlatformMouseEventMac.mm
@@ -158,4 +158,22 @@ PlatformMouseEvent::PlatformMouseEvent(NSEvent* event, NSView *windowView)
{
}
+PlatformMouseEvent::PlatformMouseEvent(int x, int y, int globalX, int globalY, MouseButton button, MouseEventType eventType,
+ int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp,
+ unsigned modifierFlags, int eventNumber)
+ : m_position(IntPoint(x, y))
+ , m_globalPosition(IntPoint(globalX, globalY))
+ , m_button(button)
+ , m_eventType(eventType)
+ , m_clickCount(clickCount)
+ , m_shiftKey(shiftKey)
+ , m_ctrlKey(ctrlKey)
+ , m_altKey(altKey)
+ , m_metaKey(metaKey)
+ , m_timestamp(timestamp)
+ , m_modifierFlags(modifierFlags)
+ , m_eventNumber(eventNumber)
+{
+}
+
}
diff --git a/WebCore/platform/mac/PopupMenuMac.mm b/WebCore/platform/mac/PopupMenuMac.mm
index dfb0fff..22f1e5b 100644
--- a/WebCore/platform/mac/PopupMenuMac.mm
+++ b/WebCore/platform/mac/PopupMenuMac.mm
@@ -20,6 +20,7 @@
#import "config.h"
#import "PopupMenu.h"
+#import "Chrome.h"
#import "ChromeClient.h"
#import "EventHandler.h"
#import "Frame.h"
@@ -80,8 +81,14 @@ void PopupMenu::populate()
else {
PopupMenuStyle style = client()->itemStyle(i);
NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
- if (style.font() != Font())
- [attributes setObject:style.font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
+ if (style.font() != Font()) {
+ NSFont *font = style.font().primaryFont()->getNSFont();
+ if (!font) {
+ CGFloat size = style.font().primaryFont()->platformData().size();
+ font = style.font().weight() < FontWeightBold ? [NSFont systemFontOfSize:size] : [NSFont boldSystemFontOfSize:size];
+ }
+ [attributes setObject:font forKey:NSFontAttributeName];
+ }
// FIXME: Add support for styling the foreground and background colors.
// FIXME: Find a way to customize text color when an item is highlighted.
NSAttributedString* string = [[NSAttributedString alloc] initWithString:client()->itemText(i) attributes:attributes];
@@ -99,6 +106,8 @@ void PopupMenu::populate()
[[m_popup.get() menu] setMenuChangedMessagesEnabled:messagesEnabled];
}
+#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
void PopupMenu::show(const IntRect& r, FrameView* v, int index)
{
populate();
@@ -179,6 +188,14 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
[event release];
}
+#else
+
+void PopupMenu::show(const IntRect&, FrameView*, int)
+{
+}
+
+#endif
+
void PopupMenu::hide()
{
[m_popup.get() dismissPopUp];
diff --git a/WebCore/platform/mac/RuntimeApplicationChecks.h b/WebCore/platform/mac/RuntimeApplicationChecks.h
index f9c7079..24b8ae1 100644
--- a/WebCore/platform/mac/RuntimeApplicationChecks.h
+++ b/WebCore/platform/mac/RuntimeApplicationChecks.h
@@ -31,6 +31,7 @@ namespace WebCore {
bool applicationIsAppleMail();
bool applicationIsSafari();
bool applicationIsMicrosoftMessenger();
+bool applicationIsAdobeInstaller();
} // namespace WebCore
diff --git a/WebCore/platform/mac/RuntimeApplicationChecks.mm b/WebCore/platform/mac/RuntimeApplicationChecks.mm
index a3c4aa5..bcc1dc9 100644
--- a/WebCore/platform/mac/RuntimeApplicationChecks.mm
+++ b/WebCore/platform/mac/RuntimeApplicationChecks.mm
@@ -47,4 +47,10 @@ bool applicationIsMicrosoftMessenger()
return isMicrosoftMessenger;
}
+bool applicationIsAdobeInstaller()
+{
+ static bool isAdobeInstaller = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.adobe.Installers.Setup"];
+ return isAdobeInstaller;
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/mac/ScrollViewMac.mm b/WebCore/platform/mac/ScrollViewMac.mm
index f31b301..7ef5dc4 100644
--- a/WebCore/platform/mac/ScrollViewMac.mm
+++ b/WebCore/platform/mac/ScrollViewMac.mm
@@ -57,8 +57,6 @@ NSView *ScrollView::documentView() const
return nil;
}
-#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
-
void ScrollView::platformAddChild(Widget* child)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -109,13 +107,12 @@ bool ScrollView::platformCanBlitOnScroll() const
IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- if (includeScrollbars) {
- if (NSView* documentView = this->documentView())
- return enclosingIntRect([documentView visibleRect]);
- }
- return enclosingIntRect([scrollView() documentVisibleRect]);
- END_BLOCK_OBJC_EXCEPTIONS;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ IntRect result = enclosingIntRect([scrollView() documentVisibleRect]);
+ if (includeScrollbars)
+ result.setSize(IntSize([scrollView() frame].size));
+ return result;
+ END_BLOCK_OBJC_EXCEPTIONS;
return IntRect();
}
@@ -205,6 +202,4 @@ bool ScrollView::platformIsOffscreen() const
return ![platformWidget() window] || ![[platformWidget() window] isVisible];
}
-#endif // !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
-
} // namespace WebCore
diff --git a/WebCore/platform/mac/ScrollbarThemeMac.mm b/WebCore/platform/mac/ScrollbarThemeMac.mm
index b4b8f62..067f28f 100644
--- a/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -362,7 +362,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
trackInfo.min = 0;
trackInfo.max = scrollbar->maximum();
trackInfo.value = scrollbar->currentPos();
- trackInfo.trackInfo.scrollbar.viewsize = scrollbar->pageStep();
+ trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
trackInfo.attributes = 0;
if (scrollbar->orientation() == HorizontalScrollbar)
trackInfo.attributes |= kThemeTrackHorizontal;
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index a95fee4..2812607 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -355,7 +355,7 @@ static void setupButtonCell(NSButtonCell *&buttonCell, ControlPart part, Control
} else if ([buttonCell bezelStyle] != NSRoundedBezelStyle)
[buttonCell setBezelStyle:NSRoundedBezelStyle];
- setControlSize(buttonCell, buttonSizes(), zoomedRect.size(), zoomFactor);
+ setControlSize(buttonCell, sizes, zoomedRect.size(), zoomFactor);
// Update the various states we respond to.
updateStates(buttonCell, states);
diff --git a/WebCore/platform/mac/WebCoreObjCExtras.mm b/WebCore/platform/mac/WebCoreObjCExtras.mm
index cb8d504..4fc757c 100644
--- a/WebCore/platform/mac/WebCoreObjCExtras.mm
+++ b/WebCore/platform/mac/WebCoreObjCExtras.mm
@@ -72,8 +72,13 @@ bool WebCoreObjCScheduleDeallocateOnMainThread(Class cls, id object)
{
ASSERT([object isKindOfClass:cls]);
+#if USE(WEB_THREAD)
+ if (isMainThread())
+ return false;
+#else
if (pthread_main_np() != 0)
return false;
+#endif
ClassAndIdPair* pair = new ClassAndIdPair(cls, object);
callOnMainThread(deallocCallback, pair);
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index 917ab0b..e7521dc 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -48,6 +48,7 @@ typedef struct _NSRect NSRect;
@class NSFont;
@class NSImage;
@class NSMenu;
+@class NSMutableArray;
@class NSMutableURLRequest;
@class NSString;
@class NSTextFieldCell;
@@ -66,6 +67,7 @@ typedef struct NSEvent NSEvent;
typedef struct NSFont NSFont;
typedef struct NSImage NSImage;
typedef struct NSMenu NSMenu;
+typedef struct NSMutableArray NSMutableArray;
typedef struct NSMutableURLRequest NSMutableURLRequest;
typedef struct NSURLRequest NSURLRequest;
typedef struct NSString NSString;
@@ -134,6 +136,7 @@ extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
extern void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
+extern CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
extern void (*wkSetUpFontCache)();
extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
@@ -166,6 +169,12 @@ extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
extern BOOL (*wkUseSharedMediaUI)();
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+extern NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
+#else
+extern void* wkNoteOpenPanelFiles;
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index 3a9c011..f3e0e77 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -66,6 +66,7 @@ void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
void (*wkSetUpFontCache)();
void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
@@ -106,3 +107,9 @@ 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)
+NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
+#else
+void* wkNoteOpenPanelFiles;
+#endif
diff --git a/WebCore/platform/mac/WidgetMac.mm b/WebCore/platform/mac/WidgetMac.mm
index ebb47dc..e473053 100644
--- a/WebCore/platform/mac/WidgetMac.mm
+++ b/WebCore/platform/mac/WidgetMac.mm
@@ -31,12 +31,14 @@
#endif
#import "BlockExceptions.h"
+#import "Chrome.h"
#import "Cursor.h"
#import "Document.h"
#import "Font.h"
#import "FoundationExtras.h"
#import "Frame.h"
#import "GraphicsContext.h"
+#import "NotImplemented.h"
#import "Page.h"
#import "PlatformMouseEvent.h"
#import "ScrollView.h"
@@ -44,8 +46,6 @@
#import "WebCoreView.h"
#import <wtf/RetainPtr.h>
-#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
-
@interface NSWindow (WebWindowDetails)
- (BOOL)_needsToResetDragMargins;
- (void)_setNeedsToResetDragMargins:(BOOL)needs;
@@ -56,12 +56,8 @@
- (void)webPlugInSetIsSelected:(BOOL)isSelected;
@end
-#endif
-
namespace WebCore {
-#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
-
class WidgetPrivate {
public:
bool mustStayInWindow;
@@ -163,6 +159,9 @@ void Widget::setFrameRect(const IntRect& rect)
BEGIN_BLOCK_OBJC_EXCEPTIONS;
NSView *v = getOuterView();
+ if (!v)
+ return;
+
NSRect f = rect;
if (!NSEqualRects(f, [v frame])) {
[v setFrame:f];
@@ -198,7 +197,7 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
END_BLOCK_OBJC_EXCEPTIONS;
} else {
// This is the case of drawing into a bitmap context other than a window backing store. It gets hit beneath
- // -cacheDisplayInRect:toBitmapImageRep:.
+ // -cacheDisplayInRect:toBitmapImageRep:, and when painting into compositing layers.
// Transparent subframes are in fact implemented with scroll views that return YES from -drawsBackground (whenever the WebView
// itself is in drawsBackground mode). In the normal drawing code path, the scroll views are never asked to draw the background,
@@ -347,54 +346,5 @@ void Widget::retainPlatformWidget()
HardRetain(m_widget);
}
-#else // ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
-
-Widget::Widget(PlatformWidget widget)
-{
- init(widget);
-}
-
-Widget::~Widget()
-{
- ASSERT(!parent());
-}
-
-void Widget::show()
-{
-}
-
-void Widget::hide()
-{
-}
-
-void Widget::setCursor(const Cursor&)
-{
- notImplemented();
-}
-
-void Widget::paint(GraphicsContext*, const IntRect&)
-{
-}
-
-void Widget::setFocus()
-{
-}
-
-void Widget::setIsSelected(bool)
-{
-}
-
-IntRect Widget::frameRect() const
-{
- return m_frame;
-}
-
-void Widget::setFrameRect(const IntRect& rect)
-{
- m_frame = rect;
-}
-
-#endif
-
} // namespace WebCore