summaryrefslogtreecommitdiffstats
path: root/WebKit/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac')
-rw-r--r--WebKit/mac/ChangeLog258
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h1
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.m26
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm1
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm8
-rw-r--r--WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm5
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h2
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm7
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.h12
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm52
-rw-r--r--WebKit/mac/WebInspector/WebNodeHighlightView.mm13
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h1
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm11
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h3
-rw-r--r--WebKit/mac/WebView/WebView.mm62
-rw-r--r--WebKit/mac/WebView/WebViewPrivate.h4
18 files changed, 441 insertions, 28 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index a43b4c5..d707720 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,261 @@
+2010-09-28 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Some windowed plugins did not handle events through EventHandler, so we
+ never set right gesture state for those events.
+ This change is to set right allowPopupsFromPlugin flag to current
+ execution frame, so WeKit can always get right gesture state on Mac.
+ From Mac Snow Leopard, the plugin is run under "WebKitPluginHost,app"
+ process, that process passes the allowPopupsFromPlugin flag to
+ WKPCEvaluate(in NetscapePluginHostProxy.mm), then flag is set in
+ NetscapePluginInstanceProxy::evaluate.
+
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView sendEvent:isDrawRect:]):
+
+2010-09-28 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=46663
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+
+2010-09-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ DRT/Mac nodesFromRect support
+
+ [Mac][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46580
+
+ Implement nodesFromRect as a private method to access non-exposed Document
+ methods, similarly to computedStyleIncludingVisitedInfo.
+
+ * WebView/WebView.mm: Added JSDocument.h and JSNodeList.h to the include list.
+ These headers makes it possible to:
+ 1) Get a Document off of a JSDocument;
+ 2) Call toJS function, defined in JSNodeList.cpp|h so we can convert RefPtr<NodeList>
+ gotten from Document::nodesFromRect to JS bindings.
+ (-[WebView _nodesFromRect:forDocument:x:y:hPadding:vPadding:ignoreClipping:]):
+ * WebView/WebViewPrivate.h: Added nodesFromRect method to access methods of the
+ Document class not exposed to JavaScript. It works similarly to computedStyleIncludingVisitedInfo.
+
+2010-09-24 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ automaticSpellingCorrectionEnabled isn't updated.
+ https://bugs.webkit.org/show_bug.cgi?id=46486
+ <rdar://problem/8475212>
+
+ * WebView/WebView.mm:
+ (+[WebView initialize]): Should update "automaticSpellingCorrectionEnabled"
+ instead of "automaticTextReplacementEnabled".
+
+2010-09-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46380
+ REGRESSION: Crash when downloading a file
+
+ Downloading cannot be tested in DRT.
+
+ * Misc/WebNSFileManagerExtras.m: (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]):
+ Don't copy null strings.
+
+2010-09-24 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: CRASH at node highlight on MAC Safari.
+ 1) run-safari --debug
+ 2) open inspector
+ 3) open elements panel
+ 4) hover mouse over elements panel items multiple times
+ 5) CRASH
+ Looks like it is a race condition. WebNodeHighlightView doesn't check
+ the pointer to WebNodeHighligh object and it can be nil.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46261
+
+ * WebInspector/WebNodeHighlightView.mm:
+ (-[WebNodeHighlightView drawRect:]):
+
+2010-09-23 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): some Dashboard widgets are always invisible due to
+ HTML parser changes.
+ https://bugs.webkit.org/show_bug.cgi?id=46435
+
+ Enable pre-HTML5 parser quirks if Dashboard is in backward compatibility
+ mode.
+
+ * WebView/WebView.mm:
+ (-[WebView _needsPreHTML5ParserQuirks]): Renamed from
+ shouldUsePreHTML5ParserQuirks(). Return true if
+ WebCore::Settings::usesDashboardCompatibilityMode() is true.
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _setDashboardBehavior:to:]): Enable pre-HTML5 parser quirks
+ if Dashboard behavior is set to backward compatibility mode.
+
+2010-09-23 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView/WebView.mm:
+ Updating set interval call to use Settings' static version inside
+ one time init block.
+
+2010-09-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): Microsoft Entourage 2008 does not invoke My Day window
+ https://bugs.webkit.org/show_bug.cgi?id=46334
+
+ Microsoft My Day loads scripts using self-closing script tags, markup
+ which is incompatible with the HTML5 parser. Enable parser quirks for
+ this application.
+
+ * WebView/WebView.mm:
+ (shouldUsePreHTML5ParserQuirks): Return true if the application is
+ Microsoft My Day and was linked against a version of WebKit prior to the
+ introduction of the HTML5 parser.
+
+2010-09-23 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add hyperlink auditing settings (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences setMemoryInfoEnabled:]):
+ (-[WebPreferences hyperlinkAuditingEnabled]):
+ (-[WebPreferences setHyperlinkAuditingEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-09-22 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43667
+ ASSERT failure in NetscapePluginInstanceProxy::disconnectStream
+
+ Test: plugins/get-javascript-url.html
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): Add the stream to m_streams, just
+ like any other one.
+
+2010-09-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
+ https://bugs.webkit.org/show_bug.cgi?id=46220
+
+ * Misc/WebNSFileManagerExtras.m:
+ (setMetaData): Use CFRelease instead of HardRelease.
+ (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Use CFStringCreateCopy
+ instead of -[NSObject copy] combined with HardRetainWithNSRelease.
+
+2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ PluginStrategy should satisfy the needs of Qt
+ https://bugs.webkit.org/show_bug.cgi?id=45857
+ No new functionality so no new tests.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::getPluginInfo):
+
+2010-09-22 Paul Knight <pknight@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ -[WebView _scheduleCompositingLayerSync] should wake the run loop
+ https://bugs.webkit.org/show_bug.cgi?id=46226
+
+ Call CFRunLoopWakeUp to make sure the run loop is not sleeping, which could delay layer painting.
+
+ * WebView/WebView.mm:
+ (-[WebView _scheduleCompositingLayerSync]):
+
+2010-09-21 Andy Estes <aestes@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r61285): AIM 2.1.296: Code rendered as text in Welcome screen
+ https://bugs.webkit.org/show_bug.cgi?id=46134
+
+ AIM clients linked against versions of WebKit prior to the introduction
+ of the HTML5 parser contain markup incompatible with the new parser.
+ Enable parser quirks in this case to remain compatible with these
+ clients.
+
+ * WebView/WebView.mm:
+ (shouldUsePreHTML5ParserQuirks): Returns true if the embedding
+ application is AIM and was linked against a version of WebKit prior to
+ the introduction of the HTML5 parser, or if the
+ WebKitPreHTML5ParserQuirks WebPreference is enabled.
+ (-[WebView _preferencesChangedNotification:]): Call
+ WebCore::Settings::setUsePreHTML5ParserQuirks().
+
+2010-09-21 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientationClient and DeviceMotionClient should have controllerDestroyed() methods
+ https://bugs.webkit.org/show_bug.cgi?id=45891
+
+ Implements WebDeviceOrientationClient::deviceOrientationControllerDestroyed to delete the client.
+
+ * WebCoreSupport/WebDeviceOrientationClient.h:
+ * WebCoreSupport/WebDeviceOrientationClient.mm:
+ (WebDeviceOrientationClient::deviceOrientationControllerDestroyed):
+
+2010-09-20 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New localized strings for the media element context-menu.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay):
+ (WebPlatformStrategies::contextMenuItemTagMediaPause):
+ (WebPlatformStrategies::contextMenuItemTagMediaMute):
+
2010-09-20 Andy Estes <aestes@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 67bf769..13dd8c0 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 9;
+MINOR_VERSION = 10;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 94286d6..4bf2c83 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -54,6 +54,7 @@
#define WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK 0x02120700 // 530.7.0
#define WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS 0x02120A00 // 530.10.0
#define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
+#define WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER 0x02160900 // 534.9.0
#ifdef __cplusplus
extern "C" {
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m
index f10781b..ad48fb8 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.m
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m
@@ -31,7 +31,6 @@
#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
#import <JavaScriptCore/Assertions.h>
-#import <WebCore/FoundationExtras.h>
#import <WebKitSystemInterface.h>
#import <sys/stat.h>
@@ -87,19 +86,22 @@
typedef struct MetaDataInfo
{
- NSString *URLString;
- NSString *referrer;
- NSString *path;
+ CFStringRef URLString;
+ CFStringRef referrer;
+ CFStringRef path;
} MetaDataInfo;
static void *setMetaData(void* context)
{
MetaDataInfo *info = (MetaDataInfo *)context;
- WKSetMetadataURL(info->URLString, info->referrer, info->path);
-
- HardRelease(info->URLString);
- HardRelease(info->referrer);
- HardRelease(info->path);
+ WKSetMetadataURL((NSString *)info->URLString, (NSString *)info->referrer, (NSString *)info->path);
+
+ if (info->URLString)
+ CFRelease(info->URLString);
+ if (info->referrer)
+ CFRelease(info->referrer);
+ if (info->path)
+ CFRelease(info->path);
free(info);
return 0;
@@ -124,9 +126,9 @@ static void *setMetaData(void* context)
MetaDataInfo *info = malloc(sizeof(MetaDataInfo));
- info->URLString = HardRetainWithNSRelease([URLString copy]);
- info->referrer = HardRetainWithNSRelease([referrer copy]);
- info->path = HardRetainWithNSRelease([path copy]);
+ info->URLString = URLString ? CFStringCreateCopy(0, (CFStringRef)URLString) : 0;
+ info->referrer = referrer ? CFStringCreateCopy(0, (CFStringRef)referrer) : 0;
+ info->path = path ? CFStringCreateCopy(0, (CFStringRef)path) : 0;
pthread_create(&tid, &attr, setMetaData, info);
pthread_attr_destroy(&attr);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index c0c480b..e03bc27 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -704,6 +704,7 @@ void NetscapePluginInstanceProxy::evaluateJavaScript(PluginRequest* pluginReques
NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding];
RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, pluginRequest->requestID(), pluginRequest->request());
+ m_streams.add(stream->streamID(), stream);
RetainPtr<NSURLResponse> response(AdoptNS, [[NSURLResponse alloc] initWithURL:URL
MIMEType:@"text/plain"
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index 3d5d7a1..ff0ca77 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -661,13 +661,19 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// Temporarily retain self in case the plug-in view is released while sending an event.
[[self retain] autorelease];
-
+
BOOL acceptedEvent;
[self willCallPlugInFunction];
+ // Set the pluginAllowPopup flag.
+ ASSERT(_eventHandler);
+ bool oldAllowPopups = frame->script()->allowPopupsFromPlugin();
+ frame->script()->setAllowPopupsFromPlugin(_eventHandler->currentEventIsUserGesture());
{
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event);
}
+ // Restore the old pluginAllowPopup flag.
+ frame->script()->setAllowPopupsFromPlugin(oldAllowPopups);
[self didCallPlugInFunction];
if (portState) {
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
index 1cbc8e2..8e1c274 100644
--- a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
@@ -47,6 +47,7 @@ public:
virtual void startUpdating();
virtual void stopUpdating();
virtual WebCore::DeviceOrientation* lastOrientation() const;
+ virtual void deviceOrientationControllerDestroyed();
private:
id<WebDeviceOrientationProvider> getProvider() const;
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
index 278e835..f0c624d 100644
--- a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
@@ -60,6 +60,11 @@ DeviceOrientation* WebDeviceOrientationClient::lastOrientation() const
return core([getProvider() lastOrientation]);
}
+void WebDeviceOrientationClient::deviceOrientationControllerDestroyed()
+{
+ delete this;
+}
+
id<WebDeviceOrientationProvider> WebDeviceOrientationClient::getProvider() const
{
if (!m_provider) {
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 447c515..0baa55c 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -193,7 +193,7 @@ private:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual void didTransferChildFrameToNewDocument();
+ virtual void didTransferChildFrameToNewDocument(WebCore::Page* oldPage);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&,
const Vector<WTF::String>&, const WTF::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index a398ef7..cef552b 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1382,8 +1382,13 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
return 0;
}
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
+void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page* oldPage)
{
+ if (oldPage == core(m_webFrame.get())->page())
+ return;
+
+ // Update resource tracking now that frame is in a different page.
+ // TODO(jennb): update resource tracking [bug 44713]
}
ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType)
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
index 53f39f8..fab7eee 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
@@ -45,7 +45,7 @@ private:
// WebCore::PluginStrategy
virtual void refreshPlugins();
- virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+ virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
// WebCore::LocalizationStrategy
virtual WTF::String inputElementAltText();
@@ -113,6 +113,16 @@ private:
virtual WTF::String contextMenuItemTagCapitalize();
virtual WTF::String contextMenuItemTagChangeBack(const WTF::String& replacedString);
virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String contextMenuItemTagOpenVideoInNewWindow();
+ virtual WTF::String contextMenuItemTagOpenAudioInNewWindow();
+ virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard();
+ virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard();
+ virtual WTF::String contextMenuItemTagToggleMediaControls();
+ virtual WTF::String contextMenuItemTagToggleMediaLoop();
+ virtual WTF::String contextMenuItemTagEnterVideoFullscreen();
+ virtual WTF::String contextMenuItemTagMediaPlay();
+ virtual WTF::String contextMenuItemTagMediaPause();
+ virtual WTF::String contextMenuItemTagMediaMute();
#endif // ENABLE(CONTEXT_MENUS)
virtual WTF::String searchMenuNoRecentSearchesText();
virtual WTF::String searchMenuRecentSearchesText();
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
index 2900ccf..9d8fd11 100644
--- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
@@ -72,7 +72,7 @@ void WebPlatformStrategies::refreshPlugins()
[[WebPluginDatabase sharedDatabase] refresh];
}
-void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& plugins)
+void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& plugins)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -156,6 +156,56 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return UI_STRING("Copy Image", "Copy Image context menu item");
}
+String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
+{
+ return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow()
+{
+ return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard()
+{
+ return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard()
+{
+ return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaControls()
+{
+ return UI_STRING("Controls", "Media Controls context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop()
+{
+ return UI_STRING("Loop", "Media Loop context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen()
+{
+ return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPlay()
+{
+ return UI_STRING("Play", "Media Play context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaPause()
+{
+ return UI_STRING("Pause", "Media Pause context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagMediaMute()
+{
+ return UI_STRING("Mute", "Media Mute context menu item");
+}
+
String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
{
return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
diff --git a/WebKit/mac/WebInspector/WebNodeHighlightView.mm b/WebKit/mac/WebInspector/WebNodeHighlightView.mm
index b3cd69e..7fc3cf4 100644
--- a/WebKit/mac/WebInspector/WebNodeHighlightView.mm
+++ b/WebKit/mac/WebInspector/WebNodeHighlightView.mm
@@ -67,14 +67,15 @@ using namespace WebCore;
- (void)drawRect:(NSRect)rect
{
- [NSGraphicsContext saveGraphicsState];
+ if (_webNodeHighlight) {
+ [NSGraphicsContext saveGraphicsState];
- ASSERT([[NSGraphicsContext currentContext] isFlipped]);
+ ASSERT([[NSGraphicsContext currentContext] isFlipped]);
- GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]);
- [_webNodeHighlight inspectorController]->drawNodeHighlight(context);
-
- [NSGraphicsContext restoreGraphicsState];
+ GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]);
+ [_webNodeHighlight inspectorController]->drawNodeHighlight(context);
+ [NSGraphicsContext restoreGraphicsState];
+ }
}
- (WebNodeHighlight *)webNodeHighlight
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 17c8e4d..8119649 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -100,6 +100,7 @@
#define WebKitDNSPrefetchingEnabledPreferenceKey @"WebKitDNSPrefetchingEnabled"
#define WebKitFullScreenEnabledPreferenceKey @"WebKitFullScreenEnabled"
#define WebKitMemoryInfoEnabledPreferenceKey @"WebKitMemoryInfoEnabled"
+#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 87284bb..2ddd8b3 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -368,6 +368,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitHyperlinkAuditingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1332,6 +1333,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:flag forKey:WebKitMemoryInfoEnabledPreferenceKey];
}
+- (BOOL)hyperlinkAuditingEnabled
+{
+ return [self _boolValueForKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
+}
+
+- (void)setHyperlinkAuditingEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitHyperlinkAuditingEnabledPreferenceKey];
+}
+
- (WebKitEditingBehavior)editingBehavior
{
return static_cast<WebKitEditingBehavior>([self _integerValueForKey:WebKitEditingBehaviorPreferenceKey]);
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 3bd5e24..bb525cd 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -196,6 +196,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)memoryInfoEnabled;
- (void)setMemoryInfoEnabled:(BOOL)enabled;
+- (BOOL)hyperlinkAuditingEnabled;
+- (void)setHyperlinkAuditingEnabled:(BOOL)enabled;
+
// Other private methods
- (void)_postPreferencesChangesNotification;
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 20f6e24..1fca8d1 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -133,9 +133,12 @@
#import <WebCore/HistoryItem.h>
#import <WebCore/IconDatabase.h>
#import <WebCore/JSCSSStyleDeclaration.h>
+#import <WebCore/JSDocument.h>
#import <WebCore/JSElement.h>
+#import <WebCore/JSNodeList.h>
#import <WebCore/Logging.h>
#import <WebCore/MIMETypeRegistry.h>
+#import <WebCore/NodeList.h>
#import <WebCore/Page.h>
#import <WebCore/PageCache.h>
#import <WebCore/PageGroup.h>
@@ -675,6 +678,7 @@ static bool shouldEnableLoadDeferring()
// Initialize our platform strategies.
WebPlatformStrategies::initialize();
+ Settings::setMinDOMTimerInterval(0.004);
didOneTimeInitialization = true;
}
@@ -696,7 +700,6 @@ static bool shouldEnableLoadDeferring()
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
- _private->page->settings()->setMinDOMTimerInterval(0.004);
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
@@ -1358,6 +1361,27 @@ static bool fastDocumentTeardownEnabled()
return needsQuirk;
}
+
+- (BOOL)_needsPreHTML5ParserQuirks
+{
+ // AOL Instant Messenger and Microsoft My Day contain markup incompatible
+ // with the new HTML5 parser. If these applications were linked against a
+ // version of WebKit prior to the introduction of the HTML5 parser, enable
+ // parser quirks to maintain compatibility. For details, see
+ // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
+ // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
+ static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
+ && (applicationIsAOLInstantMessenger() || applicationIsMicrosoftMyDay());
+
+ return isApplicationNeedingParserQuirks
+#if ENABLE(DASHBOARD_SUPPORT)
+ // Pre-HTML5 parser quirks are required to remain compatible with many
+ // Dashboard widgets. See <rdar://problem/8175982>.
+ || (_private->page && _private->page->settings()->usesDashboardBackwardCompatibilityMode())
+#endif
+ || [[self preferences] usePreHTML5ParserQuirks];
+}
+
- (void)_preferencesChangedNotification:(NSNotification *)notification
{
WebPreferences *preferences = (WebPreferences *)[notification object];
@@ -1453,7 +1477,8 @@ static bool fastDocumentTeardownEnabled()
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
#endif
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
- settings->setUsePreHTML5ParserQuirks([preferences usePreHTML5ParserQuirks]);
+ settings->setHyperlinkAuditingEnabled([preferences hyperlinkAuditingEnabled]);
+ settings->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
// Application Cache Preferences are stored on the global cache storage manager, not in Settings.
[WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
@@ -1983,6 +2008,11 @@ static inline IMP getMethod(id o, SEL s)
break;
}
}
+
+ // Pre-HTML5 parser quirks should be enabled if Dashboard is in backward
+ // compatibility mode. See <rdar://problem/8175982>.
+ if (_private->page)
+ _private->page->settings()->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
}
- (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior
@@ -2649,7 +2679,7 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
- automaticTextReplacementEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+ automaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
#endif
}
@@ -5859,6 +5889,11 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
- (void)_scheduleCompositingLayerSync
{
+ CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
+
+ // Make sure we wake up the loop or the observer could be delayed until some other source fires.
+ CFRunLoopWakeUp(currentRunLoop);
+
if (_private->layerSyncRunLoopObserver)
return;
@@ -5874,7 +5909,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
kCFRunLoopBeforeWaiting | kCFRunLoopExit, true /* repeats */,
runLoopOrder, layerSyncRunLoopObserverCallBack, &context);
- CFRunLoopAddObserver(CFRunLoopGetCurrent(), _private->layerSyncRunLoopObserver, kCFRunLoopCommonModes);
+ CFRunLoopAddObserver(currentRunLoop, _private->layerSyncRunLoopObserver, kCFRunLoopCommonModes);
}
#endif
@@ -6020,6 +6055,25 @@ static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity
@end
+@implementation WebView (WebViewPrivateNodesFromRect)
+
+- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping
+{
+ JSLock lock(SilenceAssertionsOnly);
+ ExecState* exec = toJS(context);
+ if (!value)
+ return JSValueMakeUndefined(context);
+ JSValue jsValue = toJS(exec, value);
+ if (!jsValue.inherits(&JSDocument::s_info))
+ return JSValueMakeUndefined(context);
+ JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
+ Document* document = jsDocument->impl();
+ RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
+ return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
+}
+
+@end
+
#ifdef BUILDING_ON_LEOPARD
static IMP originalRecursivelyRemoveMailAttributesImp;
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index aeb36c7..749eeb3 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -630,6 +630,10 @@ Could be worth adding to the API.
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
@end
+@interface WebView (WebViewPrivateNodesFromRect)
+- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping;
+@end
+
@interface NSObject (WebFrameLoadDelegatePrivate)
- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;