diff options
Diffstat (limited to 'WebKit/mac')
29 files changed, 783 insertions, 115 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 013780d..bb42e9d 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,237 @@ +2010-08-02 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + Add VisitedLinkStrategy for each platform to implement + https://bugs.webkit.org/show_bug.cgi?id=43393 + + * WebCoreSupport/WebPlatformStrategies.h: + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::createVisitedLinkStrategy): + (WebPlatformStrategies::isLinkVisited): Call back into PageGroup's visited links. + (WebPlatformStrategies::addVisitedLink): Ditto. + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::selectItemWritingDirectionIsNatural): + (WebChromeClient::createPopupMenu): + (WebChromeClient::createSearchPopupMenu): + +2010-08-02 Jeremy Orlow <jorlow@chromium.org> + + Speculative revert of 64425 due to Chromium instability + https://bugs.webkit.org/show_bug.cgi?id=43347 + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::selectItemWritingDirectionIsNatural): + (WebChromeClient::createPopupMenu): + (WebChromeClient::createSearchPopupMenu): + +2010-07-31 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r64422. + http://trac.webkit.org/changeset/64422 + https://bugs.webkit.org/show_bug.cgi?id=43304 + + Build fixes are needed for Snow Leopard and Windows. + (Requested by lca on #webkit). + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + +2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::selectItemWritingDirectionIsNatural): + (WebChromeClient::createPopupMenu): + (WebChromeClient::createSearchPopupMenu): + +2010-07-31 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/43300> Simplify variables in *.xcconfig files after adding iOS support + + Reviewed by Darin Adler. + + * Configurations/WebKit.xcconfig: Extracted + PRODUCTION_FRAMEWORKS_DIR and PRODUCTION_ROOT variables. + +2010-07-30 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + <rdar://problem/8257783> Short documents may print a second blank page + https://bugs.webkit.org/show_bug.cgi?id=43271 + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _web_setPrintingModeRecursive]): Updated for additional height parameter + to _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:. + (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. + (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. + (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): Added height parameter, + which is scaled and passed on to _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:. + (-[WebHTMLView _endPrintMode]): Updated for additional height parameter to + _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:. + (-[WebHTMLView layoutToMinimumPageWidth:height:maximumPageWidth:adjustingViewSize:]): Added + height parameter, which is passed on to FrameView::forceLayoutForPagination(). + (-[WebHTMLView layout]): Updated for additional height parameter. + (-[WebHTMLView _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:]): Added height + parameter, which is passed on to -layoutToMinimumPageWidth:height:maximumPageWidth:adjustViewSize:. + (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Updated for additional height + parameter. + (-[WebHTMLView setPageWidthForPrinting:]): Ditto. + (-[WebHTMLView knowsPageRange:]): Pass the available height on the page on to + _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize. + * WebView/WebHTMLViewPrivate.h: + +2010-07-30 Joseph Pecoraro <joepeck@webkit.org> + + Fix for tests that broke after r64400. Tracking a more + ideal solution in https://bugs.webkit.org/show_bug.cgi?id=40627 + + Switch the interface back to (unsigned long long), and move + the WebDatabaseSecurityOrigin implementation up into WebSecurityOrigin. + The subclasses' implementations were not getting called. + + * Storage/WebDatabaseSecurityOrigin.mm: + * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: + (-[WebApplicationCacheSecurityOrigin quota]): + (-[WebApplicationCacheSecurityOrigin setQuota:]): + * WebCoreSupport/WebSecurityOrigin.mm: + (-[WebSecurityOrigin usage]): + (-[WebSecurityOrigin quota]): + (-[WebSecurityOrigin setQuota:]): + * WebCoreSupport/WebSecurityOriginPrivate.h: + +2010-07-30 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 4 - Client Notification when the Quota is Reached + + Notify the WebKit client when the per-origin quota is reached + via a delegate method reachedApplicationCacheOriginQuota. + + Refactor the WebSecurityOrigin class to be generic enough to + allow quota management of both Databases or Application Caches + via subclasses. + + * Storage/WebDatabaseSecurityOrigin.h: Added. + * Storage/WebDatabaseSecurityOrigin.mm: Added. + (-[WebDatabaseSecurityOrigin quota]): + (-[WebDatabaseSecurityOrigin setQuota:]): + * WebCoreSupport/WebApplicationCacheSecurityOrigin.h: Added. + * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: Added. + (-[WebApplicationCacheSecurityOrigin quota]): + (-[WebApplicationCacheSecurityOrigin setQuota:]): + * Storage/WebSecurityOrigin.mm: Removed. (Moved to WebCoreSupport) + * Storage/WebSecurityOriginPrivate.h: Removed. (Moved to WebCoreSupport) + * WebCoreSupport/WebSecurityOrigin.mm: Added. + (-[WebSecurityOrigin usage]): to be implemented by subclasses. + (-[WebSecurityOrigin quota]): to be implemented by subclasses. + (-[WebSecurityOrigin setQuota:]): to be implemented by subclasses. + * WebCoreSupport/WebSecurityOriginInternal.h: Renamed from WebKit/mac/Storage/WebSecurityOriginInternal.h. + * WebCoreSupport/WebSecurityOriginPrivate.h: Added. + + Turn the notification into a WebUI Delegate to call. Following + the example of Databases. + + * DefaultDelegates/WebDefaultUIDelegate.m: + (-[WebDefaultUIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:]): + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::exceededDatabaseQuota): use the Databases Security Origin subclass. + (WebChromeClient::reachedApplicationCacheOriginQuota): use the Application Cache Security Origin subclass. + * WebView/WebUIDelegatePrivate.h: + +2010-07-30 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 1 - Add Total and Per-Origin Quota Preferences. + + Allow the application cache total size to be a preference, and + add a new preference for the default per-origin quota. + + Storage quotas were int64_t (long long). Boilerplate for + these types added for consistency. + + * Misc/WebNSDictionaryExtras.h: + * Misc/WebNSDictionaryExtras.m: + (-[NSMutableDictionary _webkit_setLongLong:forKey:]): + * WebCoreSupport/WebApplicationCache.h: setters and accessors for WebCore's cacheStorage. + * WebCoreSupport/WebApplicationCache.mm: + (+[WebApplicationCache maximumSize:]): + (+[WebApplicationCache setMaximumSize:]): + (+[WebApplicationCache defaultOriginQuota]): + (+[WebApplicationCache setDefaultOriginQuota:]): + * WebView/WebPreferenceKeysPrivate.h: + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): defaults to noQuota for both preferences. + (-[WebPreferences _longLongValueForKey:]): + (-[WebPreferences _setLongLongValue:forKey:]): + (-[WebPreferences applicationCacheTotalQuota]): + (-[WebPreferences setApplicationCacheTotalQuota:]): + (-[WebPreferences applicationCacheDefaultOriginQuota]): + (-[WebPreferences setApplicationCacheDefaultOriginQuota:]): + * WebView/WebPreferencesPrivate.h: + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): respect updates to the preferences. + +2010-07-30 Andy Estes <aestes@apple.com> + + Reviewed by David Kilzer. + + Add Xcode support for compiling WebKit against iOS SDKs. + https://bugs.webkit.org/show_bug.cgi?id=42796 + + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + * Configurations/FeatureDefines.xcconfig: + * Configurations/Version.xcconfig: + * Configurations/WebKit.xcconfig: + 2010-07-26 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. diff --git a/WebKit/mac/Configurations/Base.xcconfig b/WebKit/mac/Configurations/Base.xcconfig index 7914aed..b3f8ea6 100644 --- a/WebKit/mac/Configurations/Base.xcconfig +++ b/WebKit/mac/Configurations/Base.xcconfig @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Apple Inc. All rights reserved. +// Copyright (C) 2009, 2010 Apple Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -28,11 +28,15 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; -GCC_ENABLE_OBJC_GC = supported; +GCC_ENABLE_OBJC_GC = $(GCC_ENABLE_OBJC_GC_$(REAL_PLATFORM_NAME)); +GCC_ENABLE_OBJC_GC_iphoneos = NO; +GCC_ENABLE_OBJC_GC_iphonesimulator = NO; +GCC_ENABLE_OBJC_GC_macosx = supported; GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; -GCC_MODEL_TUNING = G5; +GCC_MODEL_TUNING = $(GCC_MODEL_TUNING_$(REAL_PLATFORM_NAME)); +GCC_MODEL_TUNING_macosx = G5; GCC_OBJC_CALL_CXX_CDTORS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_THREADSAFE_STATICS = NO; @@ -44,13 +48,22 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; LINKER_DISPLAYS_MANGLED_NAMES = YES; OTHER_MIGFLAGS = -F$(BUILT_PRODUCTS_DIR); PREBINDING = NO; -VALID_ARCHS = i386 ppc x86_64 ppc64; +VALID_ARCHS = $(VALID_ARCHS_$(REAL_PLATFORM_NAME)); +VALID_ARCHS_iphoneos = $(ARCHS_STANDARD_32_BIT); +VALID_ARCHS_iphonesimulator = $(ARCHS_STANDARD_32_BIT); +VALID_ARCHS_macosx = i386 ppc x86_64 ppc64; // FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32 -WARNING_CFLAGS = -Wall -Wextra -Wcast-align -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings; +WARNING_CFLAGS_BASE = -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings; +WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME)); +WARNING_CFLAGS_iphoneos = $(WARNING_CFLAGS_BASE); +WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE) -Wcast-align; +WARNING_CFLAGS_macosx = $(WARNING_CFLAGS_BASE) -Wcast-align; REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); +REAL_PLATFORM_NAME_iphoneos = iphoneos; +REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator; REAL_PLATFORM_NAME_macosx = macosx; TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); @@ -80,15 +93,18 @@ SECTORDER_FLAGS = -sectorder __TEXT __text mac/WebKit.order; // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version // number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and // XCODE_VERSION_ACTUAL for the full version number. -TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040); -TARGET_GCC_VERSION_1040 = GCC_40; -TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR)); -TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); -TARGET_GCC_VERSION_1050_0310 = GCC_42; -TARGET_GCC_VERSION_1050_0320 = GCC_42; -TARGET_GCC_VERSION_1060 = GCC_42; -TARGET_GCC_VERSION_1070 = LLVM_GCC_42; +TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME)); +TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42; +TARGET_GCC_VERSION_iphonesimulator = GCC_42; +TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +TARGET_GCC_VERSION_macosx_ = $(TARGET_GCC_VERSION_macosx_1040); +TARGET_GCC_VERSION_macosx_1040 = GCC_40; +TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR)); +TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL)); +TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42; +TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42; +TARGET_GCC_VERSION_macosx_1060 = GCC_42; +TARGET_GCC_VERSION_macosx_1070 = LLVM_GCC_42; GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); GCC_VERSION_GCC_40 = 4.0; diff --git a/WebKit/mac/Configurations/DebugRelease.xcconfig b/WebKit/mac/Configurations/DebugRelease.xcconfig index 77f7893..5a86e25 100644 --- a/WebKit/mac/Configurations/DebugRelease.xcconfig +++ b/WebKit/mac/Configurations/DebugRelease.xcconfig @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Apple Inc. All rights reserved. +// Copyright (C) 2009, 2010 Apple Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -23,29 +23,38 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ARCHS_ = $(ARCHS_1040); -ARCHS_1040 = $(NATIVE_ARCH); -ARCHS_1050 = $(NATIVE_ARCH); -ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS = $(ARCHS_$(REAL_PLATFORM_NAME)); +ARCHS_iphoneos = $(ARCHS_STANDARD_32_BIT); +ARCHS_iphonesimulator = $(ARCHS_STANDARD_32_BIT); +ARCHS_macosx = $(ARCHS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ARCHS_macosx_ = $(ARCHS_macosx_1040); +ARCHS_macosx_1040 = $(NATIVE_ARCH); +ARCHS_macosx_1050 = $(NATIVE_ARCH); +ARCHS_macosx_1060 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS_macosx_1070 = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; -MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -MACOSX_DEPLOYMENT_TARGET_ = 10.4; -MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; -MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; -MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; -MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; +MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(REAL_PLATFORM_NAME)); +MACOSX_DEPLOYMENT_TARGET_iphoneos = 10.5; +MACOSX_DEPLOYMENT_TARGET_iphonesimulator = 10.5; +MACOSX_DEPLOYMENT_TARGET_macosx = $(MACOSX_DEPLOYMENT_TARGET_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +MACOSX_DEPLOYMENT_TARGET_macosx_ = 10.4; +MACOSX_DEPLOYMENT_TARGET_macosx_1040 = 10.4; +MACOSX_DEPLOYMENT_TARGET_macosx_1050 = 10.5; +MACOSX_DEPLOYMENT_TARGET_macosx_1060 = 10.6; +MACOSX_DEPLOYMENT_TARGET_macosx_1070 = 10.7; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; SECTORDER_FLAGS = ; -WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -WEBKIT_SYSTEM_INTERFACE_LIBRARY_ = WebKitSystemInterfaceTiger; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_1040 = WebKitSystemInterfaceTiger; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_1050 = WebKitSystemInterfaceLeopard; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_1060 = WebKitSystemInterfaceSnowLeopard; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_1070 = WebKitSystemInterfaceSnowLeopard; +WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(REAL_PLATFORM_NAME)); +WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos = WebKitSystemInterface; +WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphonesimulator = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos); +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_ = WebKitSystemInterfaceTiger; +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1040 = WebKitSystemInterfaceTiger; +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1050 = WebKitSystemInterfaceLeopard; +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1060 = WebKitSystemInterfaceSnowLeopard; +WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1070 = WebKitSystemInterfaceSnowLeopard; diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 8e33a91..9810cf7 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Apple Inc. All rights reserved. +// Copyright (C) 2009, 2010 Apple Inc. All rights reserved. // Copyright (C) 2009 Google Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -33,31 +33,52 @@ ENABLE_LINK_PREFETCH = ; -ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS; -ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS; +ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(REAL_PLATFORM_NAME)); +ENABLE_3D_CANVAS_macosx = $(ENABLE_3D_CANVAS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_CANVAS_macosx_1060 = ENABLE_3D_CANVAS; +ENABLE_3D_CANVAS_macosx_1070 = ENABLE_3D_CANVAS; -ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING; -ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING; -ENABLE_3D_RENDERING_1070 = ENABLE_3D_RENDERING; +ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(REAL_PLATFORM_NAME)); +ENABLE_3D_RENDERING_iphoneos = ENABLE_3D_RENDERING; +ENABLE_3D_RENDERING_iphonesimulator = $(ENABLE_3D_RENDERING_iphoneos); +ENABLE_3D_RENDERING_macosx = $(ENABLE_3D_RENDERING_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_RENDERING_macosx_1050 = ENABLE_3D_RENDERING; +ENABLE_3D_RENDERING_macosx_1060 = ENABLE_3D_RENDERING; +ENABLE_3D_RENDERING_macosx_1070 = ENABLE_3D_RENDERING; + +ENABLE_BLOB_SLICE = $(ENABLE_BLOB_SLICE_$(REAL_PLATFORM_NAME)); +ENABLE_BLOB_SLICE_macosx = ENABLE_BLOB_SLICE; + +ENABLE_CHANNEL_MESSAGING = $(ENABLE_CHANNEL_MESSAGING_$(REAL_PLATFORM_NAME)); +ENABLE_CHANNEL_MESSAGING_macosx = ENABLE_CHANNEL_MESSAGING; + +ENABLE_CLIENT_BASED_GEOLOCATION = $(ENABLE_CLIENT_BASED_GEOLOCATION_$(REAL_PLATFORM_NAME)); +ENABLE_CLIENT_BASED_GEOLOCATION_macosx = ENABLE_CLIENT_BASED_GEOLOCATION; -ENABLE_BLOB_SLICE = ENABLE_BLOB_SLICE; -ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING; -ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION; ENABLE_DATABASE = ENABLE_DATABASE; ENABLE_DATAGRID = ; -ENABLE_DATALIST = ENABLE_DATALIST; + +ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME)); +ENABLE_DATALIST_macosx = ENABLE_DATALIST; + ENABLE_DEVICE_ORIENTATION = ; ENABLE_DIRECTORY_UPLOAD = ; ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; -ENABLE_FILTERS = ENABLE_FILTERS; -ENABLE_FILE_READER = ENABLE_FILE_READER; + +ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME)); +ENABLE_FILTERS_macosx = ENABLE_FILTERS; + +ENABLE_FILE_READER = $(ENABLE_FILE_READER_$(REAL_PLATFORM_NAME)); +ENABLE_FILE_READER_macosx = ENABLE_FILE_READER; + ENABLE_FILE_WRITER = ; ENABLE_FILE_SYSTEM = ; ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; -ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; + +ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME)); +ENABLE_ICONDATABASE_macosx = ENABLE_ICONDATABASE; + ENABLE_IMAGE_RESIZER = ; ENABLE_INDEXED_DATABASE = ; ENABLE_INPUT_SPEECH = ; @@ -67,21 +88,37 @@ ENABLE_METER_TAG = ENABLE_METER_TAG; ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG; -ENABLE_RUBY = ENABLE_RUBY; -ENABLE_SANDBOX = ENABLE_SANDBOX; -ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS; + +ENABLE_RUBY = $(ENABLE_RUBY_$(REAL_PLATFORM_NAME)); +ENABLE_RUBY_macosx = ENABLE_RUBY; + +ENABLE_SANDBOX = $(ENABLE_SANDBOX_$(REAL_PLATFORM_NAME)); +ENABLE_SANDBOX_macosx = ENABLE_SANDBOX; + +ENABLE_SHARED_WORKERS = $(ENABLE_SHARED_WORKERS_$(REAL_PLATFORM_NAME)); +ENABLE_SHARED_WORKERS_macosx = ENABLE_SHARED_WORKERS; + ENABLE_SVG = ENABLE_SVG; ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION; ENABLE_SVG_AS_IMAGE = ENABLE_SVG_AS_IMAGE; -ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS; + +ENABLE_SVG_DOM_OBJC_BINDINGS = $(ENABLE_SVG_DOM_OBJC_BINDINGS_$(REAL_PLATFORM_NAME)); +ENABLE_SVG_DOM_OBJC_BINDINGS_macosx = ENABLE_SVG_DOM_OBJC_BINDINGS; + ENABLE_SVG_FONTS = ENABLE_SVG_FONTS; ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT; ENABLE_SVG_USE = ENABLE_SVG_USE; ENABLE_VIDEO = ENABLE_VIDEO; -ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS; + +ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME)); +ENABLE_WEB_SOCKETS_macosx = ENABLE_WEB_SOCKETS; + ENABLE_WEB_TIMING = ; ENABLE_WML = ; -ENABLE_WORKERS = ENABLE_WORKERS; + +ENABLE_WORKERS = $(ENABLE_WORKERS_$(REAL_PLATFORM_NAME)); +ENABLE_WORKERS_macosx = ENABLE_WORKERS; + ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index c1b6b32..cc30ce9 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Apple Inc. All rights reserved. +// Copyright (C) 2009, 2010 Apple Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 4; +MINOR_VERSION = 5; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); @@ -31,12 +31,15 @@ BUNDLE_VERSION = $(BUNDLE_VERSION_$(CONFIGURATION)); SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION)) // The system version prefix is based on the current system version. -SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR. -SYSTEM_VERSION_PREFIX_1040 = 4; -SYSTEM_VERSION_PREFIX_1050 = 5; -SYSTEM_VERSION_PREFIX_1060 = 6; -SYSTEM_VERSION_PREFIX_1070 = 7; +SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(REAL_PLATFORM_NAME)); +SYSTEM_VERSION_PREFIX_iphoneos = 6; // iPhone OS is most like SnowLeopard currently. +SYSTEM_VERSION_PREFIX_iphonesimulator = $(SYSTEM_VERSION_PREFIX_iphoneos); +SYSTEM_VERSION_PREFIX_macosx = $(SYSTEM_VERSION_PREFIX_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +SYSTEM_VERSION_PREFIX_macosx_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR. +SYSTEM_VERSION_PREFIX_macosx_1040 = 4; +SYSTEM_VERSION_PREFIX_macosx_1050 = 5; +SYSTEM_VERSION_PREFIX_macosx_1060 = 6; +SYSTEM_VERSION_PREFIX_macosx_1070 = 7; // The production build always uses the full version with a system version prefix. BUNDLE_VERSION_Production = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION); diff --git a/WebKit/mac/Configurations/WebKit.xcconfig b/WebKit/mac/Configurations/WebKit.xcconfig index b9dbc87..def76fd 100644 --- a/WebKit/mac/Configurations/WebKit.xcconfig +++ b/WebKit/mac/Configurations/WebKit.xcconfig @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Apple Inc. All rights reserved. +// Copyright (C) 2009, 2010 Apple Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -24,26 +24,66 @@ #include "FeatureDefines.xcconfig" #include "Version.xcconfig" +EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(REAL_PLATFORM_NAME)); +EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.nib *.tiff; +EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos); + EXPORTED_SYMBOLS_FILE = $(EXPORTED_SYMBOLS_FILE_$(CURRENT_ARCH)); EXPORTED_SYMBOLS_FILE_ = mac/WebKit.exp; +EXPORTED_SYMBOLS_FILE_armv5 = mac/WebKit.exp; +EXPORTED_SYMBOLS_FILE_armv6 = mac/WebKit.exp; +EXPORTED_SYMBOLS_FILE_armv7 = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_i386 = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_ppc = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_ppc64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp; EXPORTED_SYMBOLS_FILE_x86_64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp; -FRAMEWORK_SEARCH_PATHS = $(UMBRELLA_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS); + +FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(REAL_PLATFORM_NAME)); +FRAMEWORK_SEARCH_PATHS_iphoneos = $(FRAMEWORK_SEARCH_PATHS_iphoneos_$(CONFIGURATION)); +FRAMEWORK_SEARCH_PATHS_iphoneos_Debug = $(BUILT_PRODUCTS_DIR) $(PRODUCTION_FRAMEWORKS_DIR); +FRAMEWORK_SEARCH_PATHS_iphoneos_Release = $(FRAMEWORK_SEARCH_PATHS_iphoneos_Debug); +FRAMEWORK_SEARCH_PATHS_iphoneos_Production = $(PRODUCTION_FRAMEWORKS_DIR); +FRAMEWORK_SEARCH_PATHS_iphonesimulator = $(FRAMEWORK_SEARCH_PATHS_iphoneos_$(CONFIGURATION)); +FRAMEWORK_SEARCH_PATHS_macosx = $(UMBRELLA_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS); + GCC_PREFIX_HEADER = mac/WebKitPrefix.h; GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) FRAMEWORK_NAME=WebKit WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS); -HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" $(HEADER_SEARCH_PATHS); +HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu $(WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH) "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" $(HEADER_SEARCH_PATHS); INFOPLIST_FILE = mac/Info.plist; -INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/Frameworks; +INSTALL_PATH = $(INSTALL_PATH_$(REAL_PLATFORM_NAME)); +INSTALL_PATH_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks; INSTALLHDRS_COPY_PHASE = YES; INSTALLHDRS_SCRIPT_PHASE = YES; PRODUCT_NAME = WebKit; -UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks; -OTHER_LDFLAGS = -sub_umbrella WebCore $(OTHER_LDFLAGS); +UMBRELLA_FRAMEWORKS_DIR = $(PRODUCTION_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Frameworks; + +OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(REAL_PLATFORM_NAME)); +OTHER_LDFLAGS_iphoneos = -lobjc -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework Foundation -framework GraphicsServices -framework ImageIO -framework WebCore; +OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos); +OTHER_LDFLAGS_macosx = -sub_umbrella WebCore $(OTHER_LDFLAGS); -WEBCORE_PRIVATE_HEADERS_DIR = $(WEBCORE_PRIVATE_HEADERS_DIR_$(REAL_PLATFORM_NAME)_$(CONFIGURATION)); -WEBCORE_PRIVATE_HEADERS_DIR_macosx_Release = $(WEBCORE_PRIVATE_HEADERS_engineering); -WEBCORE_PRIVATE_HEADERS_DIR_macosx_Debug = $(WEBCORE_PRIVATE_HEADERS_engineering); -WEBCORE_PRIVATE_HEADERS_DIR_macosx_Production = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders; +PRODUCTION_FRAMEWORKS_DIR = $(PRODUCTION_FRAMEWORKS_DIR_$(REAL_PLATFORM_NAME)); +PRODUCTION_FRAMEWORKS_DIR_iphoneos = $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks; +PRODUCTION_FRAMEWORKS_DIR_iphonesimulator = $(PRODUCTION_FRAMEWORKS_DIR_iphoneos); +PRODUCTION_FRAMEWORKS_DIR_macosx = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks; + +PRODUCTION_ROOT = $(PRODUCTION_ROOT_$(REAL_PLATORM_NAME)); +PRODUCTION_ROOT_iphoneos = $(SDKROOT); +PRODUCTION_ROOT_iphonesimulator = $(SDKROOT); +PRODUCTION_ROOT_macosx = $(NEXT_ROOT); + +WEBCORE_PRIVATE_HEADERS_DIR = $(WEBCORE_PRIVATE_HEADERS_DIR_$(CONFIGURATION)); +WEBCORE_PRIVATE_HEADERS_DIR_Release = $(WEBCORE_PRIVATE_HEADERS_engineering); +WEBCORE_PRIVATE_HEADERS_DIR_Debug = $(WEBCORE_PRIVATE_HEADERS_engineering); +WEBCORE_PRIVATE_HEADERS_DIR_Production = $(WEBCORE_PRIVATE_HEADERS_DIR_Production_$(REAL_PLATFORM_NAME)); +WEBCORE_PRIVATE_HEADERS_DIR_Production_iphoneos = $(PRODUCTION_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders; +WEBCORE_PRIVATE_HEADERS_DIR_Production_iphonesimulator = $(WEBCORE_PRIVATE_HEADERS_DIR_Production_iphoneos); +WEBCORE_PRIVATE_HEADERS_DIR_Production_macosx = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders; WEBCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders; + +WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH = $(WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_$(CONFIGURATION)); +WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_Debug = $(WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_engineering); +WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_Release = $(WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_engineering); +WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_Production = $(PRODUCTION_ROOT)/usr/local/include; +WEBKITSYSTEMINTERFACE_STATIC_LIBRARY_HEADERS_FOLDER_PATH_engineering = $(BUILT_PRODUCTS_DIR)/usr/local/include; + diff --git a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m index 68fa05e..a327fd4 100644 --- a/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m +++ b/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m @@ -227,6 +227,10 @@ static WebDefaultUIDelegate *sharedDelegate = nil; { } +- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin +{ +} + - (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename { return NO; diff --git a/WebKit/mac/Misc/WebNSDictionaryExtras.h b/WebKit/mac/Misc/WebNSDictionaryExtras.h index 95445f8..0bbc5d5 100644 --- a/WebKit/mac/Misc/WebNSDictionaryExtras.h +++ b/WebKit/mac/Misc/WebNSDictionaryExtras.h @@ -43,5 +43,6 @@ - (void)_webkit_setInt:(int)value forKey:(id)key; - (void)_webkit_setFloat:(float)value forKey:(id)key; - (void)_webkit_setBool:(BOOL)value forKey:(id)key; +- (void)_webkit_setLongLong:(long long)value forKey:(id)key; - (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key; @end diff --git a/WebKit/mac/Misc/WebNSDictionaryExtras.m b/WebKit/mac/Misc/WebNSDictionaryExtras.m index a47fd0b..366f361 100644 --- a/WebKit/mac/Misc/WebNSDictionaryExtras.m +++ b/WebKit/mac/Misc/WebNSDictionaryExtras.m @@ -108,6 +108,13 @@ [object release]; } +- (void)_webkit_setLongLong:(long long)value forKey:(id)key +{ + NSNumber *object = [[NSNumber alloc] initWithLongLong:value]; + [self setObject:object forKey:key]; + [object release]; +} + - (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key { NSNumber *object = [[NSNumber alloc] initWithUnsignedLongLong:value]; diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h b/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h new file mode 100644 index 0000000..a06ca3d --- /dev/null +++ b/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2010 Apple 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 "WebSecurityOriginInternal.h" + +@interface WebDatabaseSecurityOrigin : WebSecurityOrigin +@end diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm b/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm new file mode 100644 index 0000000..a0c3529 --- /dev/null +++ b/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2007, 2010 Apple 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 "WebDatabaseSecurityOrigin.h" +#import <WebCore/SecurityOrigin.h> + +using namespace WebCore; + +@implementation WebDatabaseSecurityOrigin + +// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 +// Proper steps should be taken to have subclass implementations of SecurityOrigin's +// origin, quota, and setQuota methods. + +@end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.h b/WebKit/mac/WebCoreSupport/WebApplicationCache.h index 282157f..78b06b7 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.h +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.h @@ -25,8 +25,12 @@ #import <Foundation/Foundation.h> -@interface WebApplicationCache: NSObject { -} +@interface WebApplicationCache: NSObject + ++ (long long)maximumSize; ++ (void)setMaximumSize:(long long)size; + ++ (long long)defaultOriginQuota; ++ (void)setDefaultOriginQuota:(long long)size; -+ (void)setMaximumSize:(unsigned long long)size; @end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm index 4ca749c..5c2a208 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm @@ -32,13 +32,28 @@ using namespace WebCore; @implementation WebApplicationCache -+ (void)setMaximumSize:(unsigned long long)size ++ (long long)maximumSize +{ + return cacheStorage().maximumSize(); +} + ++ (void)setMaximumSize:(long long)size { cacheStorage().empty(); cacheStorage().vacuumDatabaseFile(); cacheStorage().setMaximumSize(size); } ++ (long long)defaultOriginQuota +{ + return cacheStorage().defaultOriginQuota(); +} + ++ (void)setDefaultOriginQuota:(long long)size +{ + cacheStorage().setDefaultOriginQuota(size); +} + @end #endif diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h b/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h new file mode 100644 index 0000000..09c0610 --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2010 Apple 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 "WebSecurityOriginInternal.h" + +@interface WebApplicationCacheSecurityOrigin : WebSecurityOrigin +@end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm new file mode 100644 index 0000000..dac41ae --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 Apple 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 "WebApplicationCacheSecurityOrigin.h" + +#import <WebCore/ApplicationCacheStorage.h> + +using namespace WebCore; + +@implementation WebApplicationCacheSecurityOrigin + +- (unsigned long long)usage +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + long long usage; + if (cacheStorage().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private), usage)) + return usage; + return 0; +#else + return 0; +#endif +} + +- (unsigned long long)quota +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + long long quota; + if (cacheStorage().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota)) + return quota; + return 0; +#else + return 0; +#endif +} + +- (void)setQuota:(unsigned long long)quota +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + cacheStorage().storeUpdatedQuotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota); +#endif +} + +@end diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index 707d080..50c159c 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -117,6 +117,7 @@ public: #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); + virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); #endif virtual void populateVisitedLinks(); @@ -167,6 +168,10 @@ public: virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*) { } + virtual bool selectItemWritingDirectionIsNatural(); + virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const; + virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; + private: WebView *m_webView; }; diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index eb56240..1a3736e 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -1,6 +1,6 @@ /* * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,6 +30,8 @@ #import "WebChromeClient.h" #import "DOMNodeInternal.h" +#import "WebApplicationCacheSecurityOrigin.h" +#import "WebDatabaseSecurityOrigin.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebElementDictionary.h" @@ -62,12 +64,16 @@ #import <WebCore/Page.h> #import <WebCore/PlatformScreen.h> #import <WebCore/PlatformString.h> +#import <WebCore/PopupMenuMac.h> #import <WebCore/ResourceRequest.h> +#import <WebCore/SearchPopupMenuMac.h> #import <WebCore/Widget.h> #import <WebCore/WindowFeatures.h> #import <wtf/PassRefPtr.h> #import <wtf/Vector.h> + + #if USE(ACCELERATED_COMPOSITING) #import <WebCore/GraphicsLayer.h> #endif @@ -553,7 +559,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database { BEGIN_BLOCK_OBJC_EXCEPTIONS; - WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; + WebDatabaseSecurityOrigin *webOrigin = [[WebDatabaseSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented. if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) { const unsigned long long defaultQuota = 5 * 1024 * 1024; // 5 megabytes should hopefully be enough to test storage support. @@ -571,6 +577,17 @@ void WebChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded) { // FIXME: Free some space. } + +void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin) +{ + BEGIN_BLOCK_OBJC_EXCEPTIONS; + + WebApplicationCacheSecurityOrigin *webOrigin = [[WebApplicationCacheSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]; + CallUIDelegate(m_webView, @selector(webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:), webOrigin); + [webOrigin release]; + + END_BLOCK_OBJC_EXCEPTIONS; +} #endif void WebChromeClient::populateVisitedLinks() @@ -724,6 +741,21 @@ void WebChromeClient::formDidBlur(const WebCore::Node* node) CallUIDelegate(m_webView, @selector(webView:formDidBlurNode:), kit(const_cast<WebCore::Node*>(node))); } +bool WebChromeClient::selectItemWritingDirectionIsNatural() +{ + return true; +} + +PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const +{ + return adoptRef(new PopupMenuMac(client)); +} + +PassRefPtr<WebCore::SearchPopupMenu> WebChromeClient::createSearchPopupMenu(WebCore::PopupMenuClient* client) const +{ + return adoptRef(new SearchPopupMenuMac(client)); +} + #if USE(ACCELERATED_COMPOSITING) void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer) diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h index 0ac4f16..3d34dbe 100644 --- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h @@ -29,8 +29,9 @@ #include <WebCore/PlatformStrategies.h> #include <WebCore/PluginStrategy.h> #include <WebCore/LocalizationStrategy.h> +#include <WebCore/VisitedLinkStrategy.h> -class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy { +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { public: static void initialize(); @@ -40,6 +41,7 @@ private: // WebCore::PlatformStrategies virtual WebCore::PluginStrategy* createPluginStrategy(); virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); + virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); // WebCore::PluginStrategy virtual void refreshPlugins(); @@ -148,6 +150,10 @@ private: virtual WebCore::String validationMessageRangeUnderflowText(); virtual WebCore::String validationMessageRangeOverflowText(); virtual WebCore::String validationMessageStepMismatchText(); + + // WebCore::VisitedLinkStrategy + virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); + virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); }; #endif // WebPlatformStrategies_h diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm index 6805f5e..2900ccf 100644 --- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm @@ -30,6 +30,8 @@ #import "WebPluginPackage.h" #import <WebCore/BlockExceptions.h> #import <WebCore/IntSize.h> +#import <WebCore/Page.h> +#import <WebCore/PageGroup.h> #import <wtf/StdLibExtras.h> #ifdef BUILDING_ON_TIGER @@ -60,6 +62,11 @@ LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() return this; } +VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() +{ + return this; +} + void WebPlatformStrategies::refreshPlugins() { [[WebPluginDatabase sharedDatabase] refresh]; @@ -762,3 +769,13 @@ String WebPlatformStrategies::validationMessageStepMismatchText() return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute"); } +// VisitedLinkStrategy +bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) +{ + return page->group().isLinkVisited(hash); +} + +void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash) +{ + return page->group().addVisitedLinkHash(hash); +} diff --git a/WebKit/mac/Storage/WebSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm index 56a21f5..0d49445 100644 --- a/WebKit/mac/Storage/WebSecurityOrigin.mm +++ b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,9 +28,9 @@ #import "WebSecurityOriginInternal.h" -#import <WebCore/DatabaseTracker.h> #import <WebCore/KURL.h> #import <WebCore/SecurityOrigin.h> +#import <WebCore/DatabaseTracker.h> using namespace WebCore; @@ -69,6 +69,10 @@ using namespace WebCore; return reinterpret_cast<SecurityOrigin*>(_private)->port(); } +// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 +// Proper steps should be taken to have subclass implementations of SecurityOrigin's +// origin, quota, and setQuota methods. + - (unsigned long long)usage { #if ENABLE(DATABASE) @@ -87,9 +91,9 @@ using namespace WebCore; #endif } -// Sets the storage quota (in bytes) -// If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. -// This will simply prevent new data from being added to databases in that origin +// If the quota is set to a value lower than the current usage, that quota will +// "stick" but no data will be purged to meet the new quota. This will simply +// prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota { #if ENABLE(DATABASE) diff --git a/WebKit/mac/Storage/WebSecurityOriginInternal.h b/WebKit/mac/WebCoreSupport/WebSecurityOriginInternal.h index 7bd6817..7bd6817 100644 --- a/WebKit/mac/Storage/WebSecurityOriginInternal.h +++ b/WebKit/mac/WebCoreSupport/WebSecurityOriginInternal.h diff --git a/WebKit/mac/Storage/WebSecurityOriginPrivate.h b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h index c7836f8..6518a16 100644 --- a/WebKit/mac/Storage/WebSecurityOriginPrivate.h +++ b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h @@ -37,17 +37,19 @@ - (NSString*)protocol; - (NSString*)host; -// Returns zero if the port is the default port for the protocol, non-zero otherwise +// Returns zero if the port is the default port for the protocol, non-zero otherwise. - (unsigned short)port; -// Returns the current total usage of all databases in this security origin in bytes +// Meant to be implemented in a subclass. +// Returns the current total usage of all relevant items in this security origin in bytes. - (unsigned long long)usage; +// Meant to be implemented in a subclass. +// Returns the quota of this security origin in bytes. - (unsigned long long)quota; -// Sets the storage quota (in bytes) -// If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. -// This will simply prevent new data from being added to databases in that origin -- (void)setQuota:(unsigned long long)quota; +// Meant to be implemented in a subclass. +// Sets the storage quota in bytes. +- (void)setQuota:(unsigned long long)quota; @end diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 08c8911..58ce124 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -399,7 +399,7 @@ static CachedResourceClient* promisedDataClient() #endif @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize; +- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize; @end @class NSTextInputContext; @@ -1040,7 +1040,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursive { - [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1052,7 +1052,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; [descendantWebHTMLViews release]; @@ -1063,7 +1063,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_clearPrintingModeRecursive { - [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1075,7 +1075,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; [descendantWebHTMLViews release]; @@ -1086,7 +1086,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursiveAndAdjustViewSize { - [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1098,7 +1098,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; [descendantWebHTMLViews release]; @@ -2230,29 +2230,31 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) return _private->printing; } -- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth shrinkToFit:(BOOL)shrinkToFit +- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit { Frame* frame = core([self _frame]); if (!frame) return NO; float minLayoutWidth = 0; + float minLayoutHeight = 0; float maxLayoutWidth = 0; // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the page width. if (!frame->document() || !frame->document()->isFrameSet()) { minLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMinimumShrinkFactor : pageWidth; + minLayoutHeight = shrinkToFit ? pageHeight * _WebHTMLViewPrintingMinimumShrinkFactor : pageHeight; maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth; } - [self _setPrinting:YES minimumPageWidth:minLayoutWidth maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; + [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; return YES; } - (void)_endPrintMode { - [self _setPrinting:NO minimumPageWidth:0 maximumPageWidth:0 adjustViewSize:YES]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; } - (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit @@ -3104,7 +3106,7 @@ WEBCORE_COMMAND(yankAndSelect) // Do a layout, but set up a new fixed width for the purposes of doing printing layout. // minPageWidth==0 implies a non-printing layout -- (void)layoutToMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize +- (void)layoutToMinimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize { [self reapplyStyles]; @@ -3123,7 +3125,7 @@ WEBCORE_COMMAND(yankAndSelect) if (FrameView* coreView = coreFrame->view()) { if (minPageWidth > 0.0) - coreView->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize); + coreView->forceLayoutForPagination(FloatSize(minPageWidth, minPageHeight), maxPageWidth / minPageWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize); else { coreView->forceLayout(!adjustViewSize); if (adjustViewSize) @@ -3139,7 +3141,7 @@ WEBCORE_COMMAND(yankAndSelect) - (void)layout { - [self layoutToMinimumPageWidth:0.0f maximumPageWidth:0.0f adjustingViewSize:NO]; + [self layoutToMinimumPageWidth:0 height:0 maximumPageWidth:0 adjustingViewSize:NO]; } // Deliver mouseup events to the DOM for button 2. @@ -3820,7 +3822,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // Does setNeedsDisplay:NO as a side effect when printing is ending. // pageWidth != 0 implies we will relayout to a new width -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize +- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize { WebFrame *frame = [self _frame]; NSArray *subframes = [frame childFrames]; @@ -3830,7 +3832,7 @@ static BOOL isInPasswordField(Frame* coreFrame) WebFrame *subframe = [subframes objectAtIndex:i]; WebFrameView *frameView = [subframe frameView]; if ([[subframe _dataSource] _isDocumentHTML]) { - [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:adjustViewSize]; + [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize]; } } @@ -3842,7 +3844,7 @@ static BOOL isInPasswordField(Frame* coreFrame) _private->avoidingPrintOrphan = NO; [self setNeedsToApplyStyles:YES]; [self setNeedsLayout:YES]; - [self layoutToMinimumPageWidth:minPageWidth maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; + [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; if (!printing) { // Can't do this when starting printing or nested printing won't work, see 3491427. [self setNeedsDisplay:NO]; @@ -3863,7 +3865,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; if (!wasInPrintingMode) - [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; *newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit]; @@ -3874,7 +3876,7 @@ static BOOL isInPasswordField(Frame* coreFrame) [self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0]; else // not sure if this is actually ever invoked, it probably shouldn't be - [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; } } @@ -3904,8 +3906,8 @@ static BOOL isInPasswordField(Frame* coreFrame) // This is used for Carbon printing. At some point we might want to make this public API. - (void)setPageWidthForPrinting:(float)pageWidth { - [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; - [self _setPrinting:YES minimumPageWidth:pageWidth maximumPageWidth:pageWidth adjustViewSize:YES]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES]; } - (void)_endPrintModeAndRestoreWindowAutodisplay @@ -3948,8 +3950,9 @@ static BOOL isInPasswordField(Frame* coreFrame) [self displayIfNeeded]; [[self window] setAutodisplay:NO]; + [[self _webView] _adjustPrintingMarginsForHeaderAndFooter]; NSPrintOperation *printOperation = [NSPrintOperation currentOperation]; - if (![self _beginPrintModeWithPageWidth:[printOperation _web_availablePaperWidth] shrinkToFit:YES]) + if (![self _beginPrintModeWithPageWidth:[printOperation _web_availablePaperWidth] height:[printOperation _web_availablePaperHeight] shrinkToFit:YES]) return NO; // Certain types of errors, including invalid page ranges, can cause beginDocument and @@ -3959,7 +3962,6 @@ static BOOL isInPasswordField(Frame* coreFrame) // If not cancelled, this delayed call will be invoked in the next pass through the main event loop, // which is after beginDocument and endDocument would be called. [self performSelector:@selector(_delayedEndPrintMode:) withObject:printOperation afterDelay:0]; - [[self _webView] _adjustPrintingMarginsForHeaderAndFooter]; // There is a theoretical chance that someone could do some drawing between here and endDocument, // if something caused setNeedsDisplay after this point. If so, it's not a big tragedy, because diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h index 3beb0d6..c2ca3fe 100644 --- a/WebKit/mac/WebView/WebHTMLViewPrivate.h +++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h @@ -135,7 +135,7 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor; - (void)_layoutForPrinting; - (WebCGFloat)_adjustedBottomOfPageWithTop:(WebCGFloat)top bottom:(WebCGFloat)bottom limit:(WebCGFloat)bottomLimit; - (BOOL)_isInPrintMode; -- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth shrinkToFit:(BOOL)shrinkToFit; +- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit; - (void)_endPrintMode; - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard; diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h index 4175a5d..a8ebdca 100644 --- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h +++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h @@ -83,6 +83,8 @@ #define WebKitLocalStorageDatabasePathPreferenceKey @"WebKitLocalStorageDatabasePathPreferenceKey" #define WebKitEnableFullDocumentTeardownPreferenceKey @"WebKitEnableFullDocumentTeardown" #define WebKitOfflineWebApplicationCacheEnabledPreferenceKey @"WebKitOfflineWebApplicationCacheEnabled" +#define WebKitApplicationCacheTotalQuota @"WebKitApplicationCacheTotalQuota" +#define WebKitApplicationCacheDefaultOriginQuota @"WebKitApplicationCacheDefaultOriginQuota" #define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly" #define WebKitJavaScriptCanAccessClipboardPreferenceKey @"WebKitJavaScriptCanAccessClipboard" #define WebKitXSSAuditorEnabledPreferenceKey @"WebKitXSSAuditorEnabled" diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 63915dc..7ec2439 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -30,6 +30,7 @@ #import "WebPreferencesPrivate.h" #import "WebPreferenceKeysPrivate.h" +#import "WebApplicationCache.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemBits.h" @@ -37,6 +38,7 @@ #import "WebKitVersionChecks.h" #import "WebNSDictionaryExtras.h" #import "WebNSURLExtras.h" +#import <WebCore/ApplicationCacheStorage.h> NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotification"; NSString *WebPreferencesRemovedNotification = @"WebPreferencesRemovedNotification"; @@ -170,6 +172,8 @@ static WebCacheModel cacheModelForMainBundle(void) - (void)_setIntegerValue:(int)value forKey:(NSString *)key; - (float)_floatValueForKey:(NSString *)key; - (void)_setFloatValue:(float)value forKey:(NSString *)key; +- (void)_setLongLongValue:(long long)value forKey:(NSString *)key; +- (long long)_longLongValueForKey:(NSString *)key; - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key; - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key; @end @@ -364,6 +368,8 @@ static WebCacheModel cacheModelForMainBundle(void) [NSNumber numberWithBool:NO], WebKitHTML5TreeBuilderEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey, + [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota, + [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota, nil]; // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above @@ -461,6 +467,23 @@ static WebCacheModel cacheModelForMainBundle(void) [self _postPreferencesChangesNotification]; } +- (long long)_longLongValueForKey:(NSString *)key +{ + id o = [self _valueForKey:key]; + return [o respondsToSelector:@selector(longLongValue)] ? [o longLongValue] : 0; +} + +- (void)_setLongLongValue:(long long)value forKey:(NSString *)key +{ + if ([self _longLongValueForKey:key] == value) + return; + NSString *_key = KEY(key); + [_private->values _webkit_setLongLong:value forKey:_key]; + if (_private->autosaves) + [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithLongLong:value] forKey:_key]; + [self _postPreferencesChangesNotification]; +} + - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key { id o = [self _valueForKey:key]; @@ -973,6 +996,31 @@ static WebCacheModel cacheModelForMainBundle(void) [self _setFloatValue:factor forKey:WebKitPDFScaleFactorPreferenceKey]; } +- (int64_t)applicationCacheTotalQuota +{ + ASSERT([self _longLongValueForKey:WebKitApplicationCacheTotalQuota] == [WebApplicationCache maximumSize]); + return [self _longLongValueForKey:WebKitApplicationCacheTotalQuota]; +} + +- (void)setApplicationCacheTotalQuota:(int64_t)quota +{ + [self _setLongLongValue:quota forKey:WebKitApplicationCacheTotalQuota]; + + // Application Cache Preferences are stored on the global cache storage manager, not in Settings. + [WebApplicationCache setMaximumSize:quota]; +} + +- (int64_t)applicationCacheDefaultOriginQuota +{ + ASSERT([self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota] == [WebApplicationCache defaultOriginQuota]); + return [self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota]; +} + +- (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota +{ + [self _setLongLongValue:quota forKey:WebKitApplicationCacheDefaultOriginQuota]; +} + - (PDFDisplayMode)PDFDisplayMode { PDFDisplayMode value = [self _integerValueForKey:WebKitPDFDisplayModePreferenceKey]; diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h index 073b364..01f2aa8 100644 --- a/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -134,6 +134,12 @@ extern NSString *WebPreferencesRemovedNotification; - (float)PDFScaleFactor; - (void)setPDFScaleFactor:(float)scale; +- (int64_t)applicationCacheTotalQuota; +- (void)setApplicationCacheTotalQuota:(int64_t)quota; + +- (int64_t)applicationCacheDefaultOriginQuota; +- (void)setApplicationCacheDefaultOriginQuota:(int64_t)quota; + - (WebKitEditableLinkBehavior)editableLinkBehavior; - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior; diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h index eccb10f..0fb120c 100644 --- a/WebKit/mac/WebView/WebUIDelegatePrivate.h +++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -125,6 +125,16 @@ enum { */ - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier; +/*! + @method webView:exceededApplicationCacheOriginQuotaForSecurityOrigin: + @param sender The WebView sending the delegate method. + @param origin The security origin that needs a larger quota + @discussion This method is called when a page attempts to store more in the Application Cache + for an origin than was allowed by the quota (or default) set for the origin. This allows the + quota to be increased for the security origin. +*/ +- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin; + - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features; - (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename; diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 3d878bc..aefd56b 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -34,6 +34,7 @@ #import "DOMCSSStyleDeclarationInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" +#import "WebApplicationCache.h" #import "WebBackForwardListInternal.h" #import "WebBaseNetscapePluginView.h" #import "WebCache.h" @@ -1440,6 +1441,9 @@ static bool fastDocumentTeardownEnabled() settings->setHTML5TreeBuilderEnabled_DO_NOT_USE([preferences html5TreeBuilderEnabled]); settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]); settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]); + + // Application Cache Preferences are stored on the global cache storage manager, not in Settings. + [WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]]; } static inline IMP getMethod(id o, SEL s) |