Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (161469 => 161470)
--- trunk/Source/WebKit/mac/ChangeLog 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/ChangeLog 2014-01-08 00:42:20 UTC (rev 161470)
@@ -1,5 +1,44 @@
2014-01-02 Andy Estes <[email protected]>
+ [iOS] Upstream WebKit support for various features
+ https://bugs.webkit.org/show_bug.cgi?id=126413
+
+ Reviewed by Sam Weinig.
+
+ Upstream iOS WebKit changes needed for these features:
+
+ - ENABLE(DELETION_UI)
+ - ENABLE(TOUCH_EVENTS)
+ - USE(QUICK_LOOK)
+ - USE(UIKIT_EDITING)
+ - ENABLE(DISK_IMAGE_CACHE)
+ - ENABLE(IOS_TEXT_AUTOSIZING)
+ - ENABLE(ICONDATABASE)
+ - ENABLE(DASHBOARD_SUPPORT)
+
+ * DefaultDelegates/WebDefaultEditingDelegate.m:
+ * Misc/WebCache.mm:
+ * WebCoreSupport/WebChromeClient.h:
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource dealloc]):
+ * WebView/WebEditingDelegatePrivate.h:
+ * WebView/WebFrame.mm:
+ (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView maintainsInactiveSelection]):
+ (-[WebHTMLView touch:]):
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+ (-[WebView _cacheFrameLoadDelegateImplementations]):
+ (-[WebView quickLookContentForURL:]):
+ (-[WebView _touchEventRegions]):
+ * WebView/WebViewPrivate.h:
+
+2014-01-02 Andy Estes <[email protected]>
+
[iOS] Upstream a bug fix for plugin-backed media elements
https://bugs.webkit.org/show_bug.cgi?id=126412
Modified: trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultEditingDelegate.m (161469 => 161470)
--- trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultEditingDelegate.m 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultEditingDelegate.m 2014-01-08 00:42:20 UTC (rev 161470)
@@ -45,10 +45,12 @@
return sharedDelegate;
}
+#if ENABLE(DELETION_UI)
- (BOOL)webView:(WebView *)webView shouldShowDeleteInterfaceForElement:(DOMHTMLElement *)element
{
return NO;
}
+#endif
- (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range
{
Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/Misc/WebCache.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -47,6 +47,10 @@
#import <WebCore/WebCoreThreadRun.h>
#endif
+#if ENABLE(CACHE_PARTITIONING)
+#import <WebCore/Document.h>
+#endif
+
@implementation WebCache
+ (void)initialize
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (161469 => 161470)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h 2014-01-08 00:42:20 UTC (rev 161470)
@@ -152,6 +152,10 @@
virtual void enableSuddenTermination() OVERRIDE;
virtual void disableSuddenTermination() OVERRIDE;
+#if ENABLE(TOUCH_EVENTS)
+ virtual void needTouchEvents(bool) OVERRIDE { }
+#endif
+
virtual bool shouldReplaceWithGeneratedFileForUpload(const WTF::String& path, WTF::String &generatedFilename) OVERRIDE;
virtual WTF::String generateReplacementFile(const WTF::String& path) OVERRIDE;
Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -488,6 +488,12 @@
}
}
#endif
+
+#if USE(QUICK_LOOK)
+ // Added in -[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:].
+ if (NSURL *url = "" response] URL])
+ removeQLPreviewConverterForURL(url);
+#endif
delete toPrivate(_private);
Modified: trunk/Source/WebKit/mac/WebView/WebEditingDelegatePrivate.h (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebEditingDelegatePrivate.h 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebEditingDelegatePrivate.h 2014-01-08 00:42:20 UTC (rev 161470)
@@ -31,8 +31,8 @@
@class DOMHTMLElement;
@interface NSObject (WebViewEditingDelegatePrivate)
+#if !TARGET_OS_IPHONE
- (BOOL)webView:(WebView *)webView shouldShowDeleteInterfaceForElement:(DOMHTMLElement *)element;
-#if !TARGET_OS_IPHONE
- (void)webView:(WebView *)webView didWriteSelectionToPasteboard:(NSPasteboard *)pasteboard;
#else
- (NSArray *)supportedPasteboardTypesForCurrentSelection;
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -126,6 +126,11 @@
#import <WebCore/WebCoreThreadRun.h>
#endif
+#if USE(QUICK_LOOK)
+#import <WebCore/QuickLook.h>
+#import <WebCore/WebCoreURLResponseIOS.h>
+#endif
+
using namespace WebCore;
using namespace HTMLNames;
@@ -2431,6 +2436,19 @@
responseURL = createUniqueWebDataURL();
}
+#if USE(QUICK_LOOK)
+ if (shouldUseQuickLookForMIMEType(MIMEType)) {
+ URL qlURL = responseURL;
+ if (qlURL.isEmpty())
+ qlURL = [baseURL absoluteURL];
+ OwnPtr<ResourceRequest> qlRequest(registerQLPreviewConverterIfNeeded((NSURL *)qlURL, MIMEType, data));
+ if (qlRequest) {
+ _private->coreFrame->loader().load(FrameLoadRequest(_private->coreFrame, *qlRequest));
+ return;
+ }
+ }
+#endif // USE(QUICK_LOOK)
+
ResourceRequest request([baseURL absoluteURL]);
#if !PLATFORM(IOS)
Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -3052,6 +3052,17 @@
- (BOOL)maintainsInactiveSelection
{
+#if USE(UIKIT_EDITING)
+ // We want to maintain an inactive selection, when in editable content.
+ if ([[self _webView] maintainsInactiveSelection])
+ return YES;
+
+ if ([[self window] _newFirstResponderAfterResigning] == self)
+ return YES;
+
+ Frame* coreFrame = core([self _frame]);
+ return coreFrame && coreFrame->selection().isContentEditable();
+#else
// This method helps to determine whether the WebHTMLView should maintain
// an inactive selection when it's not first responder.
// Traditionally, these views have not maintained such selections,
@@ -3086,6 +3097,7 @@
&& [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]];
return selectionIsEditable && nextResponderIsInWebView;
+#endif
}
#if !PLATFORM(IOS)
@@ -3953,6 +3965,18 @@
_private->handlingMouseDownEvent = NO;
}
+#if ENABLE(TOUCH_EVENTS)
+- (void)touch:(WebEvent *)event
+{
+ RetainPtr<WebHTMLView> protector = self;
+
+ // Let WebCore get a chance to deal with the event. This will call back to us
+ // to start the autoscroll timer if appropriate.
+ if (Frame* coreframe = core([self _frame]))
+ coreframe->eventHandler().touchEvent(event);
+}
+#endif
+
#if ENABLE(DRAG_SUPPORT)
- (void)dragImage:(NSImage *)dragImage
at:(NSPoint)at
Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -557,6 +557,11 @@
[NSNumber numberWithBool:NO], WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
@"", WebKitNetworkInterfaceNamePreferenceKey,
#endif
+#if ENABLE(DISK_IMAGE_CACHE)
+ [NSNumber numberWithBool:YES], WebKitDiskImageCacheEnabledPreferenceKey,
+ [NSNumber numberWithUnsignedInt:(100 * 1024)], WebKitDiskImageCacheMinimumImageSizePreferenceKey,
+ [NSNumber numberWithUnsignedInt:(100 * 1024 * 1024)], WebKitDiskImageCacheMaximumCacheSizePreferenceKey,
+#endif
#if ENABLE(IOS_TEXT_AUTOSIZING)
[NSNumber numberWithFloat:WKGetMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
#endif
Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2014-01-08 00:42:20 UTC (rev 161470)
@@ -268,6 +268,21 @@
- (void)setNetworkInterfaceName:(NSString *)name;
- (NSString *)networkInterfaceName;
+- (void)_setMinimumZoomFontSize:(float)size;
+- (float)_minimumZoomFontSize;
+
+- (BOOL)diskImageCacheEnabled;
+- (void)setDiskImageCacheEnabled:(BOOL)enabled;
+
+- (unsigned)diskImageCacheMinimumImageSize;
+- (void)setDiskImageCacheMinimumImageSize:(unsigned)minimumSize;
+
+- (unsigned)diskImageCacheMaximumCacheSize;
+- (void)setDiskImageCacheMaximumCacheSize:(unsigned)maximumSize;
+
+- (NSString *)_diskImageCacheSavedCacheDirectory;
+- (void)_setDiskImageCacheSavedCacheDirectory:(NSString *)path;
+
- (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag;
- (BOOL)mediaPlaybackAllowsAirPlay;
#endif
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2014-01-08 00:42:20 UTC (rev 161470)
@@ -263,6 +263,19 @@
#import <glib.h>
#endif
+#if USE(QUICK_LOOK)
+#include <WebCore/QuickLook.h>
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+#import <WebCore/WebEventRegion.h>
+#endif
+
+#if ENABLE(DISK_IMAGE_CACHE)
+#import "WebDiskImageCacheClientIOS.h"
+#import <WebCore/DiskImageCacheIOS.h>
+#endif
+
#if !PLATFORM(IOS)
@interface NSSpellChecker (WebNSSpellCheckerDetails)
- (void)_preflightChosenSpellServer;
@@ -587,6 +600,11 @@
NSString *_WebMainFrameDocumentKey = @"mainFrameDocument";
#endif
+#if USE(QUICK_LOOK)
+NSString *WebQuickLookFileNameKey = @"WebQuickLookFileNameKey";
+NSString *WebQuickLookUTIKey = @"WebQuickLookUTIKey";
+#endif
+
NSString *_WebViewDidStartAcceleratedCompositingNotification = @"_WebViewDidStartAcceleratedCompositing";
NSString * const WebViewWillCloseNotification = @"WebViewWillCloseNotification";
@@ -2476,6 +2494,10 @@
if (_private->zoomsTextOnly != zoomsTextOnly)
[self _setZoomMultiplier:_private->zoomMultiplier isTextOnly:zoomsTextOnly];
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+ settings.setMinimumZoomFontSize([preferences _minimumZoomFontSize]);
+#endif
+
#if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
DiskImageCache& diskImageCache = WebCore::diskImageCache();
diskImageCache.setEnabled([preferences diskImageCacheEnabled]);
@@ -2588,7 +2610,9 @@
cache->didFirstVisuallyNonEmptyLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:));
cache->didLayoutFunc = getMethod(delegate, @selector(webView:didLayout:));
cache->didHandleOnloadEventsForFrameFunc = getMethod(delegate, @selector(webView:didHandleOnloadEventsForFrame:));
+#if ENABLE(ICONDATABASE)
cache->didReceiveIconForFrameFunc = getMethod(delegate, @selector(webView:didReceiveIcon:forFrame:));
+#endif
cache->didReceiveServerRedirectForProvisionalLoadForFrameFunc = getMethod(delegate, @selector(webView:didReceiveServerRedirectForProvisionalLoadForFrame:));
cache->didReceiveTitleForFrameFunc = getMethod(delegate, @selector(webView:didReceiveTitle:forFrame:));
cache->didStartProvisionalLoadForFrameFunc = getMethod(delegate, @selector(webView:didStartProvisionalLoadForFrame:));
@@ -3597,6 +3621,21 @@
return _private->page->setDefersLoading(defer);
}
+#if USE(QUICK_LOOK)
+- (NSDictionary *)quickLookContentForURL:(NSURL *)url
+{
+ NSString *uti = qlPreviewConverterUTIForURL(url);
+ if (!uti)
+ return nil;
+
+ NSString *fileName = qlPreviewConverterFileNameForURL(url);
+ if (!fileName)
+ return nil;
+
+ return [NSDictionary dictionaryWithObjectsAndKeys: fileName, WebQuickLookFileNameKey, uti, WebQuickLookUTIKey, nil];
+}
+#endif
+
#if PLATFORM(IOS)
- (BOOL)_isStopping
{
@@ -3722,6 +3761,50 @@
}
#endif // PLATFORM(IOS)
+#if ENABLE(TOUCH_EVENTS)
+- (NSArray *)_touchEventRegions
+{
+ Frame* frame = [self _mainCoreFrame];
+ if (!frame)
+ return nil;
+
+ Document* document = frame->document();
+ if (!document)
+ return nil;
+
+ Vector<IntRect> rects;
+ document->getTouchRects(rects);
+
+ if (rects.size() == 0)
+ return nil;
+
+ NSMutableArray *eventRegionArray = [[[NSMutableArray alloc] initWithCapacity:rects.size()] autorelease];
+
+ Vector<IntRect>::const_iterator end = rects.end();
+ for (Vector<IntRect>::const_iterator it = rects.begin(); it != end; ++it) {
+ const IntRect& rect = *it;
+ if (rect.isEmpty())
+ continue;
+
+ // The event region wants this points in this order:
+ // p2------p3
+ // | |
+ // p1------p4
+ //
+ WebEventRegion *eventRegion = [[WebEventRegion alloc] initWithPoints:FloatPoint(rect.x(), rect.maxY())
+ :FloatPoint(rect.x(), rect.y())
+ :FloatPoint(rect.maxX(), rect.y())
+ :FloatPoint(rect.maxX(), rect.maxY())];
+ if (eventRegion) {
+ [eventRegionArray addObject:eventRegion];
+ [eventRegion release];
+ }
+ }
+
+ return eventRegionArray;
+}
+#endif // ENABLE(TOUCH_EVENTS)
+
// For backwards compatibility with the WebBackForwardList API, we honor both
// a per-WebView and a per-preferences setting for whether to use the page cache.
@@ -3766,11 +3849,13 @@
return [[[WebTextIterator alloc] initWithRange:kit(selectionInsideRect.toNormalizedRange().get())] autorelease];
}
+#if ENABLE(DASHBOARD_SUPPORT)
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
{
NSWindow *window = [self hostWindow] ? [self hostWindow] : [self window];
[[WebPanelAuthenticationHandler sharedHandler] startAuthentication:challenge window:window];
}
+#endif
#if !PLATFORM(IOS)
- (void)_clearUndoRedoOperations
Modified: trunk/Source/WebKit/mac/WebView/WebViewPrivate.h (161469 => 161470)
--- trunk/Source/WebKit/mac/WebView/WebViewPrivate.h 2014-01-08 00:42:18 UTC (rev 161469)
+++ trunk/Source/WebKit/mac/WebView/WebViewPrivate.h 2014-01-08 00:42:20 UTC (rev 161470)
@@ -101,6 +101,11 @@
extern NSString *_WebViewRemoteInspectorHasSessionChangedNotification;
#endif
+#if TARGET_OS_IPHONE
+extern NSString *WebQuickLookFileNameKey;
+extern NSString *WebQuickLookUTIKey;
+#endif
+
extern NSString * const WebViewWillCloseNotification;
#if ENABLE_DASHBOARD_SUPPORT
@@ -466,6 +471,10 @@
+ (void)_clearPrivateBrowsingSessionCookieStorage;
- (void)_replaceCurrentHistoryItem:(WebHistoryItem *)item;
+#endif // PLATFORM(IOS)
+
+#if TARGET_OS_IPHONE
+- (NSDictionary *)quickLookContentForURL:(NSURL *)url;
#endif
// May well become public