summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/WebCoreSupport/mac
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebKit2/WebProcess/WebCoreSupport/mac
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebKit2/WebProcess/WebCoreSupport/mac')
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm13
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm42
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm115
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm35
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm15
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm1
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm5
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm43
8 files changed, 84 insertions, 185 deletions
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
index 32d08b2..750a397 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
@@ -23,13 +23,14 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "WebContextMenuClient.h"
+#import "config.h"
+#import "WebContextMenuClient.h"
-#include "NotImplemented.h"
-#include "WebPage.h"
-#include <WebCore/Frame.h>
-#include <WebCore/Page.h>
-#include <wtf/text/WTFString.h>
+#import "NotImplemented.h"
+#import "WebPage.h"
+#import <WebCore/Frame.h>
+#import <WebCore/Page.h>
+#import <wtf/text/WTFString.h>
using namespace WebCore;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm
deleted file mode 100644
index d4eb3ac..0000000
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "WebDatabaseManager.h"
-
-namespace WebKit {
-
-NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
-
-String WebDatabaseManager::databaseDirectory() const
-{
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey];
- if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
- databasesDirectory = @"~/Library/WebKit/Databases";
-
- return [databasesDirectory stringByStandardizingPath];
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
index 9952e3f..5169b23 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
@@ -23,10 +23,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
+#import "WebDragClient.h"
+
#import "PasteboardTypes.h"
#import "ShareableBitmap.h"
#import "WebCoreArgumentCoders.h"
-#import "WebDragClient.h"
#import "WebPage.h"
#import "WebPageProxyMessages.h"
#import <WebCore/CachedImage.h>
@@ -45,35 +47,8 @@ using namespace WebCore;
namespace WebKit {
-const float DragLabelBorderX = 4;
-//Keep border_y in synch with DragController::LinkDragBorderInset
-const float DragLabelBorderY = 2;
-const float DragLabelRadius = 5;
-const float LabelBorderYOffset = 2;
-
-const float MinDragLabelWidthBeforeClip = 120;
-const float MaxDragLabelWidth = 320;
-
-const float DragLinkLabelFontsize = 11;
-const float DragLinkUrlFontSize = 10;
-
using namespace WebCore;
-
-static Font& fontFromNSFont(NSFont *font)
-{
- static NSFont *currentFont;
- DEFINE_STATIC_LOCAL(Font, currentRenderer, ());
-
- if ([font isEqual:currentFont])
- return currentRenderer;
- if (currentFont)
- CFRelease(currentFont);
- currentFont = font;
- CFRetain(currentFont);
- currentRenderer = Font(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
- return currentRenderer;
-}
-
+
void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const IntPoint& eventPos, Clipboard* clipboard, Frame* frame, bool linkDrag)
{
if (!frame)
@@ -98,88 +73,6 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const
m_page->send(Messages::WebPageProxy::SetDragImage(clientPoint, IntSize([dragNSImage size]), handle, linkDrag));
}
-DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& title, Frame* frame)
-{
- if (!frame)
- return nil;
- NSString *label = 0;
- if (!title.isEmpty())
- label = title;
- NSURL *cocoaURL = url;
- NSString *urlString = [cocoaURL _web_userVisibleString];
-
- BOOL drawURLString = YES;
- BOOL clipURLString = NO;
- BOOL clipLabelString = NO;
-
- if (!label) {
- drawURLString = NO;
- label = urlString;
- }
-
- NSFont *labelFont = [[NSFontManager sharedFontManager] convertFont:[NSFont systemFontOfSize:DragLinkLabelFontsize]
- toHaveTrait:NSBoldFontMask];
- NSFont *urlFont = [NSFont systemFontOfSize:DragLinkUrlFontSize];
- NSSize labelSize;
- labelSize.width = [label _web_widthWithFont: labelFont];
- labelSize.height = [labelFont ascender] - [labelFont descender];
- if (labelSize.width > MaxDragLabelWidth){
- labelSize.width = MaxDragLabelWidth;
- clipLabelString = YES;
- }
-
- NSSize imageSize;
- imageSize.width = labelSize.width + DragLabelBorderX * 2;
- imageSize.height = labelSize.height + DragLabelBorderY * 2;
- if (drawURLString) {
- NSSize urlStringSize;
- urlStringSize.width = [urlString _web_widthWithFont: urlFont];
- urlStringSize.height = [urlFont ascender] - [urlFont descender];
- imageSize.height += urlStringSize.height;
- if (urlStringSize.width > MaxDragLabelWidth) {
- imageSize.width = max(MaxDragLabelWidth + DragLabelBorderY * 2, MinDragLabelWidthBeforeClip);
- clipURLString = YES;
- } else
- imageSize.width = max(labelSize.width + DragLabelBorderX * 2, urlStringSize.width + DragLabelBorderX * 2);
- }
- NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease];
- [dragImage lockFocus];
-
- [[NSColor colorWithDeviceRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set];
-
- // Drag a rectangle with rounded corners
- NSBezierPath *path = [NSBezierPath bezierPath];
- [path appendBezierPathWithOvalInRect: NSMakeRect(0, 0, DragLabelRadius * 2, DragLabelRadius * 2)];
- [path appendBezierPathWithOvalInRect: NSMakeRect(0, imageSize.height - DragLabelRadius * 2, DragLabelRadius * 2, DragLabelRadius * 2)];
- [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DragLabelRadius * 2, imageSize.height - DragLabelRadius * 2, DragLabelRadius * 2, DragLabelRadius * 2)];
- [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DragLabelRadius * 2, 0, DragLabelRadius * 2, DragLabelRadius * 2)];
-
- [path appendBezierPathWithRect: NSMakeRect(DragLabelRadius, 0, imageSize.width - DragLabelRadius * 2, imageSize.height)];
- [path appendBezierPathWithRect: NSMakeRect(0, DragLabelRadius, DragLabelRadius + 10, imageSize.height - 2 * DragLabelRadius)];
- [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DragLabelRadius - 20, DragLabelRadius, DragLabelRadius + 20, imageSize.height - 2 * DragLabelRadius)];
- [path fill];
-
- NSColor *topColor = [NSColor colorWithDeviceWhite:0.0f alpha:0.75f];
- NSColor *bottomColor = [NSColor colorWithDeviceWhite:1.0f alpha:0.5f];
- if (drawURLString) {
- if (clipURLString)
- //urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DragLabelBorderX * 2) withFont:urlFont];
- urlString = StringTruncator::centerTruncate(urlString, imageSize.width - (DragLabelBorderX * 2), fontFromNSFont(urlFont));
- [urlString _web_drawDoubledAtPoint:NSMakePoint(DragLabelBorderX, DragLabelBorderY - [urlFont descender])
- withTopColor:topColor bottomColor:bottomColor font:urlFont];
- }
-
- if (clipLabelString)
- //label = [WebStringTruncator rightTruncateString: label toWidth:imageSize.width - (DragLabelBorderX * 2) withFont:labelFont];
- label = StringTruncator::rightTruncate(label, imageSize.width - (DragLabelBorderX * 2), fontFromNSFont(labelFont));
- [label _web_drawDoubledAtPoint:NSMakePoint (DragLabelBorderX, imageSize.height - LabelBorderYOffset - [labelFont pointSize])
- withTopColor:topColor bottomColor:bottomColor font:labelFont];
-
- [dragImage unlockFocus];
-
- return dragImage;
-}
-
static void writeURL(NSPasteboard* pasteboard, NSURL* URL, NSString* title, NSArray* types)
{
ASSERT(URL);
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
index ce33890..ee87ea2 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
@@ -27,26 +27,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebEditorClient.h"
#define DISABLE_NOT_IMPLEMENTED_WARNINGS 1
-#include "NotImplemented.h"
-
-#include "WebCoreArgumentCoders.h"
-#include "WebPage.h"
-#include "WebFrame.h"
-#include "WebPageProxyMessages.h"
-#include "WebProcess.h"
-#include <WebCore/ArchiveResource.h>
-#include <WebCore/DocumentFragment.h>
-#include <WebCore/DOMDocumentFragmentInternal.h>
-#include <WebCore/DOMDocumentInternal.h>
-#include <WebCore/FocusController.h>
-#include <WebCore/Frame.h>
-#include <WebCore/KeyboardEvent.h>
-#include <WebCore/Page.h>
-#include <WebKit/WebResource.h>
-#include <WebKit/WebNSURLExtras.h>
+#import "NotImplemented.h"
+
+#import "WebCoreArgumentCoders.h"
+#import "WebPage.h"
+#import "WebFrame.h"
+#import "WebPageProxyMessages.h"
+#import "WebProcess.h"
+#import <WebCore/ArchiveResource.h>
+#import <WebCore/DocumentFragment.h>
+#import <WebCore/DOMDocumentFragmentInternal.h>
+#import <WebCore/DOMDocumentInternal.h>
+#import <WebCore/FocusController.h>
+#import <WebCore/Frame.h>
+#import <WebCore/KeyboardEvent.h>
+#import <WebCore/Page.h>
+#import <WebKit/WebResource.h>
+#import <WebKit/WebNSURLExtras.h>
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#import <AppKit/NSTextChecker.h>
#endif
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
index 549d7ee..677c537 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
@@ -23,13 +23,14 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "WebErrors.h"
-
-#include "WKError.h"
-#include "WebError.h"
-#include <WebCore/ResourceRequest.h>
-#include <WebCore/ResourceResponse.h>
-#include <pthread.h>
+#import "config.h"
+#import "WebErrors.h"
+
+#import "WKError.h"
+#import "WebError.h"
+#import <WebCore/ResourceRequest.h>
+#import <WebCore/ResourceResponse.h>
+#import <pthread.h>
using namespace WebCore;
using namespace WebKit;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm
index 570d351..d91e8e8 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm
@@ -17,6 +17,7 @@
Boston, MA 02110-1301, USA.
*/
+#import "config.h"
#import "WebFrameNetworkingContext.h"
#import <WebCore/Page.h>
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
index 4d3d167..7e446b7 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
@@ -23,9 +23,10 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "WebPopupMenu.h"
+#import "config.h"
+#import "WebPopupMenu.h"
-#include "PlatformPopupMenuData.h"
+#import "PlatformPopupMenuData.h"
using namespace WebCore;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
index f81b627..2d74bbc 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
@@ -23,6 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebSystemInterface.h"
#import <WebCore/WebCoreSystemInterface.h>
@@ -55,6 +56,7 @@ void InitWebCoreSystemInterface(void)
INIT(GetFontInLanguageForRange);
INIT(GetGlyphTransformedAdvances);
INIT(GetGlyphsForCharacters);
+ INIT(GetHTTPPipeliningPriority);
INIT(GetMIMETypeForExtension);
INIT(GetNSURLResponseLastModifiedDate);
INIT(GetPreferredExtensionForMIMEType);
@@ -82,6 +84,7 @@ void InitWebCoreSystemInterface(void)
INIT(SetCONNECTProxyForStream);
INIT(SetCookieStoragePrivateBrowsingEnabled);
INIT(SetDragImage);
+ INIT(SetHTTPPipeliningPriority);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
INIT(SetPatternBaseCTM);
@@ -92,11 +95,51 @@ void InitWebCoreSystemInterface(void)
INIT(SignalCFReadStreamHasBytes);
#if !defined(BUILDING_ON_SNOW_LEOPARD)
+ INIT(IOSurfaceContextCreate);
+ INIT(IOSurfaceContextCreateImage);
INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
INIT(MakeScrollbarPainter);
+ INIT(ScrollbarPainterSetDelegate);
INIT(ScrollbarPainterPaint);
+ INIT(ScrollbarThickness);
+ INIT(ScrollbarMinimumThumbLength);
+ INIT(ScrollbarMinimumTotalLengthNeededForThumb);
+ INIT(ScrollbarPainterKnobAlpha);
+ INIT(SetScrollbarPainterKnobAlpha);
+ INIT(ScrollbarPainterTrackAlpha);
+ INIT(SetScrollbarPainterTrackAlpha);
+ INIT(ScrollbarPainterIsHorizontal);
+ INIT(ScrollbarPainterSetOverlayState);
+ INIT(MakeScrollbarPainterController);
+ INIT(MakeScrollbarReplacementPainter);
+ INIT(SetPainterForPainterController);
+ INIT(VerticalScrollbarPainterForController);
+ INIT(HorizontalScrollbarPainterForController);
+ INIT(SetScrollbarPainterControllerStyle);
+ INIT(ContentAreaScrolled);
+ INIT(ContentAreaWillPaint);
+ INIT(MouseEnteredContentArea);
+ INIT(MouseExitedContentArea);
+ INIT(MouseMovedInContentArea);
+ INIT(WillStartLiveResize);
+ INIT(ContentAreaResized);
+ INIT(WillEndLiveResize);
+ INIT(ContentAreaDidShow);
+ INIT(ContentAreaDidHide);
+ INIT(ScrollbarPainterUsesOverlayScrollers);
#else
INIT(GetHyphenationLocationBeforeIndex);
#endif
+
+ INIT(GetAXTextMarkerTypeID);
+ INIT(GetAXTextMarkerRangeTypeID);
+ INIT(CreateAXTextMarker);
+ INIT(GetBytesFromAXTextMarker);
+ INIT(CreateAXTextMarkerRange);
+ INIT(CopyAXTextMarkerRangeStart);
+ INIT(CopyAXTextMarkerRangeEnd);
+ INIT(AccessibilityHandleFocusChanged);
+ INIT(CreateAXUIElementRef);
+ INIT(UnregisterUniqueIdForElement);
});
}