summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/mac/WebCoreSupport
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/WebKit/mac/WebCoreSupport
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/WebKit/mac/WebCoreSupport')
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.h3
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm20
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebDragClient.h1
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebDragClient.mm93
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h2
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm2
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h11
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm16
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm42
9 files changed, 77 insertions, 113 deletions
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 05db524..dda0bb1 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -152,8 +152,6 @@ public:
virtual void formDidFocus(const WebCore::Node*);
virtual void formDidBlur(const WebCore::Node*);
- virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
-
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
virtual void setNeedsOneShotDrawingSynchronization();
@@ -179,6 +177,7 @@ public:
virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*) { }
virtual bool selectItemWritingDirectionIsNatural();
+ virtual bool selectItemAlignmentFollowsMenuWritingDirection();
virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 74c513d..0e7e2f2 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -80,6 +80,10 @@
#import "NetscapePluginHostManager.h"
#endif
+@interface NSApplication (WebNSApplicationDetails)
+- (NSCursor *)_cursorRectCursor;
+@end
+
@interface NSView (WebNSViewDetails)
- (NSView *)_findLastViewInKeyViewLoop;
@end
@@ -678,6 +682,9 @@ void WebChromeClient::chooseIconForFiles(const Vector<String>& filenames, FileCh
void WebChromeClient::setCursor(const WebCore::Cursor& cursor)
{
+ if ([NSApp _cursorRectCursor])
+ return;
+
NSCursor *platformCursor = cursor.platformCursor();
if ([NSCursor currentCursor] == platformCursor)
return;
@@ -742,7 +749,20 @@ void WebChromeClient::formDidBlur(const WebCore::Node* node)
bool WebChromeClient::selectItemWritingDirectionIsNatural()
{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ return false;
+#else
+ return true;
+#endif
+}
+
+bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
return true;
+#else
+ return false;
+#endif
}
PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const
diff --git a/Source/WebKit/mac/WebCoreSupport/WebDragClient.h b/Source/WebKit/mac/WebCoreSupport/WebDragClient.h
index 216a2fb..34a5c2e 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebDragClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebDragClient.h
@@ -36,7 +36,6 @@ public:
virtual void dragControllerDestroyed();
virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint);
virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag);
- virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WTF::String& label, WebCore::Frame*);
virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*);
private:
WebView* m_webView;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm b/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
index b3af658..5a7d597 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
@@ -51,18 +51,6 @@
using namespace WebCore;
-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;
-
WebDragClient::WebDragClient(WebView* webView)
: m_webView(webView)
{
@@ -132,87 +120,6 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const
[topHTMLView dragImage:dragNSImage at:at offset:NSZeroSize event:event pasteboard:pasteboard source:sourceHTMLView slideBack:YES];
}
-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 _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 _web_drawDoubledAtPoint:NSMakePoint (DragLabelBorderX, imageSize.height - LabelBorderYOffset - [labelFont pointSize])
- withTopColor:topColor bottomColor:bottomColor font:labelFont];
-
- [dragImage unlockFocus];
-
- return dragImage;
-}
-
void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame* frame)
{
ASSERT(pasteboard);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 9de4246..f29ba72 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -156,7 +156,7 @@ private:
virtual void dispatchDidChangeBackForwardIndex() const;
virtual void didDisplayInsecureContent();
- virtual void didRunInsecureContent(WebCore::SecurityOrigin*);
+ virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL&);
virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&);
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index f3cdff6..6484584 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -957,7 +957,7 @@ void WebFrameLoaderClient::didDisplayInsecureContent()
CallFrameLoadDelegate(implementations->didDisplayInsecureContentFunc, webView, @selector(webViewDidDisplayInsecureContent:));
}
-void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin)
+void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin, const KURL& insecureURL)
{
RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index 75a3cc6..108c2cc 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -30,6 +30,7 @@
#import <WebCore/InspectorFrontendClientLocal.h>
#import <WebCore/PlatformString.h>
+#import <wtf/Forward.h>
#import <wtf/RetainPtr.h>
#ifdef __OBJC__
@@ -59,14 +60,16 @@ public:
virtual void highlight(WebCore::Node*);
virtual void hideHighlight();
- virtual void populateSetting(const WTF::String& key, WTF::String* value);
- virtual void storeSetting(const WTF::String& key, const WTF::String& value);
-
virtual bool sendMessageToFrontend(const WTF::String&);
+ bool inspectorStartsAttached();
+ void setInspectorStartsAttached(bool);
+
void releaseFrontendPage();
private:
+ WTF::PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings();
+
WebView *m_webView;
RetainPtr<WebNodeHighlighter> m_highlighter;
WebCore::Page* m_frontendPage;
@@ -75,7 +78,7 @@ private:
class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal {
public:
- WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*);
+ WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*, WTF::PassOwnPtr<Settings>);
virtual void frontendLoaded();
diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 5beedcf..d47784f 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -102,7 +102,7 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon
[windowController.get() setInspectorClient:this];
m_frontendPage = core([windowController.get() webView]);
- WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage);
+ WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings());
m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient);
[[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]];
@@ -118,8 +118,8 @@ void WebInspectorClient::hideHighlight()
[m_highlighter.get() hideHighlight];
}
-WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, WebInspectorWindowController* windowController, InspectorController* inspectorController, Page* frontendPage)
- : InspectorFrontendClientLocal(inspectorController, frontendPage)
+WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, WebInspectorWindowController* windowController, InspectorController* inspectorController, Page* frontendPage, WTF::PassOwnPtr<Settings> settings)
+ : InspectorFrontendClientLocal(inspectorController, frontendPage, settings)
, m_inspectedWebView(inspectedWebView)
, m_windowController(windowController)
{
@@ -355,9 +355,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
_visible = YES;
- // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
- // FIXME: This flag can be fetched directly from the flags storage.
- _shouldAttach = [_inspectedWebView page]->inspectorController()->inspectorStartsAttached();
+ _shouldAttach = _inspectorClient->inspectorStartsAttached();
if (_shouldAttach && !_frontendClient->canAttachWindow())
_shouldAttach = NO;
@@ -392,8 +390,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
if (_attachedToInspectedWebView)
return;
- // FIXME: This flag can be saved directly to the flags storage.
- [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(true);
+ _inspectorClient->setInspectorStartsAttached(true);
[self close];
[self showWindow:nil];
@@ -404,8 +401,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
if (!_attachedToInspectedWebView)
return;
- // FIXME: This flag can be saved to the flags storage directly.
- [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(false);
+ _inspectorClient->setInspectorStartsAttached(false);
[self close];
[self showWindow:nil];
diff --git a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
index 70767ee..c39576b 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
@@ -60,6 +60,7 @@ void InitWebCoreSystemInterface(void)
INIT(GetFontInLanguageForCharacter);
INIT(GetFontInLanguageForRange);
INIT(GetGlyphTransformedAdvances);
+ INIT(GetHTTPPipeliningPriority);
INIT(GetMIMETypeForExtension);
INIT(GetNSURLResponseLastModifiedDate);
INIT(GetPreferredExtensionForMIMEType);
@@ -75,6 +76,7 @@ void InitWebCoreSystemInterface(void)
INIT(SetCONNECTProxyForStream);
INIT(SetCookieStoragePrivateBrowsingEnabled);
INIT(SetDragImage);
+ INIT(SetHTTPPipeliningPriority);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
INIT(SetPatternBaseCTM);
@@ -120,12 +122,50 @@ void InitWebCoreSystemInterface(void)
INIT(CreateCTLineWithUniCharProvider);
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
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);
#endif
+ INIT(GetAXTextMarkerTypeID);
+ INIT(GetAXTextMarkerRangeTypeID);
+ INIT(CreateAXTextMarker);
+ INIT(GetBytesFromAXTextMarker);
+ INIT(CreateAXTextMarkerRange);
+ INIT(CopyAXTextMarkerRangeStart);
+ INIT(CopyAXTextMarkerRangeEnd);
+ INIT(AccessibilityHandleFocusChanged);
+ INIT(CreateAXUIElementRef);
+ INIT(UnregisterUniqueIdForElement);
+
didInit = true;
}