summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebView
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebKit/mac/WebView
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebKit/mac/WebView')
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsView.mm2
-rw-r--r--WebKit/mac/WebView/WebFrame.mm5
-rw-r--r--WebKit/mac/WebView/WebGeolocationPosition.mm6
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm1
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm36
-rw-r--r--WebKit/mac/WebView/WebNavigationData.mm2
-rw-r--r--WebKit/mac/WebView/WebPDFRepresentation.mm6
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm1
-rw-r--r--WebKit/mac/WebView/WebResource.mm2
-rw-r--r--WebKit/mac/WebView/WebSerializedJSValue.mm2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.h2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.mm141
-rw-r--r--WebKit/mac/WebView/WebView.mm26
13 files changed, 169 insertions, 63 deletions
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
index 86090be..74439dd 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
@@ -174,7 +174,7 @@ struct WebDynamicScrollBarsViewPrivate {
[[self contentView] setFrame:[self contentViewFrame]];
}
-- (void)setSuppressLayout:(BOOL)flag;
+- (void)setSuppressLayout:(BOOL)flag
{
_private->suppressLayout = flag;
}
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 7c59615..b71d501 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -66,6 +66,7 @@
#import <WebCore/EventNames.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameLoaderStateMachine.h>
#import <WebCore/FrameTree.h>
#import <WebCore/GraphicsContext.h>
#import <WebCore/HTMLFrameOwnerElement.h>
@@ -1051,7 +1052,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (BOOL)_firstLayoutDone
{
- return _private->coreFrame->loader()->firstLayoutDone();
+ return _private->coreFrame->loader()->stateMachine()->firstLayoutDone();
}
- (WebFrameLoadType)_loadType
@@ -1222,7 +1223,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (documentLoader && !documentLoader->mainDocumentError().isNull())
[result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError];
- if (frameLoader->containsPlugins())
+ if (frameLoader->subframeLoader()->containsPlugins())
[result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins];
if (DOMWindow* domWindow = _private->coreFrame->domWindow()) {
diff --git a/WebKit/mac/WebView/WebGeolocationPosition.mm b/WebKit/mac/WebView/WebGeolocationPosition.mm
index 46f62c1..c92b7f1 100644
--- a/WebKit/mac/WebView/WebGeolocationPosition.mm
+++ b/WebKit/mac/WebView/WebGeolocationPosition.mm
@@ -83,4 +83,10 @@ GeolocationPosition* core(WebGeolocationPosition *position)
return self;
}
+- (void)dealloc
+{
+ [_internal release];
+ [super dealloc];
+}
+
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 51fd5ba..c009f4a 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -29,6 +29,7 @@
#import "WebHTMLRepresentation.h"
#import "DOMElementInternal.h"
+#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
#import "WebArchive.h"
#import "WebBasePluginPackage.h"
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index a60ae12..e40500c 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -353,7 +353,6 @@ static CachedResourceClient* promisedDataClient()
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText;
- (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard;
- (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText;
-- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard;
- (void)_removeMouseMovedObserverUnconditionally;
- (void)_removeSuperviewObservers;
- (void)_removeWindowObservers;
@@ -874,19 +873,6 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
[webView release];
}
-- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard
-{
- WebView *webView = [[self _webView] retain];
- [webView _setInsertionPasteboard:pasteboard];
-
- NSString *text = [self _plainTextFromPasteboard:pasteboard];
- if ([self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionPasted])
- [[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]];
-
- [webView _setInsertionPasteboard:nil];
- [webView release];
-}
-
- (void)_removeMouseMovedObserverUnconditionally
{
if (!_private || !_private->observingMouseMovedNotifications)
@@ -2576,6 +2562,7 @@ WEBCORE_COMMAND(pageDown)
WEBCORE_COMMAND(pageDownAndModifySelection)
WEBCORE_COMMAND(pageUp)
WEBCORE_COMMAND(pageUpAndModifySelection)
+WEBCORE_COMMAND(pasteAsPlainText)
WEBCORE_COMMAND(selectAll)
WEBCORE_COMMAND(selectLine)
WEBCORE_COMMAND(selectParagraph)
@@ -2615,18 +2602,6 @@ WEBCORE_COMMAND(yankAndSelect)
return YES;
}
-- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard
-{
- Frame* coreFrame = core([self _frame]);
- if (!coreFrame)
- return NO;
- if (coreFrame->selection()->isContentRichlyEditable())
- [self _pasteWithPasteboard:pasteboard allowPlainText:YES];
- else
- [self _pasteAsPlainTextWithPasteboard:pasteboard];
- return YES;
-}
-
- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
{
BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]);
@@ -5162,15 +5137,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
coreFrame->editor()->pasteAsPlainText();
}
-- (void)pasteAsPlainText:(id)sender
-{
- COMMAND_PROLOGUE
-
- if (![self _canEdit])
- return;
- [self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
-}
-
- (void)closeIfNotCurrentView
{
if ([[[self _frame] frameView] documentView] != self)
diff --git a/WebKit/mac/WebView/WebNavigationData.mm b/WebKit/mac/WebView/WebNavigationData.mm
index 290d8b1..753a441 100644
--- a/WebKit/mac/WebView/WebNavigationData.mm
+++ b/WebKit/mac/WebView/WebNavigationData.mm
@@ -55,7 +55,7 @@
@implementation WebNavigationData
-- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource;
+- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource
{
_private = [[WebNavigationDataPrivate alloc] init];
diff --git a/WebKit/mac/WebView/WebPDFRepresentation.mm b/WebKit/mac/WebView/WebPDFRepresentation.mm
index 36449f3..44a1362 100644
--- a/WebKit/mac/WebView/WebPDFRepresentation.mm
+++ b/WebKit/mac/WebView/WebPDFRepresentation.mm
@@ -70,15 +70,15 @@
return PDFDocumentClass;
}
-- (void)setDataSource:(WebDataSource *)dataSource;
+- (void)setDataSource:(WebDataSource *)dataSource
{
}
-- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
+- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
}
-- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource;
+- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource
{
}
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 36aef1f..0a192f9 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -360,6 +360,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitHTML5ParserEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm
index 73c0118..fd02212 100644
--- a/WebKit/mac/WebView/WebResource.mm
+++ b/WebKit/mac/WebView/WebResource.mm
@@ -277,7 +277,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return frameName;
}
-- (id)description
+- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %@>", [self className], [self URL]];
}
diff --git a/WebKit/mac/WebView/WebSerializedJSValue.mm b/WebKit/mac/WebView/WebSerializedJSValue.mm
index af96aa4..05a316b 100644
--- a/WebKit/mac/WebView/WebSerializedJSValue.mm
+++ b/WebKit/mac/WebView/WebSerializedJSValue.mm
@@ -40,7 +40,7 @@ using namespace WebCore;
@implementation WebSerializedJSValue
-- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception;
+- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception
{
ASSERT_ARG(value, value);
ASSERT_ARG(sourceContext, sourceContext);
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.h b/WebKit/mac/WebView/WebVideoFullscreenController.h
index 2e0c4c3..3e7b6cf 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.h
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.h
@@ -48,6 +48,8 @@ namespace WebCore {
BOOL _isEndingFullscreen;
BOOL _isWindowLoaded;
BOOL _forceDisableAnimation;
+ uint32_t _idleDisplaySleepAssertion;
+ uint32_t _idleSystemSleepAssertion;
SystemUIMode _savedUIMode;
SystemUIOptions _savedUIOptions;
}
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index 8cbe0a0..69ded78 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -30,6 +30,7 @@
#import "WebTypesInternal.h"
#import "WebVideoFullscreenHUDWindowController.h"
#import "WebWindowAnimation.h"
+#import <IOKit/pwr_mgt/IOPMLib.h>
#import <QTKit/QTKit.h>
#import <WebCore/HTMLMediaElement.h>
#import <WebCore/SoftLinking.h>
@@ -55,6 +56,13 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
@end
@interface WebVideoFullscreenController(HUDWindowControllerDelegate) <WebVideoFullscreenHUDWindowControllerDelegate>
+- (void)requestExitFullscreenWithAnimation:(BOOL)animation;
+- (void)updateMenuAndDockForFullscreen;
+- (void)updatePowerAssertions;
+@end
+
+@interface NSWindow(IsOnActiveSpaceAdditionForTigerAndLeopard)
+- (BOOL)isOnActiveSpace;
@end
@implementation WebVideoFullscreenController
@@ -98,15 +106,18 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
[window setHasShadow:YES]; // This is nicer with a shadow.
[window setLevel:NSPopUpMenuWindowLevel-1];
[layer release];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp];
#endif
}
-- (WebCore::HTMLMediaElement*)mediaElement;
+- (WebCore::HTMLMediaElement*)mediaElement
{
return _mediaElement.get();
}
-- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
+- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement
{
#ifdef BUILDING_ON_TIGER
// WebVideoFullscreenController is not supported on Tiger:
@@ -133,7 +144,7 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
return _delegate;
}
-- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate;
+- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate
{
_delegate = delegate;
}
@@ -153,7 +164,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
[self clearFadeAnimation];
[[self window] close];
[self setWindow:nil];
- SetSystemUIMode(_savedUIMode, _savedUIOptions);
+ [self updateMenuAndDockForFullscreen];
+ [self updatePowerAssertions];
[_hudController setDelegate:nil];
[_hudController release];
_hudController = nil;
@@ -173,8 +185,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
_hudController = [[WebVideoFullscreenHUDWindowController alloc] init];
[_hudController setDelegate:self];
- GetSystemUIMode(&_savedUIMode, &_savedUIOptions);
- SetSystemUIMode(kUIModeAllSuppressed , 0);
+ [self updateMenuAndDockForFullscreen];
+ [self updatePowerAssertions];
[NSCursor setHiddenUntilMouseMoves:YES];
// Give the HUD keyboard focus initially
@@ -186,6 +198,22 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
return _mediaElement->screenRect();
}
+- (void)applicationDidResignActive:(NSNotification*)notification
+{
+ // Check to see if the fullscreenWindow is on the active space; this function is available
+ // on 10.6 and later, so default to YES if the function is not available:
+ NSWindow* fullscreenWindow = [self fullscreenWindow];
+ BOOL isOnActiveSpace = ([fullscreenWindow respondsToSelector:@selector(isOnActiveSpace)] ? [fullscreenWindow isOnActiveSpace] : YES);
+
+ // Replicate the QuickTime Player (X) behavior when losing active application status:
+ // Is the fullscreen screen the main screen? (Note: this covers the case where only a
+ // single screen is available.) Is the fullscreen screen on the current space? IFF so,
+ // then exit fullscreen mode.
+ if ([fullscreenWindow screen] == [[NSScreen screens] objectAtIndex:0] && isOnActiveSpace)
+ [self requestExitFullscreenWithAnimation:NO];
+}
+
+
#pragma mark -
#pragma mark Exposed Interface
@@ -229,7 +257,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
_fadeAnimation = [[WebWindowFadeAnimation alloc] initWithDuration:0.2 window:_backgroundFullscreenWindow initialAlpha:initialAlpha finalAlpha:fadeIn ? 1 : 0];
}
-- (void)enterFullscreen:(NSScreen *)screen;
+- (void)enterFullscreen:(NSScreen *)screen
{
if (!screen)
screen = [NSScreen mainScreen];
@@ -277,6 +305,98 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[[self fullscreenWindow] animateFromRect:[[self window] frame] toRect:endFrame withSubAnimation:_fadeAnimation controllerAction:@selector(windowDidExitFullscreen)];
}
+- (void)applicationDidChangeScreenParameters:(NSNotification*)notification
+{
+ // The user may have changed the main screen by moving the menu bar, or they may have changed
+ // the Dock's size or location, or they may have changed the fullscreen screen's dimensions.
+ // Update our presentation parameters, and ensure that the full screen window occupies the
+ // entire screen:
+ [self updateMenuAndDockForFullscreen];
+ [[self window] setFrame:[[[self window] screen] frame] display:YES];
+}
+
+- (void)updateMenuAndDockForFullscreen
+{
+ // NSApplicationPresentationOptions is available on > 10.6 only:
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
+ NSScreen* fullscreenScreen = [[self window] screen];
+
+ if (!_isEndingFullscreen) {
+ // Auto-hide the menu bar if the fullscreenScreen contains the menu bar:
+ // NOTE: if the fullscreenScreen contains the menu bar but not the dock, we must still
+ // auto-hide the dock, or an exception will be thrown.
+ if ([[NSScreen screens] objectAtIndex:0] == fullscreenScreen)
+ options |= (NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock);
+ // Check if the current screen contains the dock by comparing the screen's frame to its
+ // visibleFrame; if a dock is present, the visibleFrame will differ. If the current screen
+ // contains the dock, hide it.
+ else if (!NSEqualRects([fullscreenScreen frame], [fullscreenScreen visibleFrame]))
+ options |= NSApplicationPresentationAutoHideDock;
+ }
+
+ if ([NSApp respondsToSelector:@selector(setPresentationOptions:)])
+ [NSApp setPresentationOptions:options];
+ else
+#endif
+ SetSystemUIMode(_isEndingFullscreen ? kUIModeNormal : kUIModeAllHidden, 0);
+}
+
+#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5
+- (void)_disableIdleDisplaySleep
+{
+ if (_idleDisplaySleepAssertion == kIOPMNullAssertionID)
+#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK
+ IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &_idleDisplaySleepAssertion);
+#else // IOPMAssertionCreate is depreciated in > 10.5
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleDisplaySleepAssertion);
+#endif
+}
+
+- (void)_enableIdleDisplaySleep
+{
+ if (_idleDisplaySleepAssertion != kIOPMNullAssertionID) {
+ IOPMAssertionRelease(_idleDisplaySleepAssertion);
+ _idleDisplaySleepAssertion = kIOPMNullAssertionID;
+ }
+}
+
+- (void)_disableIdleSystemSleep
+{
+ if (_idleSystemSleepAssertion == kIOPMNullAssertionID)
+#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK
+ IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_idleSystemSleepAssertion);
+#else // IOPMAssertionCreate is depreciated in > 10.5
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleSystemSleepAssertion);
+#endif
+}
+
+- (void)_enableIdleSystemSleep
+{
+ if (_idleSystemSleepAssertion != kIOPMNullAssertionID) {
+ IOPMAssertionRelease(_idleSystemSleepAssertion);
+ _idleSystemSleepAssertion = kIOPMNullAssertionID;
+ }
+}
+#endif
+
+- (void)updatePowerAssertions
+{
+#if !defined(BUILDING_ON_TIGER)
+ float rate = 0;
+ if (_mediaElement && _mediaElement->platformMedia().type == WebCore::PlatformMedia::QTMovieType)
+ rate = [_mediaElement->platformMedia().media.qtMovie rate];
+
+ if (rate && !_isEndingFullscreen) {
+ [self _disableIdleSystemSleep];
+ [self _disableIdleDisplaySleep];
+ } else {
+ [self _enableIdleSystemSleep];
+ [self _enableIdleDisplaySleep];
+ }
+#endif
+}
+
#pragma mark -
#pragma mark Window callback
@@ -314,6 +434,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
{
UNUSED_PARAM(unusedNotification);
[_hudController updateRate];
+ [self updatePowerAssertions];
}
@end
@@ -453,12 +574,6 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[[self windowController] fadeHUDIn];
}
-- (void)resignKeyWindow
-{
- [super resignKeyWindow];
- [[self windowController] requestExitFullscreenWithAnimation:NO];
-}
-
@end
#endif /* ENABLE(VIDEO) */
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 0023509..631dd63 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -86,6 +86,7 @@
#import "WebPDFView.h"
#import "WebPanelAuthenticationHandler.h"
#import "WebPasteboardHelper.h"
+#import "WebPlatformStrategies.h"
#import "WebPluginDatabase.h"
#import "WebPluginHalterClient.h"
#import "WebPolicyDelegate.h"
@@ -103,13 +104,13 @@
#import <Foundation/NSURLConnection.h>
#import <JavaScriptCore/APICast.h>
#import <JavaScriptCore/JSValueRef.h>
+#import <WebCore/AbstractDatabase.h>
#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/BackForwardList.h>
#import <WebCore/Cache.h>
#import <WebCore/ColorMac.h>
#import <WebCore/CSSComputedStyleDeclaration.h>
#import <WebCore/Cursor.h>
-#import <WebCore/Database.h>
#import <WebCore/Document.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/DragController.h>
@@ -190,6 +191,7 @@
@interface NSWindow (WebNSWindowDetails)
- (id)_oldFirstResponderBeforeBecoming;
- (void)_enableScreenUpdatesIfNeeded;
+- (BOOL)_wrapsCarbonWindow;
@end
using namespace WebCore;
@@ -654,6 +656,10 @@ static bool shouldEnableLoadDeferring()
#endif
WebKitInitializeApplicationCachePathIfNecessary();
patchMailRemoveAttributesMethod();
+
+ // Initialize our platform strategies.
+ WebPlatformStrategies::initialize();
+
didOneTimeInitialization = true;
}
@@ -1356,7 +1362,7 @@ static bool fastDocumentTeardownEnabled()
settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]);
settings->setPluginsEnabled([preferences arePlugInsEnabled]);
#if ENABLE(DATABASE)
- Database::setIsAvailable([preferences databasesEnabled]);
+ AbstractDatabase::setIsAvailable([preferences databasesEnabled]);
#endif
settings->setLocalStorageEnabled([preferences localStorageEnabled]);
settings->setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]);
@@ -4209,7 +4215,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag)
Frame* coreFrame = [self _mainCoreFrame];
if (!coreFrame)
return YES;
- return coreFrame->shouldClose();
+ return coreFrame->loader()->shouldClose();
}
static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValue)
@@ -5389,7 +5395,7 @@ static WebFrameView *containingFrameView(NSView *view)
NSDictionary *element = [sender representedObject];
ASSERT([element isKindOfClass:[NSDictionary class]]);
- WebDataSource *dataSource = [[element objectForKey:WebElementFrameKey] dataSource];
+ WebDataSource *dataSource = [(WebFrame *)[element objectForKey:WebElementFrameKey] dataSource];
NSURLRequest *request = [[dataSource request] copy];
ASSERT(request);
@@ -5669,7 +5675,15 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
// An NSWindow may not display in the next runloop cycle after dirtying due to delayed window display logic,
// in which case this observer can fire first. So if the window is due for a display, don't commit
// layer changes, otherwise they'll show on screen before the view drawing.
- if ([window viewsNeedDisplay])
+ bool viewsNeedDisplay;
+#ifndef __LP64__
+ if (window && [window _wrapsCarbonWindow])
+ viewsNeedDisplay = HIViewGetNeedsDisplay(HIViewGetRoot(static_cast<WindowRef>([window windowRef])));
+ else
+#endif
+ viewsNeedDisplay = [window viewsNeedDisplay];
+
+ if (viewsNeedDisplay)
return;
if ([webView _syncCompositingChanges]) {
@@ -5766,7 +5780,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
return nil;
}
-- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position;
+- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position
{
#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (_private && _private->page)