diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
| commit | 8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch) | |
| tree | 17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit/mac/WebView/WebView.mm | |
| parent | b9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff) | |
| download | qtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz | |
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well
as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit/mac/WebView/WebView.mm')
| -rw-r--r-- | Source/WebKit/mac/WebView/WebView.mm | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm index 457d4062a..2aae548eb 100644 --- a/Source/WebKit/mac/WebView/WebView.mm +++ b/Source/WebKit/mac/WebView/WebView.mm @@ -682,7 +682,7 @@ static NSString *leakMailQuirksUserScriptContents() { static NSString *mailQuirksScriptContents = leakMailQuirksUserScriptContents(); core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), - mailQuirksScriptContents, KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInAllFrames); + mailQuirksScriptContents, KURL(), Vector<String>(), Vector<String>(), InjectAtDocumentEnd, InjectInAllFrames); } static bool needsOutlookQuirksScript() @@ -703,7 +703,7 @@ static NSString *leakOutlookQuirksUserScriptContents() { static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents(); core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), - outlookQuirksScriptContents, KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInAllFrames); + outlookQuirksScriptContents, KURL(), Vector<String>(), Vector<String>(), InjectAtDocumentEnd, InjectInAllFrames); } static bool shouldRespectPriorityInCSSAttributeSetters() @@ -1580,6 +1580,8 @@ static bool needsSelfRetainWhileLoadingQuirk() break; } + settings->setPlugInSnapshottingEnabled([preferences plugInSnapshottingEnabled]); + // We have enabled this setting in WebKit2 for the sake of some ScrollingCoordinator work. // To avoid possible rendering differences, we should enable it for WebKit1 too. settings->setFixedPositionCreatesStackingContext(true); @@ -2120,12 +2122,12 @@ static inline IMP getMethod(id o, SEL s) if (!mainFrame) return nil; - const Vector<DashboardRegionValue>& regions = mainFrame->document()->dashboardRegions(); + const Vector<AnnotatedRegionValue>& regions = mainFrame->document()->annotatedRegions(); size_t size = regions.size(); NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:size]; for (size_t i = 0; i < size; i++) { - const DashboardRegionValue& region = regions[i]; + const AnnotatedRegionValue& region = regions[i]; if (region.type == StyleDashboardRegion::None) continue; @@ -2625,19 +2627,20 @@ static inline IMP getMethod(id o, SEL s) _private->page->focusController()->setActive([[self window] _hasKeyAppearance]); } -static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) +static Vector<String> toStringVector(NSArray* patterns) { - // Convert the patterns into Vectors. + Vector<String> patternsVector; + NSUInteger count = [patterns count]; - if (count == 0) - return nullptr; - OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>); + if (!count) + return patternsVector; + for (NSUInteger i = 0; i < count; ++i) { id entry = [patterns objectAtIndex:i]; if ([entry isKindOfClass:[NSString class]]) - patternsVector->append(String((NSString*)entry)); + patternsVector.append(String((NSString *)entry)); } - return patternsVector.release(); + return patternsVector; } + (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url @@ -3053,6 +3056,15 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) ResourceRequest::setHTTPPipeliningEnabled(enabled); } +- (void)_setVisibilityState:(int)visibilityState isInitialState:(BOOL)isInitialState +{ +#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING) + if (_private->page) { + _private->page->setVisibilityState(static_cast<PageVisibilityState>(visibilityState), isInitialState); + } +#endif +} + @end @implementation _WebSafeForwarder @@ -3114,6 +3126,8 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled]; grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled]; + Font::setDefaultTypesettingFeatures([[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitKerningAndLigaturesEnabledByDefault"] ? Kerning | Ligatures : 0); + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 automaticQuoteSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticQuoteSubstitutionEnabled]; automaticLinkDetectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticLinkDetectionEnabled]; @@ -6297,11 +6311,11 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num) _private->needsOneShotDrawingSynchronization = needsSynchronization; } -- (BOOL)_syncCompositingChanges +- (BOOL)_flushCompositingChanges { Frame* frame = [self _mainCoreFrame]; if (frame && frame->view()) - return frame->view()->syncCompositingStateIncludingSubframes(); + return frame->view()->flushCompositingStateIncludingSubframes(); return YES; } @@ -6329,14 +6343,14 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num) To fix this, the GraphicsLayerCA code in WebCore does not change the CA layer tree during style changes and layout; it stores up all changes and - commits them via syncCompositingState(). There are then two situations in - which we can call syncCompositingState(): + commits them via flushCompositingState(). There are then two situations in + which we can call flushCompositingState(): - 1. When painting. FrameView::paintContents() makes a call to syncCompositingState(). + 1. When painting. FrameView::paintContents() makes a call to flushCompositingState(). 2. When style changes/layout have made changes to the layer tree which do not result in painting. In this case we need a run loop observer to do a - syncCompositingState() at an appropriate time. The observer will keep firing + flushCompositingState() at an appropriate time. The observer will keep firing until the time is right (essentially when there are no more pending layouts). */ @@ -6358,7 +6372,7 @@ bool LayerFlushController::flushLayers() if (viewsNeedDisplay) return false; - if ([m_webView _syncCompositingChanges]) { + if ([m_webView _flushCompositingChanges]) { // AppKit may have disabled screen updates, thinking an upcoming window flush will re-enable them. // In case setNeedsDisplayInRect() has prevented the window from needing to be flushed, re-enable screen // updates here. @@ -6375,7 +6389,7 @@ bool LayerFlushController::flushLayers() return false; } -- (void)_scheduleCompositingLayerSync +- (void)_scheduleCompositingLayerFlush { if (!_private->layerFlushController) _private->layerFlushController = LayerFlushController::create(self); @@ -6431,7 +6445,7 @@ bool LayerFlushController::flushLayers() if (![[WebPreferences standardPreferences] fullScreenEnabled]) return NO; - return YES; + return !withKeyboard; } - (void)_enterFullScreenForElement:(WebCore::Element*)element |
