summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebCoreSupport
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebKit/mac/WebCoreSupport
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebKit/mac/WebCoreSupport')
-rw-r--r--WebKit/mac/WebCoreSupport/WebApplicationCache.h32
-rw-r--r--WebKit/mac/WebCoreSupport/WebApplicationCache.mm40
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.h16
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm88
-rw-r--r--WebKit/mac/WebCoreSupport/WebContextMenuClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebContextMenuClient.mm41
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.h22
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm186
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h5
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm149
-rw-r--r--WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm4
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.h2
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.mm54
-rw-r--r--WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm10
-rw-r--r--WebKit/mac/WebCoreSupport/WebSystemInterface.m6
-rw-r--r--WebKit/mac/WebCoreSupport/WebViewFactory.mm87
16 files changed, 588 insertions, 155 deletions
diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.h b/WebKit/mac/WebCoreSupport/WebApplicationCache.h
new file mode 100644
index 0000000..282157f
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2009 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. ``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
+ * 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface WebApplicationCache: NSObject {
+}
+
++ (void)setMaximumSize:(unsigned long long)size;
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm
new file mode 100644
index 0000000..8eb623d
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009 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. ``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
+ * 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.
+ */
+
+#import "WebApplicationCache.h"
+#import <WebCore/ApplicationCacheStorage.h>
+
+using namespace WebCore;
+
+@implementation WebApplicationCache
+
++ (void)setMaximumSize:(unsigned long long)size
+{
+ cacheStorage().empty();
+ cacheStorage().vacuumDatabaseFile();
+ cacheStorage().setMaximumSize(size);
+}
+
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 6974cb1..7a1d7b3 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -73,7 +73,7 @@ public:
virtual void setResizable(bool);
- virtual void addMessageToConsole(const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL);
+ virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL);
virtual bool canRunBeforeUnloadConfirmPanel();
virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
@@ -101,7 +101,7 @@ public:
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
- virtual void setToolTip(const WebCore::String&);
+ virtual void setToolTip(const WebCore::String&, WebCore::TextDirection);
virtual void print(WebCore::Frame*);
#if ENABLE(DATABASE)
@@ -118,6 +118,8 @@ public:
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
+ virtual bool setCursor(WebCore::PlatformCursorHandle) { return false; }
+
virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type,
const WebCore::FloatRect& lineRect);
virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type,
@@ -134,13 +136,17 @@ public:
virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename);
virtual WebCore::String generateReplacementFile(const WebCore::String& path);
- virtual void enableSuddenTermination();
- virtual void disableSuddenTermination();
- virtual void formStateDidChange(const WebCore::Node*) { }
+ virtual void formStateDidChange(const WebCore::Node*);
+
+ 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();
+ virtual void scheduleCompositingLayerSync();
#endif
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 2ca86d1..145255e 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -29,23 +29,26 @@
#import "WebChromeClient.h"
-#import <Foundation/Foundation.h>
+#import "DOMNodeInternal.h"
#import "WebDefaultUIDelegate.h"
+#import "WebDelegateImplementationCaching.h"
#import "WebElementDictionary.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebGeolocationInternal.h"
#import "WebHTMLViewInternal.h"
#import "WebHistoryInternal.h"
-#import "WebKitSystemInterface.h"
#import "WebKitPrefix.h"
+#import "WebKitSystemInterface.h"
#import "WebNSURLRequestExtras.h"
#import "WebPlugin.h"
#import "WebSecurityOriginInternal.h"
#import "WebUIDelegatePrivate.h"
#import "WebView.h"
#import "WebViewInternal.h"
+#import <Foundation/Foundation.h>
#import <WebCore/BlockExceptions.h>
+#import <WebCore/Console.h>
#import <WebCore/FileChooser.h>
#import <WebCore/FloatRect.h>
#import <WebCore/Frame.h>
@@ -67,6 +70,10 @@
#import <WebCore/GraphicsLayer.h>
#endif
+#if USE(PLUGIN_HOST_PROCESS)
+#import "NetscapePluginHostManager.h"
+#endif
+
@interface NSView (WebNSViewDetails)
- (NSView *)_findLastViewInKeyViewLoop;
@end
@@ -223,6 +230,11 @@ Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& reques
} else {
newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), URLRequest);
}
+
+#if USE(PLUGIN_HOST_PROCESS)
+ if (newWebView)
+ WebKit::NetscapePluginHostManager::shared().didCreateWindow();
+#endif
return core(newWebView);
}
@@ -289,7 +301,7 @@ void WebChromeClient::setResizable(bool b)
[[m_webView _UIDelegateForwarder] webView:m_webView setResizable:b];
}
-void WebChromeClient::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceURL)
+void WebChromeClient::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned int lineNumber, const String& sourceURL)
{
id delegate = [m_webView UIDelegate];
SEL selector = @selector(webView:addMessageToConsole:);
@@ -466,16 +478,20 @@ void WebChromeClient::scrollRectIntoView(const IntRect& r, const ScrollView* scr
// FIXME: This scrolling behavior should be under the control of the embedding client (rather than something
// we just do ourselves).
- // We have to convert back to document view coordinates in order to let the flipping conversion take place. It just
- // doesn't make sense for the scrollRectIntoView API to take document view coordinates.
IntRect scrollRect = r;
- scrollRect.move(scrollView->scrollOffset());
+ NSView *startView = m_webView;
+ if ([m_webView _usesDocumentViews]) {
+ // We have to convert back to document view coordinates.
+ // It doesn't make sense for the scrollRectIntoView API to take document view coordinates.
+ scrollRect.move(scrollView->scrollOffset());
+ startView = [[[m_webView mainFrame] frameView] documentView];
+ }
NSRect rect = scrollRect;
- for (NSView *view = [[[m_webView mainFrame] frameView] documentView]; view; view = [view superview]) {
+ for (NSView *view = startView; view; view = [view superview]) {
if ([view isKindOfClass:[NSClipView class]]) {
NSClipView *clipView = (NSClipView *)view;
NSView *documentView = [clipView documentView];
- [documentView scrollRectToVisible:[documentView convertRect:rect fromView:[[[m_webView mainFrame] frameView] documentView]]];
+ [documentView scrollRectToVisible:[documentView convertRect:rect fromView:startView]];
}
}
}
@@ -489,15 +505,18 @@ void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsig
[element release];
}
-void WebChromeClient::setToolTip(const String& toolTip)
+void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
{
- [(WebHTMLView *)[[[m_webView mainFrame] frameView] documentView] _setToolTip:toolTip];
+ [m_webView _setToolTip:toolTip];
}
void WebChromeClient::print(Frame* frame)
{
- WebFrameView* frameView = [kit(frame) frameView];
- CallUIDelegate(m_webView, @selector(webView:printFrameView:), frameView);
+ WebFrame *webFrame = kit(frame);
+ if ([[m_webView UIDelegate] respondsToSelector:@selector(webView:printFrame:)])
+ CallUIDelegate(m_webView, @selector(webView:printFrame:), webFrame);
+ else if ([m_webView _usesDocumentViews])
+ CallUIDelegate(m_webView, @selector(webView:printFrameView:), [webFrame frameView]);
}
#if ENABLE(DATABASE)
@@ -644,35 +663,56 @@ String WebChromeClient::generateReplacementFile(const String& path)
return [[m_webView _UIDelegateForwarder] webView:m_webView generateReplacementFile:path];
}
-void WebChromeClient::disableSuddenTermination()
+void WebChromeClient::formStateDidChange(const WebCore::Node* node)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- [[NSProcessInfo processInfo] disableSuddenTermination];
-#endif
+ CallUIDelegate(m_webView, @selector(webView:formStateDidChangeForNode:), kit(const_cast<WebCore::Node*>(node)));
}
-void WebChromeClient::enableSuddenTermination()
+void WebChromeClient::formDidFocus(const WebCore::Node* node)
{
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- [[NSProcessInfo processInfo] enableSuddenTermination];
-#endif
+ CallUIDelegate(m_webView, @selector(webView:formStateDidFocusNode:), kit(const_cast<WebCore::Node*>(node)));
+}
+
+void WebChromeClient::formDidBlur(const WebCore::Node* node)
+{
+ CallUIDelegate(m_webView, @selector(webView:formStateDidBlurNode:), kit(const_cast<WebCore::Node*>(node)));
}
#if USE(ACCELERATED_COMPOSITING)
+
void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
{
- WebFrameView *frameView = [kit(frame) frameView];
- WebHTMLView *docView = (WebHTMLView *)[frameView documentView];
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSView *documentView = [[kit(frame) frameView] documentView];
+ if (![documentView isKindOfClass:[WebHTMLView class]]) {
+ // We should never be attaching when we don't have a WebHTMLView.
+ ASSERT(!graphicsLayer);
+ return;
+ }
+
+ WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
if (graphicsLayer)
- [docView attachRootLayer:graphicsLayer->nativeLayer()];
+ [webHTMLView attachRootLayer:graphicsLayer->nativeLayer()];
else
- [docView detachRootLayer];
+ [webHTMLView detachRootLayer];
+ END_BLOCK_OBJC_EXCEPTIONS;
}
void WebChromeClient::setNeedsOneShotDrawingSynchronization()
{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
[m_webView _setNeedsOneShotDrawingSynchronization:YES];
+ END_BLOCK_OBJC_EXCEPTIONS;
}
+
+void WebChromeClient::scheduleCompositingLayerSync()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ [m_webView _scheduleCompositingLayerSync];
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
#endif
void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h
index 7ab68a2..c3ff4dd 100644
--- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h
+++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h
@@ -42,6 +42,7 @@ public:
virtual void downloadURL(const WebCore::KURL&);
virtual void searchWithGoogle(const WebCore::Frame*);
virtual void lookUpInDictionary(WebCore::Frame*);
+ virtual bool isSpeaking();
virtual void speak(const WebCore::String&);
virtual void stopSpeaking();
virtual void searchWithSpotlight();
diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
index 6b5ad14..639f3c1 100644
--- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
@@ -28,6 +28,7 @@
#import "WebContextMenuClient.h"
+#import "WebDelegateImplementationCaching.h"
#import "WebElementDictionary.h"
#import "WebFrame.h"
#import "WebFrameInternal.h"
@@ -42,6 +43,7 @@
#import "WebViewInternal.h"
#import <WebCore/ContextMenu.h>
#import <WebCore/KURL.h>
+#import <WebCore/RuntimeApplicationChecks.h>
#import <WebKit/DOMPrivate.h>
using namespace WebCore;
@@ -60,11 +62,6 @@ void WebContextMenuClient::contextMenuDestroyed()
delete this;
}
-static BOOL isAppleMail(void)
-{
- return [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mail"];
-}
-
static BOOL isPreVersion3Client(void)
{
static BOOL preVersion3Client = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS);
@@ -102,7 +99,7 @@ static NSMutableArray *fixMenusToSendToOldClients(NSMutableArray *defaultMenuIte
if (!preVersion3Client)
return savedItems;
- BOOL isMail = isAppleMail();
+ BOOL isMail = applicationIsAppleMail();
for (unsigned i = 0; i < defaultItemsCount; ++i) {
NSMenuItem *item = [defaultMenuItems objectAtIndex:i];
int tag = [item tag];
@@ -216,6 +213,31 @@ static void fixMenusReceivedFromOldClients(NSMutableArray *newMenuItems, NSMutab
modernTag = WebMenuItemTagLeftToRight;
else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft]])
modernTag = WebMenuItemTagRightToLeft;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically]])
+ modernTag = WebMenuItemTagCorrectSpellingAutomatically;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu]])
+ modernTag = WebMenuItemTagSubstitutionsMenu;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:true]]
+ || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:false]])
+ modernTag = WebMenuItemTagShowSubstitutions;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste]])
+ modernTag = WebMenuItemTagSmartCopyPaste;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartQuotes]])
+ modernTag = WebMenuItemTagSmartQuotes;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartDashes]])
+ modernTag = WebMenuItemTagSmartDashes;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartLinks]])
+ modernTag = WebMenuItemTagSmartLinks;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTextReplacement]])
+ modernTag = WebMenuItemTagTextReplacement;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTransformationsMenu]])
+ modernTag = WebMenuItemTagTransformationsMenu;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeUpperCase]])
+ modernTag = WebMenuItemTagMakeUpperCase;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeLowerCase]])
+ modernTag = WebMenuItemTagMakeLowerCase;
+ else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCapitalize]])
+ modernTag = WebMenuItemTagCapitalize;
else {
// We don't expect WebMenuItemTagOther for any items other than the ones we explicitly handle.
// There's nothing to prevent an app from applying this tag, but they are supposed to only
@@ -316,6 +338,11 @@ void WebContextMenuClient::lookUpInDictionary(Frame* frame)
[htmlView _lookUpInDictionaryFromMenu:nil];
}
+bool WebContextMenuClient::isSpeaking()
+{
+ return [NSApp isSpeaking];
+}
+
void WebContextMenuClient::speak(const String& string)
{
[NSApp speakString:[[(NSString*)string copy] autorelease]];
@@ -323,5 +350,5 @@ void WebContextMenuClient::speak(const String& string)
void WebContextMenuClient::stopSpeaking()
{
- [NSApp stopSpeaking];
+ [NSApp stopSpeaking:nil];
}
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index fd4b46f..d7dfdd7 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -74,6 +74,25 @@ public:
virtual NSArray* pasteboardTypesForSelection(WebCore::Frame*);
#endif
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ virtual void uppercaseWord();
+ virtual void lowercaseWord();
+ virtual void capitalizeWord();
+ virtual void showSubstitutionsPanel(bool show);
+ virtual bool substitutionsPanelIsShowing();
+ virtual void toggleSmartInsertDelete();
+ virtual bool isAutomaticQuoteSubstitutionEnabled();
+ virtual void toggleAutomaticQuoteSubstitution();
+ virtual bool isAutomaticLinkDetectionEnabled();
+ virtual void toggleAutomaticLinkDetection();
+ virtual bool isAutomaticDashSubstitutionEnabled();
+ virtual void toggleAutomaticDashSubstitution();
+ virtual bool isAutomaticTextReplacementEnabled();
+ virtual void toggleAutomaticTextReplacement();
+ virtual bool isAutomaticSpellingCorrectionEnabled();
+ virtual void toggleAutomaticSpellingCorrection();
+#endif
+
virtual void respondToChangedContents();
virtual void respondToChangedSelection();
@@ -100,8 +119,9 @@ public:
virtual void ignoreWordInSpellDocument(const WebCore::String&);
virtual void learnWord(const WebCore::String&);
virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
+ virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&);
virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
- virtual void checkSpellingAndGrammarOfParagraph(const UChar* text, int length, bool checkGrammar, WTF::Vector<WebCore::TextCheckingResult>& results);
+ virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results);
virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&);
virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&);
virtual void showSpellingUI(bool show);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index 9911a32..e8c37d5 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -29,11 +29,15 @@
#import "WebEditorClient.h"
+#import "DOMCSSStyleDeclarationInternal.h"
+#import "DOMHTMLElementInternal.h"
#import "DOMHTMLInputElementInternal.h"
#import "DOMHTMLTextAreaElementInternal.h"
+#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
#import "WebArchive.h"
#import "WebDataSourceInternal.h"
+#import "WebDelegateImplementationCaching.h"
#import "WebDocument.h"
#import "WebEditingDelegatePrivate.h"
#import "WebFormDelegate.h"
@@ -48,6 +52,9 @@
#import <WebCore/Document.h>
#import <WebCore/EditAction.h>
#import <WebCore/EditCommand.h>
+#import <WebCore/HTMLInputElement.h>
+#import <WebCore/HTMLNames.h>
+#import <WebCore/HTMLTextAreaElement.h>
#import <WebCore/KeyboardEvent.h>
#import <WebCore/LegacyWebArchive.h>
#import <WebCore/PlatformKeyboardEvent.h>
@@ -59,15 +66,9 @@
using namespace WebCore;
using namespace WTF;
-EditorInsertAction core(WebViewInsertAction);
-WebViewInsertAction kit(EditorInsertAction);
+using namespace HTMLNames;
-EditorInsertAction core(WebViewInsertAction kitAction)
-{
- return static_cast<EditorInsertAction>(kitAction);
-}
-
-WebViewInsertAction kit(EditorInsertAction coreAction)
+static WebViewInsertAction kit(EditorInsertAction coreAction)
{
return static_cast<WebViewInsertAction>(coreAction);
}
@@ -280,9 +281,7 @@ void WebEditorClient::respondToChangedContents()
void WebEditorClient::respondToChangedSelection()
{
- NSView <WebDocumentView> *view = [[[m_webView selectedFrame] frameView] documentView];
- if ([view isKindOfClass:[WebHTMLView class]])
- [(WebHTMLView *)view _selectionChanged];
+ [m_webView _selectionChanged];
// FIXME: This quirk is needed due to <rdar://problem/5009625> - We can phase it out once Aperture can adopt the new behavior on their end
if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Aperture"])
@@ -319,6 +318,92 @@ NSArray* WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
}
#endif
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+void WebEditorClient::uppercaseWord()
+{
+ [m_webView uppercaseWord:nil];
+}
+
+void WebEditorClient::lowercaseWord()
+{
+ [m_webView lowercaseWord:nil];
+}
+
+void WebEditorClient::capitalizeWord()
+{
+ [m_webView capitalizeWord:nil];
+}
+
+void WebEditorClient::showSubstitutionsPanel(bool show)
+{
+ NSPanel *spellingPanel = [[NSSpellChecker sharedSpellChecker] substitutionsPanel];
+ if (show)
+ [spellingPanel orderFront:nil];
+ else
+ [spellingPanel orderOut:nil];
+}
+
+bool WebEditorClient::substitutionsPanelIsShowing()
+{
+ return [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible];
+}
+
+void WebEditorClient::toggleSmartInsertDelete()
+{
+ [m_webView toggleSmartInsertDelete:nil];
+}
+
+bool WebEditorClient::isAutomaticQuoteSubstitutionEnabled()
+{
+ return [m_webView isAutomaticQuoteSubstitutionEnabled];
+}
+
+void WebEditorClient::toggleAutomaticQuoteSubstitution()
+{
+ [m_webView toggleAutomaticQuoteSubstitution:nil];
+}
+
+bool WebEditorClient::isAutomaticLinkDetectionEnabled()
+{
+ return [m_webView isAutomaticLinkDetectionEnabled];
+}
+
+void WebEditorClient::toggleAutomaticLinkDetection()
+{
+ [m_webView toggleAutomaticLinkDetection:nil];
+}
+
+bool WebEditorClient::isAutomaticDashSubstitutionEnabled()
+{
+ return [m_webView isAutomaticDashSubstitutionEnabled];
+}
+
+void WebEditorClient::toggleAutomaticDashSubstitution()
+{
+ [m_webView toggleAutomaticDashSubstitution:nil];
+}
+
+bool WebEditorClient::isAutomaticTextReplacementEnabled()
+{
+ return [m_webView isAutomaticTextReplacementEnabled];
+}
+
+void WebEditorClient::toggleAutomaticTextReplacement()
+{
+ [m_webView toggleAutomaticTextReplacement:nil];
+}
+
+bool WebEditorClient::isAutomaticSpellingCorrectionEnabled()
+{
+ return [m_webView isAutomaticSpellingCorrectionEnabled];
+}
+
+void WebEditorClient::toggleAutomaticSpellingCorrection()
+{
+ [m_webView toggleAutomaticSpellingCorrection:nil];
+}
+#endif
+
bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, EditorInsertAction givenAction)
{
return [[m_webView _editingDelegateForwarder] webView:m_webView shouldInsertNode:kit(node) replacingDOMRange:kit(replacingRange) givenAction:(WebViewInsertAction)givenAction];
@@ -453,30 +538,30 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event)
void WebEditorClient::textFieldDidBeginEditing(Element* element)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(inputTag))
return;
- DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element];
+ DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
CallFormDelegate(m_webView, @selector(textFieldDidBeginEditing:inFrame:), inputElement, kit(element->document()->frame()));
}
void WebEditorClient::textFieldDidEndEditing(Element* element)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(inputTag))
return;
- DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element];
+ DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame()));
}
void WebEditorClient::textDidChangeInTextField(Element* element)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(inputTag))
return;
- DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element];
+ DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame()));
}
@@ -506,10 +591,10 @@ static SEL selectorForKeyEvent(KeyboardEvent* event)
bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(inputTag))
return NO;
- DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element];
+ DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
if (SEL commandSelector = selectorForKeyEvent(event))
return CallFormDelegateReturningBoolean(NO, m_webView, @selector(textField:doCommandBySelector:inFrame:), inputElement, commandSelector, kit(element->document()->frame()));
@@ -518,10 +603,10 @@ bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEven
void WebEditorClient::textWillBeDeletedInTextField(Element* element)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(inputTag))
return;
- DOMHTMLInputElement* inputElement = [DOMHTMLInputElement _wrapHTMLInputElement:(HTMLInputElement*)element];
+ DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element));
FormDelegateLog(inputElement);
// We're using the deleteBackward selector for all deletion operations since the autofill code treats all deletions the same way.
CallFormDelegateReturningBoolean(NO, m_webView, @selector(textField:doCommandBySelector:inFrame:), inputElement, @selector(deleteBackward:), kit(element->document()->frame()));
@@ -529,10 +614,10 @@ void WebEditorClient::textWillBeDeletedInTextField(Element* element)
void WebEditorClient::textDidChangeInTextArea(Element* element)
{
- if (!element->isHTMLElement())
+ if (!element->hasTagName(textareaTag))
return;
- DOMHTMLTextAreaElement* textAreaElement = [DOMHTMLTextAreaElement _wrapHTMLTextAreaElement:(HTMLTextAreaElement*)element];
+ DOMHTMLTextAreaElement* textAreaElement = kit(static_cast<HTMLTextAreaElement*>(element));
FormDelegateLog(textAreaElement);
CallFormDelegate(m_webView, @selector(textDidChangeInTextArea:inFrame:), textAreaElement, kit(element->document()->frame()));
}
@@ -565,6 +650,13 @@ void WebEditorClient::checkSpellingOfString(const UChar* text, int length, int*
*misspellingLength = range.length;
}
+String WebEditorClient::getAutoCorrectSuggestionForMisspelledWord(const String& inputWord)
+{
+ // This method can be implemented using customized algorithms for the particular browser.
+ // Currently, it computes an empty string.
+ return String();
+}
+
void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector<GrammarDetail>& details, int* badGrammarLocation, int* badGrammarLength)
{
#ifndef BUILDING_ON_TIGER
@@ -595,27 +687,26 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
#endif
}
-void WebEditorClient::checkSpellingAndGrammarOfParagraph(const UChar* text, int length, bool checkGrammar, Vector<TextCheckingResult>& results)
+void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
{
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
- NSTextCheckingTypes checkingTypes = checkGrammar ? (NSTextCheckingTypeOrthography | NSTextCheckingTypeSpelling | NSTextCheckingTypeGrammar) : (NSTextCheckingTypeOrthography | NSTextCheckingTypeSpelling);
- NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:checkingTypes options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
+ NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
[textString release];
for (NSTextCheckingResult *incomingResult in incomingResults) {
NSRange resultRange = [incomingResult range];
NSTextCheckingType resultType = [incomingResult resultType];
ASSERT(resultRange.location != NSNotFound && resultRange.length > 0);
- if (NSTextCheckingTypeSpelling == resultType) {
+ if (NSTextCheckingTypeSpelling == resultType && 0 != (checkingTypes & NSTextCheckingTypeSpelling)) {
TextCheckingResult result;
- result.resultType = 1;
+ result.type = TextCheckingTypeSpelling;
result.location = resultRange.location;
result.length = resultRange.length;
results.append(result);
- } else if (checkGrammar && NSTextCheckingTypeGrammar == resultType) {
+ } else if (NSTextCheckingTypeGrammar == resultType && 0 != (checkingTypes & NSTextCheckingTypeGrammar)) {
TextCheckingResult result;
NSArray *details = [incomingResult grammarDetails];
- result.resultType = 2;
+ result.type = TextCheckingTypeGrammar;
result.location = resultRange.location;
result.length = resultRange.length;
for (NSDictionary *incomingDetail in details) {
@@ -634,6 +725,41 @@ void WebEditorClient::checkSpellingAndGrammarOfParagraph(const UChar* text, int
result.details.append(detail);
}
results.append(result);
+ } else if (NSTextCheckingTypeLink == resultType && 0 != (checkingTypes & NSTextCheckingTypeLink)) {
+ TextCheckingResult result;
+ result.type = TextCheckingTypeLink;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ result.replacement = [[incomingResult URL] absoluteString];
+ results.append(result);
+ } else if (NSTextCheckingTypeQuote == resultType && 0 != (checkingTypes & NSTextCheckingTypeQuote)) {
+ TextCheckingResult result;
+ result.type = TextCheckingTypeQuote;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ result.replacement = [incomingResult replacementString];
+ results.append(result);
+ } else if (NSTextCheckingTypeDash == resultType && 0 != (checkingTypes & NSTextCheckingTypeDash)) {
+ TextCheckingResult result;
+ result.type = TextCheckingTypeDash;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ result.replacement = [incomingResult replacementString];
+ results.append(result);
+ } else if (NSTextCheckingTypeReplacement == resultType && 0 != (checkingTypes & NSTextCheckingTypeReplacement)) {
+ TextCheckingResult result;
+ result.type = TextCheckingTypeReplacement;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ result.replacement = [incomingResult replacementString];
+ results.append(result);
+ } else if (NSTextCheckingTypeCorrection == resultType && 0 != (checkingTypes & NSTextCheckingTypeCorrection)) {
+ TextCheckingResult result;
+ result.type = TextCheckingTypeCorrection;
+ result.location = resultRange.location;
+ result.length = resultRange.length;
+ result.replacement = [incomingResult replacementString];
+ results.append(result);
}
}
#endif
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 823e0a4..6f0f39f 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -122,6 +122,7 @@ private:
virtual void revertToProvisionalState(WebCore::DocumentLoader*);
virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
+ virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&);
virtual void willChangeEstimatedProgress();
virtual void didChangeEstimatedProgress();
@@ -177,11 +178,11 @@ private:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*,
const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&,
+ virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&,
const Vector<WebCore::String>&, const WebCore::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
- virtual WebCore::Widget* createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL,
+ virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL,
const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues);
virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType);
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index 95ac174..42b7ff8 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -38,6 +38,7 @@
#import "WebCachedFramePlatformData.h"
#import "WebChromeClient.h"
#import "WebDataSourceInternal.h"
+#import "WebDelegateImplementationCaching.h"
#import "WebDocumentInternal.h"
#import "WebDocumentLoaderMac.h"
#import "WebDownloadInternal.h"
@@ -78,6 +79,7 @@
#import <WebCore/Document.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/EventHandler.h>
+#import <WebCore/FocusController.h>
#import <WebCore/FormState.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
@@ -104,6 +106,7 @@
#import <WebCore/ResourceLoader.h>
#import <WebCore/ResourceRequest.h>
#import <WebCore/ScriptController.h>
+#import <WebCore/ScriptString.h>
#import <WebCore/SharedBuffer.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/Widget.h>
@@ -117,6 +120,7 @@
#endif
#if USE(PLUGIN_HOST_PROCESS)
+#import "NetscapePluginHostManager.h"
#import "WebHostedNetscapePluginView.h"
#endif
@@ -216,6 +220,11 @@ void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
bool WebFrameLoaderClient::hasHTMLView() const
{
+ if (![getWebView(m_webFrame.get()) _usesDocumentViews]) {
+ // FIXME (Viewless): For now we just assume that all frames have an HTML view
+ return true;
+ }
+
NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView];
return [view isKindOfClass:[WebHTMLView class]];
}
@@ -335,6 +344,10 @@ bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader
return true;
}
+void WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
+{
+}
+
void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
{
WebView *webView = getWebView(m_webFrame.get());
@@ -531,9 +544,11 @@ void WebFrameLoaderClient::dispatchWillClose()
void WebFrameLoaderClient::dispatchDidReceiveIcon()
{
+#if ENABLE(ICONDATABASE)
WebView *webView = getWebView(m_webFrame.get());
ASSERT(m_webFrame == [webView mainFrame]);
[webView _dispatchDidReceiveIconFromWebFrame:m_webFrame.get()];
+#endif
}
void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
@@ -635,6 +650,12 @@ Frame* WebFrameLoaderClient::dispatchCreatePage()
createWebViewWithRequest:nil
windowFeatures:features];
[features release];
+
+#if USE(PLUGIN_HOST_PROCESS)
+ if (newWebView)
+ WebKit::NetscapePluginHostManager::shared().didCreateWindow();
+#endif
+
return core([newWebView mainFrame]);
}
@@ -699,10 +720,11 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function,
return;
}
- NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:formState->values().size()];
- HashMap<String, String>::const_iterator end = formState->values().end();
- for (HashMap<String, String>::const_iterator it = formState->values().begin(); it != end; ++it)
- [dictionary setObject:it->second forKey:it->first];
+ const StringPairVector& textFieldValues = formState->textFieldValues();
+ size_t size = textFieldValues.size();
+ NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:size];
+ for (size_t i = 0; i < size; ++i)
+ [dictionary setObject:textFieldValues[i].second forKey:textFieldValues[i].first];
CallFormDelegate(getWebView(m_webFrame.get()), @selector(frame:sourceFrame:willSubmitForm:withValues:submissionListener:), m_webFrame.get(), kit(formState->sourceFrame()), kit(formState->form()), dictionary, setUpPolicyListener(function).get());
@@ -791,14 +813,14 @@ void WebFrameLoaderClient::updateGlobalHistory()
[[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory()
withTitle:loader->title()
method:loader->originalRequestCopy().httpMethod()
- wasFailure:loader->urlForHistoryReflectsFailure()];
-
- updateGlobalHistoryRedirectLinks();
+ wasFailure:loader->urlForHistoryReflectsFailure()
+ increaseVisitCount:!loader->clientRedirectSourceForHistory()]; // Do not increase visit count due to navigations that were not initiated by the user directly, avoiding growth from programmatic reloads.
}
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader();
+ ASSERT(loader->unreachableURL().isEmpty());
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->clientRedirectSourceForHistory()])
@@ -1025,28 +1047,30 @@ void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cac
void WebFrameLoaderClient::transitionToCommittedForNewPage()
{
- WebFrameView *v = m_webFrame->_private->webFrameView;
- WebDataSource *ds = [m_webFrame.get() _dataSource];
+ WebView *webView = getWebView(m_webFrame.get());
+ WebDataSource *dataSource = [m_webFrame.get() _dataSource];
+ bool usesDocumentViews = [webView _usesDocumentViews];
+
+ if (usesDocumentViews) {
+ // FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too.
+ bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class];
+ bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
+ if (canSkipCreation) {
+ [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource];
+ return;
+ }
- bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[ds _responseMIMEType]] == [WebHTMLView class];
- bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
- if (canSkipCreation) {
- [[v documentView] setDataSource:ds];
- return;
+ // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
+ if (!willProduceHTMLView)
+ [[m_webFrame->_private->webFrameView _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
}
-
- // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
- if (!willProduceHTMLView)
- [[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
// clean up webkit plugin instances before WebHTMLView gets freed.
- WebView *webView = getWebView(m_webFrame.get());
[webView removePluginInstanceViewsFor:(m_webFrame.get())];
- BOOL useDocumentViews = [webView _usesDocumentViews];
NSView <WebDocumentView> *documentView = nil;
- if (useDocumentViews) {
- documentView = [v _makeDocumentViewForDataSource:ds];
+ if (usesDocumentViews) {
+ documentView = [m_webFrame->_private->webFrameView _makeDocumentViewForDataSource:dataSource];
if (!documentView)
return;
}
@@ -1060,28 +1084,41 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
if (isMainFrame && coreFrame->view())
coreFrame->view()->setParentVisible(false);
coreFrame->setView(0);
- FrameView* coreView;
- if (useDocumentViews)
- coreView = new FrameView(coreFrame);
+ RefPtr<FrameView> coreView;
+ if (usesDocumentViews)
+ coreView = FrameView::create(coreFrame);
else
- coreView = new FrameView(coreFrame, IntSize([webView bounds].size));
+ coreView = FrameView::create(coreFrame, IntSize([webView bounds].size));
coreFrame->setView(coreView);
- coreView->deref(); // FIXME: Eliminate this crazy refcounting!
[m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
- [v _install];
+ if (usesDocumentViews)
+ [m_webFrame->_private->webFrameView _install];
if (isMainFrame)
coreView->setParentVisible(true);
- // Call setDataSource on the document view after it has been placed in the view hierarchy.
- // This what we for the top-level view, so should do this for views in subframes as well.
- [documentView setDataSource:ds];
-
+ if (usesDocumentViews) {
+ // Call setDataSource on the document view after it has been placed in the view hierarchy.
+ // This what we for the top-level view, so should do this for views in subframes as well.
+ [documentView setDataSource:dataSource];
+
+ // The following is a no-op for WebHTMLRepresentation, but for custom document types
+ // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader
+ // will get the proper title.
+ if (DocumentLoader* documentLoader = [dataSource _documentLoader])
+ documentLoader->setTitle([dataSource pageTitle]);
+ }
+
if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
-
+
+ // If the document view implicitly became first responder, make sure to set the focused frame properly.
+ if (usesDocumentViews && [[documentView window] firstResponder] == documentView) {
+ page->focusController()->setFocusedFrame(coreFrame);
+ page->focusController()->setFocused(true);
+ }
}
RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
@@ -1158,9 +1195,8 @@ NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& act
nil];
if (const MouseEvent* mouseEvent = findMouseEvent(event)) {
- IntPoint point(mouseEvent->pageX(), mouseEvent->pageY());
WebElementDictionary *element = [[WebElementDictionary alloc]
- initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(point, false)];
+ initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false)];
[result setObject:element forKey:WebActionElementKey];
[element release];
@@ -1375,16 +1411,13 @@ public:
#endif // ENABLE(NETSCAPE_PLUGIN_API)
-static Class netscapePluginViewClass()
-{
#if USE(PLUGIN_HOST_PROCESS)
- return [WebHostedNetscapePluginView class];
+#define NETSCAPE_PLUGIN_VIEW WebHostedNetscapePluginView
#else
- return [WebNetscapePluginView class];
+#define NETSCAPE_PLUGIN_VIEW WebNetscapePluginView
#endif
-}
-Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const KURL& url,
+PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const KURL& url,
const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -1413,7 +1446,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
[arguments release];
if (view)
- return new PluginWidget(view);
+ return adoptRef(new PluginWidget(view));
}
NSString *MIMEType;
@@ -1452,7 +1485,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
#if ENABLE(NETSCAPE_PLUGIN_API)
else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
- WebBaseNetscapePluginView *pluginView = [[[netscapePluginViewClass() alloc]
+ WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
pluginPackage:(WebNetscapePluginPackage *)pluginPackage
URL:URL
@@ -1463,7 +1496,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
loadManually:loadManually
element:element] autorelease];
- return new NetscapePluginWidget(pluginView);
+ return adoptRef(new NetscapePluginWidget(pluginView));
}
#endif
} else
@@ -1473,11 +1506,11 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
errorCode = WebKitErrorCannotLoadPlugIn;
if (errorCode) {
+ KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage")));
+ if (!pluginPageURL.protocolInHTTPFamily())
+ pluginPageURL = KURL();
NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
- contentURL:URL
- pluginPageURL:document->completeURL(parseURL(parameterValue(paramNames, paramValues, "pluginspage")))
- pluginName:[pluginPackage name]
- MIMEType:MIMEType];
+ contentURL:URL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType];
WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
error:error DOMElement:kit(element)] autorelease];
view = nullView;
@@ -1485,7 +1518,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElemen
}
ASSERT(view);
- return new PluginWidget(view);
+ return adoptRef(new PluginWidget(view));
END_BLOCK_OBJC_EXCEPTIONS;
@@ -1501,8 +1534,8 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
NSView *pluginView = pluginWidget->platformWidget();
#if ENABLE(NETSCAPE_PLUGIN_API)
- if ([pluginView isKindOfClass:[WebNetscapePluginView class]])
- [representation _redirectDataToManualLoader:(WebNetscapePluginView *)pluginView forPluginView:pluginView];
+ if ([pluginView isKindOfClass:[NETSCAPE_PLUGIN_VIEW class]])
+ [representation _redirectDataToManualLoader:(NETSCAPE_PLUGIN_VIEW *)pluginView forPluginView:pluginView];
else {
#else
{
@@ -1515,9 +1548,10 @@ void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
END_BLOCK_OBJC_EXCEPTIONS;
}
-Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const KURL& baseURL,
+PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const KURL& baseURL,
const Vector<String>& paramNames, const Vector<String>& paramValues)
{
+#if ENABLE(MAC_JAVA_BRIDGE)
BEGIN_BLOCK_OBJC_EXCEPTIONS;
NSView *view = nil;
@@ -1545,7 +1579,7 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAp
}
#if ENABLE(NETSCAPE_PLUGIN_API)
else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
- view = [[[netscapePluginViewClass() alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
+ view = [[[NETSCAPE_PLUGIN_VIEW alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
pluginPackage:(WebNetscapePluginPackage *)pluginPackage
URL:nil
baseURL:baseURL
@@ -1572,11 +1606,14 @@ Widget* WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAp
}
ASSERT(view);
- return new PluginWidget(view);
+ return adoptRef(new PluginWidget(view));
END_BLOCK_OBJC_EXCEPTIONS;
- return new PluginWidget;
+ return adoptRef(new PluginWidget);
+#else
+ return 0;
+#endif // ENABLE(MAC_JAVA_BRIDGE)
}
String WebFrameLoaderClient::overrideMediaType() const
@@ -1612,7 +1649,9 @@ void WebFrameLoaderClient::windowObjectCleared()
void WebFrameLoaderClient::registerForIconNotification(bool listen)
{
+#if ENABLE(ICONDATABASE)
[[m_webFrame.get() webView] _registerForIconNotification:listen];
+#endif
}
void WebFrameLoaderClient::didPerformFirstNavigation() const
diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm
index dc9ae6d..1b0c834 100644
--- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm
@@ -29,9 +29,9 @@
#import "WebIconDatabaseClient.h"
#import "WebIconDatabaseInternal.h"
-
#import <WebCore/PlatformString.h>
+#if ENABLE(ICONDATABASE)
bool WebIconDatabaseClient::performImport()
{
@@ -55,3 +55,5 @@ void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WebCore::String&
// instead of us doing it every iteration
[[WebIconDatabase sharedIconDatabase] _sendNotificationForURL:pageURL];
}
+
+#endif // ENABLE(ICONDATABASE)
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index 41a8fa5..7487728 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -66,6 +66,8 @@ public:
virtual void storeSetting(const WebCore::String& key, const WebCore::InspectorController::Setting&);
virtual void removeSetting(const WebCore::String& key);
+ virtual void inspectorWindowObjectCleared();
+
private:
void updateWindowTitle() const;
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index cc4cfdb..3f0b43d 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -28,6 +28,8 @@
#import "WebInspectorClient.h"
+#import "DOMNodeInternal.h"
+#import "WebDelegateImplementationCaching.h"
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebInspector.h"
@@ -35,16 +37,15 @@
#import "WebNodeHighlight.h"
#import "WebUIDelegate.h"
#import "WebViewInternal.h"
-
#import <WebCore/InspectorController.h>
#import <WebCore/Page.h>
-
#import <WebKit/DOMExtensions.h>
-
#import <WebKitSystemInterface.h>
using namespace WebCore;
+static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
+
@interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> {
@private
WebView *_inspectedWebView;
@@ -150,10 +151,17 @@ void WebInspectorClient::updateWindowTitle() const
[[m_windowController.get() window] setTitle:title];
}
-#pragma mark -
+void WebInspectorClient::inspectorWindowObjectCleared()
+{
+ WebFrame *frame = [m_webView mainFrame];
+
+ WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(m_webView);
+ if (implementations->didClearInspectorWindowObjectForFrameFunc)
+ CallFrameLoadDelegate(implementations->didClearInspectorWindowObjectForFrameFunc, m_webView,
+ @selector(webView:didClearInspectorWindowObject:forFrame:), [frame windowObject], frame);
+}
-#define WebKitInspectorAttachedKey @"WebKitInspectorAttached"
-#define WebKitInspectorAttachedViewHeightKey @"WebKitInspectorAttachedViewHeight"
+#pragma mark -
@implementation WebInspectorWindowController
- (id)init
@@ -177,6 +185,13 @@ void WebInspectorClient::updateWindowTitle() const
[preferences setTabsToLinks:NO];
[preferences setMinimumFontSize:0];
[preferences setMinimumLogicalFontSize:9];
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ [preferences setFixedFontFamily:@"Menlo"];
+ [preferences setDefaultFixedFontSize:11];
+#else
+ [preferences setFixedFontFamily:@"Monaco"];
+ [preferences setDefaultFixedFontSize:10];
+#endif
_webView = [[WebView alloc] init];
[_webView setPreferences:preferences];
@@ -186,10 +201,6 @@ void WebInspectorClient::updateWindowTitle() const
[preferences release];
- NSNumber *attached = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitInspectorAttachedKey];
- ASSERT(!attached || [attached isKindOfClass:[NSNumber class]]);
- _shouldAttach = attached ? [attached boolValue] : YES;
-
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"inspector" ofType:@"html" inDirectory:@"inspector"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL fileURLWithPath:path]];
[[_webView mainFrame] loadRequest:request];
@@ -313,6 +324,10 @@ void WebInspectorClient::updateWindowTitle() const
}
_visible = YES;
+
+ // If no preference is set - default to an attached window
+ InspectorController::Setting shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName);
+ _shouldAttach = (shouldAttach.type() == InspectorController::Setting::BooleanType) ? shouldAttach.booleanValue() : true;
if (_shouldAttach) {
WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
@@ -324,8 +339,6 @@ void WebInspectorClient::updateWindowTitle() const
[frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin)];
_attachedToInspectedWebView = YES;
-
- [self setAttachedWindowHeight:[[NSUserDefaults standardUserDefaults] integerForKey:WebKitInspectorAttachedViewHeightKey]];
} else {
_attachedToInspectedWebView = NO;
@@ -348,15 +361,13 @@ void WebInspectorClient::updateWindowTitle() const
if (_attachedToInspectedWebView)
return;
- _shouldAttach = YES;
+ [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(true));
_movingWindows = YES;
[self close];
[self showWindow:nil];
_movingWindows = NO;
-
- [[NSUserDefaults standardUserDefaults] setBool:YES forKey:WebKitInspectorAttachedKey];
}
- (void)detach
@@ -364,7 +375,7 @@ void WebInspectorClient::updateWindowTitle() const
if (!_attachedToInspectedWebView)
return;
- _shouldAttach = NO;
+ [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(false));
_movingWindows = YES;
[self close];
@@ -372,28 +383,23 @@ void WebInspectorClient::updateWindowTitle() const
_movingWindows = NO;
- [[NSUserDefaults standardUserDefaults] setBool:NO forKey:WebKitInspectorAttachedKey];
}
- (void)setAttachedWindowHeight:(unsigned)height
{
- [[NSUserDefaults standardUserDefaults] setInteger:height forKey:WebKitInspectorAttachedViewHeightKey];
-
if (!_attachedToInspectedWebView)
return;
WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
NSRect frameViewRect = [frameView frame];
- CGFloat attachedHeight = round(MAX(250.0, MIN(height, (NSHeight([_inspectedWebView frame]) * 0.75))));
-
// Setting the height based on the difference is done to work with
// Safari's find banner. This assumes the previous height is the Y origin.
- CGFloat heightDifference = (NSMinY(frameViewRect) - attachedHeight);
+ CGFloat heightDifference = (NSMinY(frameViewRect) - height);
frameViewRect.size.height += heightDifference;
- frameViewRect.origin.y = attachedHeight;
+ frameViewRect.origin.y = height;
- [_webView setFrame:NSMakeRect(0.0, 0.0, NSWidth(frameViewRect), attachedHeight)];
+ [_webView setFrame:NSMakeRect(0.0, 0.0, NSWidth(frameViewRect), height)];
[frameView setFrame:frameViewRect];
}
diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
index a8c49ff..eb6a58d 100644
--- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
+++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
@@ -23,15 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "WebPasteboardHelper.h"
+
#import "WebArchive.h"
#import "WebHTMLViewInternal.h"
#import "WebNSPasteboardExtras.h"
#import "WebNSURLExtras.h"
-#import "WebPasteboardHelper.h"
-
-#import <WebCore/DOMDocument.h>
-#import <WebCore/DOMDocumentFragment.h>
#import <WebCore/PlatformString.h>
+#import <WebKit/DOMDocument.h>
+#import <WebKit/DOMDocumentFragment.h>
#import <wtf/RetainPtr.h>
#import <wtf/StdLibExtras.h>
@@ -92,7 +92,7 @@ DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(const NSPastebo
NSArray *WebPasteboardHelper::insertablePasteboardTypes() const
{
- DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType,
+ DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType,
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
NSPICTPboardType,
#endif
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
index 52f5583..f957814 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
@@ -59,6 +59,8 @@ void InitWebCoreSystemInterface(void)
INIT(GetPreferredExtensionForMIMEType);
INIT(GetWheelEventDeltas);
INIT(HitTestMediaUIPart);
+ INIT(InitializeMaximumHTTPConnectionCountPerHost);
+ INIT(IsLatchingWheelEvent);
INIT(MeasureMediaUIPart);
INIT(PopupMenu);
INIT(SetCGFontRenderingMode);
@@ -71,8 +73,12 @@ void InitWebCoreSystemInterface(void)
INIT(SignalCFReadStreamEnd);
INIT(SignalCFReadStreamError);
INIT(SignalCFReadStreamHasBytes);
+ INIT(QTIncludeOnlyModernMediaFileTypes);
INIT(QTMovieDataRate);
INIT(QTMovieMaxTimeLoaded);
+ INIT(QTMovieMaxTimeLoadedChangeNotification);
+ INIT(QTMovieMaxTimeSeekable);
+ INIT(QTMovieGetType);
INIT(QTMovieViewSetDrawSynchronously);
#ifndef BUILDING_ON_TIGER
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index ea82acc..96ebaa4 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -321,7 +321,7 @@
- (NSString *)contextMenuItemTagShowColors
{
- return UI_STRING("Show colors", "Show colors context menu item");
+ return UI_STRING("Show Colors", "Show colors context menu item");
}
- (NSString *)contextMenuItemTagSpeechMenu
@@ -368,6 +368,81 @@
return UI_STRING("Right to Left", "Right to Left context menu item");
}
+- (NSString *)contextMenuItemTagCorrectSpellingAutomatically
+{
+ return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
+}
+
+- (NSString *)contextMenuItemTagSubstitutionsMenu
+{
+ return UI_STRING("Substitutions", "Substitutions context sub-menu item");
+}
+
+- (NSString *)contextMenuItemTagShowSubstitutions:(bool)show
+{
+ if (show)
+ return UI_STRING("Show Substitutions", "menu item title");
+ return UI_STRING("Hide Substitutions", "menu item title");
+}
+
+- (NSString *)contextMenuItemTagSmartCopyPaste
+{
+ return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
+}
+
+- (NSString *)contextMenuItemTagSmartQuotes
+{
+ return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
+}
+
+- (NSString *)contextMenuItemTagSmartDashes
+{
+ return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
+}
+
+- (NSString *)contextMenuItemTagSmartLinks
+{
+ return UI_STRING("Smart Links", "Smart Links context menu item");
+}
+
+- (NSString *)contextMenuItemTagTextReplacement
+{
+ return UI_STRING("Text Replacement", "Text Replacement context menu item");
+}
+
+- (NSString *)contextMenuItemTagTransformationsMenu
+{
+ return UI_STRING("Transformations", "Transformations context sub-menu item");
+}
+
+- (NSString *)contextMenuItemTagMakeUpperCase
+{
+ return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
+}
+
+- (NSString *)contextMenuItemTagMakeLowerCase
+{
+ return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
+}
+
+- (NSString *)contextMenuItemTagCapitalize
+{
+ return UI_STRING("Capitalize", "Capitalize context menu item");
+}
+
+- (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString
+{
+ static NSString *formatString = nil;
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ static bool lookedUpString = false;
+ if (!lookedUpString) {
+ formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain];
+ lookedUpString = true;
+ }
+#endif
+ return formatString ? [NSString stringWithFormat:formatString, replacedString] : replacedString;
+}
+
- (NSString *)contextMenuItemTagInspectElement
{
return UI_STRING("Inspect Element", "Inspect Element context menu item");
@@ -523,4 +598,14 @@
return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, width, height];
}
+- (NSString*)mediaElementLoadingStateText
+{
+ return UI_STRING("Loading...", "Media controller status message when the media is loading");
+}
+
+- (NSString*)mediaElementLiveBroadcastStateText
+{
+ return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
+}
+
@end