summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebView
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-22 13:02:20 +0100
committerBen Murdoch <benm@google.com>2010-10-26 15:21:41 +0100
commita94275402997c11dd2e778633dacf4b7e630a35d (patch)
treee66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebKit/mac/WebView
parent09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff)
downloadexternal_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebKit/mac/WebView')
-rw-r--r--WebKit/mac/WebView/WebFrame.mm31
-rw-r--r--WebKit/mac/WebView/WebFramePrivate.h4
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm54
-rw-r--r--WebKit/mac/WebView/WebHTMLViewInternal.h1
-rw-r--r--WebKit/mac/WebView/WebHTMLViewPrivate.h3
-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/WebSerializedJSValue.mm33
-rw-r--r--WebKit/mac/WebView/WebSerializedJSValuePrivate.h34
-rw-r--r--WebKit/mac/WebView/WebUIDelegatePrivate.h2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.h3
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.mm26
-rw-r--r--WebKit/mac/WebView/WebView.mm28
-rw-r--r--WebKit/mac/WebView/WebViewData.h2
-rw-r--r--WebKit/mac/WebView/WebViewInternal.h2
16 files changed, 210 insertions, 28 deletions
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 02696f4..4f8c1ba 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -44,7 +44,6 @@
#import "WebFrameViewInternal.h"
#import "WebHTMLView.h"
#import "WebHTMLViewInternal.h"
-#import "WebIconFetcherInternal.h"
#import "WebKitStatisticsPrivate.h"
#import "WebKitVersionChecks.h"
#import "WebNSObjectExtras.h"
@@ -530,6 +529,26 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return [[[NSString alloc] initWithCharactersNoCopy:buf length:length freeWhenDone:YES] autorelease];
}
+- (BOOL)_shouldFlattenCompositingLayers:(CGContextRef)context
+{
+ // -currentContextDrawingToScreen returns YES for bitmap contexts.
+ BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen];
+ if (isPrinting)
+ return YES;
+
+ if (!WKCGContextIsBitmapContext(context))
+ return NO;
+
+ // If we're drawing into a bitmap, we might be snapshotting, or drawing into a layer-backed view.
+ if ([getWebView(self) _usesDocumentViews]) {
+ id documentView = [_private->webFrameView documentView];
+ if ([documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _web_isDrawingIntoLayer])
+ return NO;
+ }
+
+ return [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap];
+}
+
- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly
{
ASSERT([[NSGraphicsContext currentContext] isFlipped]);
@@ -546,7 +565,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (parentView)
shouldFlatten = parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
} else
- shouldFlatten = WKCGContextIsBitmapContext(ctx) && [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap];
+ shouldFlatten = [self _shouldFlattenCompositingLayers:ctx];
PaintBehavior oldBehavior = PaintBehaviorNormal;
if (shouldFlatten) {
@@ -1008,14 +1027,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return _private->coreFrame->domWindow()->pendingUnloadEventListeners();
}
-- (WebIconFetcher *)fetchApplicationIcon:(id)target
- selector:(SEL)selector
-{
- return [WebIconFetcher _fetchApplicationIconForFrame:self
- target:target
- selector:selector];
-}
-
- (void)_setIsDisconnected:(bool)isDisconnected
{
_private->coreFrame->setIsDisconnected(isDisconnected);
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 9cb6232..b0cb0f3 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -38,7 +38,6 @@
@class DOMDocumentFragment;
@class DOMNode;
@class DOMRange;
-@class WebIconFetcher;
@class WebScriptObject;
@class WebScriptWorld;
@@ -87,9 +86,6 @@ typedef enum {
- (unsigned)_pendingFrameUnloadEventCount;
-- (WebIconFetcher *)fetchApplicationIcon:(id)target
- selector:(SEL)selector;
-
- (void)_setIsDisconnected:(bool)isDisconnected;
- (void)_setExcludeFromTextSearch:(bool)exclude;
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index 02d32d9..ec2473f 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -456,6 +456,7 @@ struct WebHTMLViewInterpretKeyEventsParameters {
#if USE(ACCELERATED_COMPOSITING)
NSView *layerHostingView;
+ BOOL drawingIntoLayer;
#endif
NSEvent *mouseDownEvent; // Kept after handling the event.
@@ -2232,6 +2233,22 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return _private->printing;
}
+- (BOOL)_beginPrintModeWithMinimumPageWidth:(CGFloat)minimumPageWidth height:(CGFloat)minimumPageHeight maximumPageWidth:(CGFloat)maximumPageWidth
+{
+ Frame* frame = core([self _frame]);
+ if (!frame)
+ return NO;
+
+ if (frame->document() && frame->document()->isFrameSet()) {
+ minimumPageWidth = 0;
+ minimumPageHeight = 0;
+ maximumPageWidth = 0;
+ }
+
+ [self _setPrinting:YES minimumPageWidth:minimumPageWidth height:minimumPageHeight maximumPageWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
+ return YES;
+}
+
- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit
{
Frame* frame = core([self _frame]);
@@ -3401,6 +3418,9 @@ WEBCORE_COMMAND(yankAndSelect)
[webView _setNeedsOneShotDrawingSynchronization:NO];
}
#endif
+
+ if (webView)
+ CallUIDelegate(webView, @selector(webView:didDrawFrame:), [self _frame]);
}
// Turn off the additional clip while computing our visibleRect.
@@ -5552,6 +5572,14 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
[viewLayer setTransform:CATransform3DMakeScale(scaleFactor, scaleFactor, 1)];
#endif
+ if ([self layer]) {
+ // If we are in a layer-backed view, we need to manually initialize the geometry for our layer.
+ [viewLayer setBounds:NSRectToCGRect([_private->layerHostingView bounds])];
+ [viewLayer setAnchorPoint:CGPointMake(0, [self isFlipped] ? 1 : 0)];
+ CGPoint layerPosition = NSPointToCGPoint([self convertPointToBase:[_private->layerHostingView frame].origin]);
+ [viewLayer setPosition:layerPosition];
+ }
+
[_private->layerHostingView setLayer:viewLayer];
[_private->layerHostingView setWantsLayer:YES];
@@ -5591,8 +5619,6 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
NSRect layerViewFrame = [self bounds];
if (layerViewFrame.size.height > maxHeight) {
- CGFloat documentHeight = layerViewFrame.size.height;
-
// Clamp the size of the view to <= maxHeight to avoid the bug.
layerViewFrame.size.height = maxHeight;
NSRect visibleRect = [[self enclosingScrollView] documentVisibleRect];
@@ -5602,14 +5628,34 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
layerViewFrame.origin.y = topOffset;
// Compensate for the moved view by adjusting the sublayer transform on the view's layer (using flipped coords).
- CGFloat bottomOffset = documentHeight - layerViewFrame.size.height - topOffset;
- [[_private->layerHostingView layer] setSublayerTransform:CATransform3DMakeTranslation(0, -bottomOffset, 0)];
+ CATransform3D flipTransform = CATransform3DMakeTranslation(0, topOffset, 0);
+ flipTransform = CATransform3DScale(flipTransform, 1, -1, 1);
+ [[_private->layerHostingView layer] setSublayerTransform:flipTransform];
}
[_private->layerHostingView _updateLayerGeometryFromView]; // Workaround for <rdar://problem/7071636>
[_private->layerHostingView setFrame:layerViewFrame];
}
#endif // defined(BUILDING_ON_LEOPARD)
+
+- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
+{
+ if (_private) {
+ ASSERT(!_private->drawingIntoLayer);
+ _private->drawingIntoLayer = YES;
+ }
+
+ [super drawLayer:layer inContext:ctx];
+
+ if (_private)
+ _private->drawingIntoLayer = NO;
+}
+
+- (BOOL)_web_isDrawingIntoLayer
+{
+ return _private->drawingIntoLayer;
+}
+
#endif // USE(ACCELERATED_COMPOSITING)
@end
diff --git a/WebKit/mac/WebView/WebHTMLViewInternal.h b/WebKit/mac/WebView/WebHTMLViewInternal.h
index 2d9e2a9..07a782a 100644
--- a/WebKit/mac/WebView/WebHTMLViewInternal.h
+++ b/WebKit/mac/WebView/WebHTMLViewInternal.h
@@ -66,6 +66,7 @@ namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
- (void)attachRootLayer:(CALayer*)layer;
- (void)detachRootLayer;
+- (BOOL)_web_isDrawingIntoLayer;
#endif
#if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD)
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index e1d15dc..1218efc 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -136,6 +136,9 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor;
- (WebCGFloat)_adjustedBottomOfPageWithTop:(WebCGFloat)top bottom:(WebCGFloat)bottom limit:(WebCGFloat)bottomLimit;
- (BOOL)_isInPrintMode;
- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit;
+// Lays out to pages of the given minimum width and height or more (increasing both dimensions proportionally)
+// as needed for the content to fit, but no more than the given maximum width.
+- (BOOL)_beginPrintModeWithMinimumPageWidth:(WebCGFloat)minimumPageWidth height:(WebCGFloat)minimumPageHeight maximumPageWidth:(WebCGFloat)maximumPageWidth;
- (void)_endPrintMode;
- (BOOL)_isInScreenPaginationMode;
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 8119649..cd9ed8f 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -96,6 +96,7 @@
#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
+#define WebKitSpatialNavigationEnabledPreferenceKey @"WebKitSpatialNavigationEnabled"
#define WebKitPaginateDuringLayoutEnabledPreferenceKey @"WebKitPaginateDuringLayoutEnabled"
#define WebKitDNSPrefetchingEnabledPreferenceKey @"WebKitDNSPrefetchingEnabled"
#define WebKitFullScreenEnabledPreferenceKey @"WebKitFullScreenEnabled"
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 2ddd8b3..ccfb632 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -365,6 +365,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitSpatialNavigationEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey,
@@ -1313,6 +1314,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:flag forKey:WebKitFrameFlatteningEnabledPreferenceKey];
}
+- (BOOL)isSpatialNavigationEnabled
+{
+ return [self _boolValueForKey:WebKitSpatialNavigationEnabledPreferenceKey];
+}
+
+- (void)setSpatialNavigationEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitSpatialNavigationEnabledPreferenceKey];
+}
+
- (BOOL)paginateDuringLayoutEnabled
{
return [self _boolValueForKey:WebKitPaginateDuringLayoutEnabledPreferenceKey];
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index bb525cd..47e6d71 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -130,6 +130,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)isFrameFlatteningEnabled;
- (void)setFrameFlatteningEnabled:(BOOL)flag;
+- (BOOL)isSpatialNavigationEnabled;
+- (void)setSpatialNavigationEnabled:(BOOL)flag;
+
// zero means do AutoScale
- (float)PDFScaleFactor;
- (void)setPDFScaleFactor:(float)scale;
diff --git a/WebKit/mac/WebView/WebSerializedJSValue.mm b/WebKit/mac/WebView/WebSerializedJSValue.mm
index 05a316b..d993790 100644
--- a/WebKit/mac/WebView/WebSerializedJSValue.mm
+++ b/WebKit/mac/WebView/WebSerializedJSValue.mm
@@ -22,7 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebSerializedJSValue.h"
+#import "WebSerializedJSValuePrivate.h"
#import <WebCore/SerializedScriptValue.h>
#import <wtf/RefPtr.h>
@@ -65,6 +65,30 @@ using namespace WebCore;
return self;
}
+- (id)initWithInternalRepresentation:(void *)internalRepresenatation
+{
+ ASSERT_ARG(internalRepresenatation, internalRepresenatation);
+
+ if (!internalRepresenatation) {
+ [self release];
+ return nil;
+ }
+
+ self = [super init];
+ if (!self)
+ return nil;
+
+ _private = [[WebSerializedJSValuePrivate alloc] init];
+
+ _private->value = ((SerializedScriptValue*)internalRepresenatation);
+ if (!_private->value) {
+ [self release];
+ return nil;
+ }
+
+ return self;
+}
+
- (JSValueRef)deserialize:(JSContextRef)destinationContext
{
if (!_private || !_private->value)
@@ -79,5 +103,12 @@ using namespace WebCore;
[super dealloc];
}
+- (void*)internalRepresentation
+{
+ if (!_private)
+ return 0;
+ return _private->value.get();
+}
+
@end
diff --git a/WebKit/mac/WebView/WebSerializedJSValuePrivate.h b/WebKit/mac/WebView/WebSerializedJSValuePrivate.h
new file mode 100644
index 0000000..217fe44
--- /dev/null
+++ b/WebKit/mac/WebView/WebSerializedJSValuePrivate.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2005 Apple Computer, 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WebSerializedJSValue.h>
+
+@interface WebSerializedJSValue(WebPrivate)
+- (id)initWithInternalRepresentation:(void*)internalRepresenatation;
+- (void*)internalRepresentation;
+@end
diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h
index 4565a4e..0b62bcb 100644
--- a/WebKit/mac/WebView/WebUIDelegatePrivate.h
+++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h
@@ -183,4 +183,6 @@ enum {
- (void)webView:(WebView *)sender exitFullScreenForElement:(DOMElement *)element;
#endif
+- (void)webView:(WebView *)sender didDrawFrame:(WebFrame *)frame;
+
@end
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.h b/WebKit/mac/WebView/WebVideoFullscreenController.h
index 3e7b6cf..69ba9f4 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.h
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.h
@@ -49,7 +49,8 @@ namespace WebCore {
BOOL _isWindowLoaded;
BOOL _forceDisableAnimation;
uint32_t _idleDisplaySleepAssertion;
- uint32_t _idleSystemSleepAssertion;
+ uint32_t _idleSystemSleepAssertion;
+ NSTimer *_tickleTimer;
SystemUIMode _savedUIMode;
SystemUIOptions _savedUIOptions;
}
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index 69ded78..1efb93f 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -31,6 +31,7 @@
#import "WebVideoFullscreenHUDWindowController.h"
#import "WebWindowAnimation.h"
#import <IOKit/pwr_mgt/IOPMLib.h>
+#import <OSServices/Power.h>
#import <QTKit/QTKit.h>
#import <WebCore/HTMLMediaElement.h>
#import <WebCore/SoftLinking.h>
@@ -43,6 +44,7 @@ SOFT_LINK_CLASS(QTKit, QTMovieLayer)
SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
#define QTMovieRateDidChangeNotification getQTMovieRateDidChangeNotification()
+static const NSTimeInterval tickleTimerInterval = 1.0;
@interface WebVideoFullscreenWindow : NSWindow
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER)
@@ -82,6 +84,9 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
{
ASSERT(!_backgroundFullscreenWindow);
ASSERT(!_fadeAnimation);
+ [_tickleTimer invalidate];
+ [_tickleTimer release];
+ _tickleTimer = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
@@ -378,6 +383,25 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
_idleSystemSleepAssertion = kIOPMNullAssertionID;
}
}
+
+- (void)_enableTickleTimer
+{
+ [_tickleTimer invalidate];
+ [_tickleTimer release];
+ _tickleTimer = [[NSTimer scheduledTimerWithTimeInterval:tickleTimerInterval target:self selector:@selector(_tickleTimerFired) userInfo:nil repeats:YES] retain];
+}
+
+- (void)_disableTickleTimer
+{
+ [_tickleTimer invalidate];
+ [_tickleTimer release];
+ _tickleTimer = nil;
+}
+
+- (void)_tickleTimerFired
+{
+ UpdateSystemActivity(OverallAct);
+}
#endif
- (void)updatePowerAssertions
@@ -390,9 +414,11 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
if (rate && !_isEndingFullscreen) {
[self _disableIdleSystemSleep];
[self _disableIdleDisplaySleep];
+ [self _disableTickleTimer];
} else {
[self _enableIdleSystemSleep];
[self _enableIdleDisplaySleep];
+ [self _enableTickleTimer];
}
#endif
}
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 1fca8d1..9b267ef 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -190,7 +190,7 @@
#import <WebCore/GeolocationError.h>
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
#import <glib.h>
#endif
@@ -385,7 +385,7 @@ static const char webViewIsOpen[] = "At least one WebView is still open.";
#if USE(ACCELERATED_COMPOSITING)
- (void)_clearLayerSyncLoopObserver;
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
- (void)_clearGlibLoopObserver;
#endif
@end
@@ -637,6 +637,19 @@ static bool shouldEnableLoadDeferring()
return _private->usesDocumentViews;
}
+static NSString *leakMailQuirksUserScriptPath()
+{
+ NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"];
+ return [[NSString alloc] initWithContentsOfFile:scriptPath];
+}
+
+- (void)_injectMailQuirksScript
+{
+ static NSString *mailQuirksScriptPath = leakMailQuirksUserScriptPath();
+ core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
+ mailQuirksScriptPath, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames);
+}
+
- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
{
WebCoreThreadViolationCheckRoundTwo();
@@ -750,10 +763,12 @@ static bool shouldEnableLoadDeferring()
if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS))
ResourceHandle::forceContentSniffing();
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
[self _scheduleGlibContextIterations];
#endif
+ if (runningTigerMail() || runningLeopardMail())
+ [self _injectMailQuirksScript];
}
- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
@@ -1151,7 +1166,7 @@ static bool fastDocumentTeardownEnabled()
[self _clearLayerSyncLoopObserver];
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
[self _clearGlibLoopObserver];
#endif
@@ -1472,6 +1487,7 @@ static bool fastDocumentTeardownEnabled()
settings->setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]);
settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
+ settings->setSpatialNavigationEnabled([preferences isSpatialNavigationEnabled]);
settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]);
#if ENABLE(FULLSCREEN_API)
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
@@ -5632,7 +5648,7 @@ static WebFrameView *containingFrameView(NSView *view)
}
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
- (void)_clearGlibLoopObserver
{
if (!_private->glibRunLoopObserver)
@@ -5955,7 +5971,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*)
{
diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h
index 9aa91dc..639c3e0 100644
--- a/WebKit/mac/WebView/WebViewData.h
+++ b/WebKit/mac/WebView/WebViewData.h
@@ -172,7 +172,7 @@ extern int pluginDatabaseClientCount;
WebVideoFullscreenController *fullscreenController;
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
CFRunLoopObserverRef glibRunLoopObserver;
#endif
id<WebGeolocationProvider> _geolocationProvider;
diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h
index 71a2660..0a6f462 100644
--- a/WebKit/mac/WebView/WebViewInternal.h
+++ b/WebKit/mac/WebView/WebViewInternal.h
@@ -88,7 +88,7 @@ namespace WebCore {
- (void)_scheduleCompositingLayerSync;
#endif
-#if ENABLE(VIDEO) && USE(GSTREAMER)
+#if ENABLE(GLIB_SUPPORT)
- (void)_scheduleGlibContextIterations;
#endif