diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebKit/mac | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebKit/mac')
38 files changed, 788 insertions, 470 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index d707720..8f1ea42 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,399 @@ +2010-10-20 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein. + + Composited elements drawn twice when WebView is layer-backed + https://bugs.webkit.org/show_bug.cgi?id=48024 + <rdar://problem/7916580> + + When drawing content in a layer-backed WebView, WebFrame's test + for drawing to a bitmap succeeded, causing us to paint flattened + compositing layers into the view. They would also be rendered + by the normal compositing path, resulting in double rendering. + + Fix this by detecting when the WebHTMLView is being drawn into + a layer, and avoiding flattening in that case. + + * WebView/WebFrame.mm: + (-[WebFrame _showFlattenedCompositingLayers:]): + (-[WebFrame _drawRect:contentsOnly:]): + * WebView/WebHTMLView.mm: + (-[WebHTMLView drawLayer:inContext:]): + (-[WebHTMLView _web_isDrawingIntoLayer]): + * WebView/WebHTMLViewInternal.h: + +2010-10-20 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by David Levin. + + Repost the DatabaseTracker notifications to the main thread, if needed. + https://bugs.webkit.org/show_bug.cgi?id=40655 + + * Storage/WebDatabaseTrackerClient.mm: + (DidModifyOriginData::dispatchToMainThread): + (DidModifyOriginData::DidModifyOriginData): + (DidModifyOriginData::dispatchDidModifyOriginOnMainThread): + (WebDatabaseTrackerClient::dispatchDidModifyOrigin): + (WebDatabaseTrackerClient::dispatchDidModifyDatabase): + +2010-10-20 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + REGRESSION(r67568-r67643): Some HTML/CSS renders upside down and backwards on Leopard + https://bugs.webkit.org/show_bug.cgi?id=47369 + + r46947 added code that limits the size of the layer-backed view on Leopard when + the page height exceeds 4096px (later adjusted to 2048px in r48401). + + Later, r67576 altered the geometry flipping behavior to push the geometry flipping + down into WebKit. However, the code that adjusts the hosting layer's sublayer transform + to account for layer-backed view size-limiting was not fixed at the same time. + This change corrects that. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _updateLayerHostingViewPosition]): + +2010-10-19 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein. + + <rdar://problem/8508422> Compositing layers aren't always displayed correctly in layer-backed WebViews + + AppKit has some special code to prevent it meddling with view's layers + under layer-backed WebViews. When a layer-backed WebView became composited, + this caused our layer to remain zero-sized. Fix this by manually + setting the geometry for our layer, if the WebHTMLView has a layer. + + This does not seem to be a problem if the WebView becomes layer-backed, or + stops being layer-backed after the WebView starts using compositing. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView attachRootLayer:]): + +2010-10-20 Dirk Schulze <krit@webkit.org> + + Reviewed by Nikolas Zimmermann. + + Merge ColorSpace and ImageColorSpace enums + https://bugs.webkit.org/show_bug.cgi?id=47922 + + Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB + to follow webkit style rules. + + * Misc/WebKitNSStringExtras.mm: + (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): + +2010-10-19 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Anders Carlsson. + + https://bugs.webkit.org/show_bug.cgi?id=47933 + <rdar://problem/8494337> navigator.language doesn't work in WebKit2 + + * Misc/WebNSUserDefaultsExtras.mm: Moved code for computing default language to WebCore. + We need to keep _webkit_preferredLanguageCode for Safari. + + * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): + Initialize wkCopyCFLocalizationPreferredName. + + * WebCoreSupport/WebViewFactory.mm: Removed defaultLanguage. WebCore was the only caller. + +2010-10-18 Alexey Proskuryakov <ap@apple.com> + + Reviewed by David Kilzer. + + https://bugs.webkit.org/show_bug.cgi?id=47864 + Convert WebNSUserDefaultsExtras.m to .mm + + Also, fixed some issues in the process: + - removed locking, which was only necessary when this code was in Foundation; + - fixed notification center observer to actually work (previously, it picked up changes + when application preferences changed, not when system language did); + - removed unused NSString category; + - updated style. + + * Misc/WebNSUserDefaultsExtras.m: Removed. + * Misc/WebNSUserDefaultsExtras.mm: Copied from WebKit/mac/Misc/WebNSUserDefaultsExtras.m. + (createHTTPStyleLanguageCode): + (+[NSUserDefaults _webkit_defaultsDidChange]): + (addLanguageChangeObserver): + (+[NSUserDefaults _webkit_preferredLanguageCode]): + +2010-10-18 Stuart Morgan <stuartmorgan@chromium.org> + + Reviewed by Eric Seidel. + + Switch to using the new Carbon NPAPI event declarations, and remove + the old ones. + + https://bugs.webkit.org/show_bug.cgi?id=40784 + + * Plugins/WebNetscapePluginEventHandlerCarbon.mm: + (WebNetscapePluginEventHandlerCarbon::mouseEntered): + (WebNetscapePluginEventHandlerCarbon::mouseExited): + (WebNetscapePluginEventHandlerCarbon::mouseMoved): + (WebNetscapePluginEventHandlerCarbon::focusChanged): + +2010-10-18 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: disable private browsing for inspector + https://bugs.webkit.org/show_bug.cgi?id=47827 + + * WebCoreSupport/WebInspectorClient.mm: + (-[WebInspectorWindowController init]): + +2010-10-14 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: inspector settings/properties/states management + should be extracted into separate class. + + We have a lot of flags/values in InspectorController. + Some flags are persisting into profile. + Others are part of inspector state for frontend. + All these flags should keep their values after navigation. + It'd be better to extract these flags/values into separate + class which will care about theirs lifetime. + + https://bugs.webkit.org/show_bug.cgi?id=47275 + + * WebCoreSupport/WebInspectorClient.mm: + (-[WebInspectorWindowController showWindow:]): + (-[WebInspectorWindowController attach]): + (-[WebInspectorWindowController detach]): + +2010-10-13 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=43987 + Switch XMLHttpRequest, FileReader, and FileReaderSync to use a Stringbuilder + to construct their internal result string. Remove ScriptString (this is now + redundant). + + * WebCoreSupport/WebFrameLoaderClient.mm: + +2010-10-12 Andy Estes <aestes@apple.com> + + Rubber-stamped by Darin Adler. + + Check in some cleanup from the previous commit. + + * WebView/WebView.mm: + (leakMailQuirksUserScriptPath): Renamed to indicate that this function + leaks an NSString. + (-[WebView _injectMailQuirksScript]): Moved a static initialization from + a separate class method into the only method that used it and removed + the now-unnecessary class method. + +2010-10-12 Eric Seidel <eric@webkit.org> + + Reviewed by Darin Adler. + + REGRESSION (new parser): Leopard/Tiger Mail <head>/<body> quirk is gone + https://bugs.webkit.org/show_bug.cgi?id=45693 + + Re-implement this former WebCore parser quirk as a + Mac-only userscript-based quirk. As far as I can tell + from Darin's description this should satisfy Mail's needs. + + * Misc/MailQuirksUserScript.js: Added. + * WebView/WebView.mm: + (+[WebView _mailQuirksUserScript]): + (-[WebView _injectMailQuirksScript]): + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + +2010-10-12 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Sam Weinig. + + Add 'didDraw' callback for framerate tracking + https://bugs.webkit.org/show_bug.cgi?id=47478 + + Add a callback at the end of -[WebHTMLView drawRect:] so + a delegate can get notified when a draw happens. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView drawRect:]): + * WebView/WebUIDelegatePrivate.h: + +2010-10-11 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Remove WebIconFetcher from WebKit and IconFetcher from WebCore + https://bugs.webkit.org/show_bug.cgi?id=47523 + + Remove all traces of the WebKit WebIconFetcher class. It's SPI that nobody uses. + + * Misc/WebIconFetcher.h: Removed. + * Misc/WebIconFetcher.mm: Removed. + * Misc/WebIconFetcherInternal.h: Removed. + * WebView/WebFrame.mm: + * WebView/WebFramePrivate.h: + +2010-10-11 Jessie Berlin <jberlin@apple.com> + + Reviewed by Darin Adler. + + Add Private API for creating a WebKit2 WebSerializedScriptValue from the internal + representation of a WebKit1 WebSerializedJSValue. + https://bugs.webkit.org/show_bug.cgi?id=47439 + + * WebView/WebSerializedJSValue.mm: + (-[WebSerializedJSValue internalRepresentation]): + * WebView/WebSerializedJSValuePrivate.h: + +2010-10-07 Jessie Berlin <jberlin@apple.com> + + Reviewed by Sam Weinig. + + Add Private API for creating a WebKit1 WebSerializedJSValue from the internal + representation of a WebKit2 WebSerializedScriptValue. + https://bugs.webkit.org/show_bug.cgi?id=47390 + + * WebView/WebSerializedJSValue.mm: + (-[WebSerializedJSValue initWithInternalRepresentation:]): + Set the WebSerializedJSValuePrivate's WebCore::SerializedScriptValue to be the passed in + internal representation. + * WebView/WebSerializedJSValuePrivate.h: Added. + +2010-10-07 Antonio Gomes <agomes@rim.com> + + Reviewed by Simon Fraser. + + [Mac] [DRT] implement setSpatialNavigationEnabled + https://bugs.webkit.org/show_bug.cgi?id=47291 + + Added the needed bits to make it possible to enabled spatial navigation + for the Mac port. For now it is being only used by DRT. + + * WebView/WebPreferenceKeysPrivate.h: + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): + (-[WebPreferences isSpatialNavigationEnabled]): + (-[WebPreferences setSpatialNavigationEnabled:]): + * WebView/WebPreferencesPrivate.h: + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): + +2010-10-07 Jer Noble <jer.noble@apple.com> + + Fix the Leopard 64-bit build. + + * Configurations/WebKit.xcconfig: Add CoreServices.framework/Frameworks to the + framework search path. + * WebView/WebVideoFullscreenController.mm: Explicitly import <OSStatus/Power.h>. + +2010-10-06 Jer Noble <jer.noble@apple.com> + + Reviewed by Darin Adler. + + Screensaver starts while watching fullscreen playback. + https://bugs.webkit.org/show_bug.cgi?id=47299 + <rdar://problem/8478956> + + To disable the Screen Saver, we need to periodically call UpdateSystemActivity(). + + * WebView/WebVideoFullscreenController.h: Added _tickleTimer. + * WebView/WebVideoFullscreenController.mm: + (-[WebVideoFullscreenController dealloc]): Invalidate _tickleTimer. + (-[WebVideoFullscreenController _enableTickleTimer]): Create _tickleTimer. + (-[WebVideoFullscreenController _disableTickleTimer]): Invalidate _tickleTimer. + (-[WebVideoFullscreenController _tickleTimerFired]): Call UpdateSystemActivity(). + (-[WebVideoFullscreenController updatePowerAssertions]): Call _enableTickleTimer + or _disableTickleTimer. + +2010-10-05 Philippe Normand <pnormand@igalia.com> + + Reviewed by Martin Robinson. + + check for ENABLE(GLIB_SUPPORT) in WebView + https://bugs.webkit.org/show_bug.cgi?id=46788 + + Use ENABLE(GLIB_SUPPORT) in WebView to guard the glib runloop observer. + + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + (-[WebView _close]): + * WebView/WebViewData.h: + * WebView/WebViewInternal.h: + +2010-10-01 Anders Carlsson <andersca@apple.com> + + Fix Snow Leopard build. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::getProxy): + +2010-10-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add proxy server query function proxyServersForURL and change the Mac plug-in code to use it + https://bugs.webkit.org/show_bug.cgi?id=47022 + <rdar://problem/8504712> + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::getProxy): + * Plugins/WebBaseNetscapePluginView.h: + * Plugins/WebBaseNetscapePluginView.mm: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView getVariable:forURL:value:length:]): + +2010-09-30 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Remove remaining calls to deprecatedParseURL + https://bugs.webkit.org/show_bug.cgi?id=26599 + + * DOM/WebDOMOperations.mm: + (-[DOMDocument URLWithAttributeString:]): + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::createPlugin): + Call stripLeadingAndTrailingHTMLSpaces instead of deprecatedParseURL. + +2010-09-30 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + -[DOMDocument _documentRange] throws an exception if there is no document element + https://bugs.webkit.org/show_bug.cgi?id=46934 + <rdar://problem/8169260> + + If there is no document element, just return an empty range. Otherwise we'll try to call + Range::selectNode with a null Node which will throw a NOT_FOUND exception. + + * DOM/WebDOMOperations.mm: + (-[DOMDocument _documentRange]): + +2010-09-30 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Make 2D accelerated canvas rendering build on Mac + https://bugs.webkit.org/show_bug.cgi?id=46007 + + Added ACCELERATED_2D_CANVAS to FeatureDefines + + * Configurations/FeatureDefines.xcconfig: + +2010-09-30 Dan Bernstein <mitz@apple.com> + + Reviewed by John Sullivan. + + Add printing SPI allowing full control over shrink-to-fit + https://bugs.webkit.org/show_bug.cgi?id=46877 + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): Added. + * WebView/WebHTMLViewPrivate.h: + 2010-09-28 Johnny Ding <jnd@chromium.org> Reviewed by Adam Barth. diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 81d912f..8732c18 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -33,6 +33,11 @@ ENABLE_LINK_PREFETCH = ; +ENABLE_ACCELERATED_2D_CANVAS = $(ENABLE_ACCELERATED_2D_CANVAS_$(REAL_PLATFORM_NAME)); +ENABLE_ACCELERATED_2D_CANVAS_macosx = $(ENABLE_ACCELERATED_2D_CANVAS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ENABLE_ACCELERATED_2D_CANVAS_macosx_1060 = ; +ENABLE_ACCELERATED_2D_CANVAS_macosx_1070 = ; + 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; @@ -120,4 +125,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index 13dd8c0..8739787 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 10; +MINOR_VERSION = 11; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/Configurations/WebKit.xcconfig b/WebKit/mac/Configurations/WebKit.xcconfig index def76fd..6b8ae6f 100644 --- a/WebKit/mac/Configurations/WebKit.xcconfig +++ b/WebKit/mac/Configurations/WebKit.xcconfig @@ -44,7 +44,7 @@ FRAMEWORK_SEARCH_PATHS_iphoneos_Debug = $(BUILT_PRODUCTS_DIR) $(PRODUCTION_FRAME 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); +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)/Frameworks/CoreServices.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); diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm index 3d69836..5e09308 100644 --- a/WebKit/mac/DOM/WebDOMOperations.mm +++ b/WebKit/mac/DOM/WebDOMOperations.mm @@ -38,8 +38,8 @@ #import "WebFramePrivate.h" #import "WebKitNSStringExtras.h" #import <JavaScriptCore/APICast.h> -#import <WebCore/CSSHelper.h> #import <WebCore/Document.h> +#import <WebCore/HTMLParserIdioms.h> #import <WebCore/JSElement.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/markup.h> @@ -129,24 +129,21 @@ using namespace JSC; - (NSURL *)URLWithAttributeString:(NSString *)string { - return core(self)->completeURL(deprecatedParseURL(string)); + return core(self)->completeURL(stripLeadingAndTrailingHTMLSpaces(string)); } @end @implementation DOMDocument (WebDOMDocumentOperationsInternal) -/* This doesn't appear to be used by anyone. We should consider removing this. */ -- (DOMRange *)_createRangeWithNode:(DOMNode *)node +- (DOMRange *)_documentRange { DOMRange *range = [self createRange]; - [range selectNode:node]; - return range; -} -- (DOMRange *)_documentRange -{ - return [self _createRangeWithNode:[self documentElement]]; + if (DOMNode* documentElement = [self documentElement]) + [range selectNode:documentElement]; + + return range; } @end diff --git a/WebKit/mac/Misc/MailQuirksUserScript.js b/WebKit/mac/Misc/MailQuirksUserScript.js new file mode 100644 index 0000000..e36c21b --- /dev/null +++ b/WebKit/mac/Misc/MailQuirksUserScript.js @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER OR 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. + */ + +(function() { + function childrenBefore(parent, stopAt) + { + var children = []; + for (var child = parent.firstChild; child != stopAt; child = child.nextSibling) + children.push(child); + return children; + } + + // If html or body is missing, Mail.app's assumption that + // document.firstChild.firstChild == document.body is wrong anyway, + // so return null to not move anything. + if (!document.documentElement || !document.body) + return; + + var children = childrenBefore(document, document.documentElement); + children = children.concat(childrenBefore(document.documentElement, document.body)); + + for (var i = children.length - 1; i >= 0; i--) { + var child = children[i]; + // It's not possible to move doctype nodes into the body, so just remove them. + if (child.nodeType == child.DOCUMENT_TYPE_NODE) + child.parentNode.removeChild(child); + else + document.body.insertBefore(child, document.body.firstChild); + } +})(); diff --git a/WebKit/mac/Misc/WebIconFetcher.h b/WebKit/mac/Misc/WebIconFetcher.h deleted file mode 100644 index d27ad94..0000000 --- a/WebKit/mac/Misc/WebIconFetcher.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2008 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. ``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 - * 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 <Cocoa/Cocoa.h> - -@class WebIconFetcherPrivate; - -@interface WebIconFetcher : NSObject { - WebIconFetcherPrivate *_private; -} - -- (void)cancel; - -@end diff --git a/WebKit/mac/Misc/WebIconFetcher.mm b/WebKit/mac/Misc/WebIconFetcher.mm deleted file mode 100644 index a31ab7d..0000000 --- a/WebKit/mac/Misc/WebIconFetcher.mm +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2008 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. ``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 - * 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 "WebIconFetcher.h" - -#import "WebFrameInternal.h" -#import "WebIconFetcherInternal.h" - -#import <WebCore/Frame.h> -#import <WebCore/IconFetcher.h> -#import <WebCore/SharedBuffer.h> -#import <wtf/PassRefPtr.h> - -using namespace WebCore; - -class WebIconFetcherClient : public IconFetcherClient { -public: - WebIconFetcherClient(id target, SEL selector) - : m_target(target) - , m_selector(selector) - { - } - - virtual void finishedFetchingIcon(PassRefPtr<SharedBuffer> iconData) - { - RetainPtr<NSData> data; - if (iconData) - data = iconData->createNSData(); - - [m_target performSelector:m_selector withObject:m_fetcher.get() withObject:data.get()]; - - delete this; - } - - void setFetcher(WebIconFetcher *fetcher) { m_fetcher = fetcher; } - -private: - RetainPtr<WebIconFetcher> m_fetcher; - id m_target; - SEL m_selector; -}; - -@implementation WebIconFetcher - -- (id)init -{ - return nil; -} - -- (void)dealloc -{ - if (_private) - reinterpret_cast<IconFetcher*>(_private)->deref(); - - [super dealloc]; -} - -- (void)finalize -{ - if (_private) - reinterpret_cast<IconFetcher*>(_private)->deref(); - - [super finalize]; -} - -- (void)cancel -{ - reinterpret_cast<IconFetcher*>(_private)->cancel(); -} - -@end - -@implementation WebIconFetcher (WebInternal) - -- (id)_initWithIconFetcher:(PassRefPtr<IconFetcher>)iconFetcher client:(WebIconFetcherClient *)client -{ - ASSERT(iconFetcher); - - self = [super init]; - if (!self) - return nil; - - client->setFetcher(self); - _private = reinterpret_cast<WebIconFetcherPrivate*>(iconFetcher.releaseRef()); - - return self; -} - -+ (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame - target:(id)target - selector:(SEL)selector -{ - Frame* frame = core(webFrame); - - WebIconFetcherClient* client = new WebIconFetcherClient(target, selector); - - RefPtr<IconFetcher> fetcher = IconFetcher::create(frame, client); - - if (!fetcher) - return nil; - - return [[[WebIconFetcher alloc] _initWithIconFetcher:fetcher.release() client:client] autorelease]; -} - -@end - diff --git a/WebKit/mac/Misc/WebIconFetcherInternal.h b/WebKit/mac/Misc/WebIconFetcherInternal.h deleted file mode 100644 index 5951ef9..0000000 --- a/WebKit/mac/Misc/WebIconFetcherInternal.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2008 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. ``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 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import <WebKit/WebIconFetcher.h> -#import <wtf/Forward.h> - -namespace WebCore { - class IconFetcher; -} - -@class WebFrame; - -@interface WebIconFetcher (WebInternal) - -+ (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame - target:(id)target - selector:(SEL)selector; - -@end - diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.mm b/WebKit/mac/Misc/WebKitNSStringExtras.mm index 8fc12bd..4785de5 100644 --- a/WebKit/mac/Misc/WebKitNSStringExtras.mm +++ b/WebKit/mac/Misc/WebKitNSStringExtras.mm @@ -97,7 +97,7 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length) CGFloat blue; CGFloat alpha; [[textColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed:&red green:&green blue:&blue alpha:&alpha]; - graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255), DeviceColorSpace); + graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255), ColorSpaceDeviceRGB); webCoreFont.drawText(&graphicsContext, run, FloatPoint(point.x, (flipped ? point.y : (-1 * point.y)))); diff --git a/WebKit/mac/Misc/WebNSUserDefaultsExtras.m b/WebKit/mac/Misc/WebNSUserDefaultsExtras.m deleted file mode 100644 index 383d202..0000000 --- a/WebKit/mac/Misc/WebNSUserDefaultsExtras.m +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "WebNSUserDefaultsExtras.h" - -#import "WebNSObjectExtras.h" -#import <WebKitSystemInterface.h> -#import <wtf/Assertions.h> - -@implementation NSString (WebNSUserDefaultsPrivate) - -- (NSString *)_webkit_HTTPStyleLanguageCode -{ - // Look up the language code using CFBundle. - NSString *languageCode = self; - NSString *preferredLanguageCode = WebCFAutorelease(WKCopyCFLocalizationPreferredName((CFStringRef)self)); - - if (preferredLanguageCode) - languageCode = preferredLanguageCode; - - // Make the string lowercase. - NSString *lowercaseLanguageCode = [languageCode lowercaseString]; - - // Turn a '_' into a '-' if it appears after a 2-letter language code. - if ([lowercaseLanguageCode length] < 3 || [lowercaseLanguageCode characterAtIndex:2] != '_') { - return lowercaseLanguageCode; - } - NSMutableString *result = [lowercaseLanguageCode mutableCopy]; - [result replaceCharactersInRange:NSMakeRange(2, 1) withString:@"-"]; - return [result autorelease]; -} - -@end - -@implementation NSUserDefaults (WebNSUserDefaultsExtras) - -static NSString *preferredLanguageCode = nil; -static NSLock *preferredLanguageLock = nil; -static pthread_once_t preferredLanguageLockOnce = PTHREAD_ONCE_INIT; -static pthread_once_t addDefaultsChangeObserverOnce = PTHREAD_ONCE_INIT; - -static void makeLock(void) -{ - preferredLanguageLock = [[NSLock alloc] init]; -} - -+ (void)_webkit_ensureAndLockPreferredLanguageLock -{ - pthread_once(&preferredLanguageLockOnce, makeLock); - [preferredLanguageLock lock]; -} - -+ (void)_webkit_defaultsDidChange -{ - [self _webkit_ensureAndLockPreferredLanguageLock]; - - [preferredLanguageCode release]; - preferredLanguageCode = nil; - - [preferredLanguageLock unlock]; -} - -static void addDefaultsChangeObserver(void) -{ - [[NSNotificationCenter defaultCenter] addObserver:[NSUserDefaults class] - selector:@selector(_webkit_defaultsDidChange) - name:NSUserDefaultsDidChangeNotification - object:[NSUserDefaults standardUserDefaults]]; -} - -+ (void)_webkit_addDefaultsChangeObserver -{ - pthread_once(&addDefaultsChangeObserverOnce, addDefaultsChangeObserver); -} - -+ (NSString *)_webkit_preferredLanguageCode -{ - // Get this outside the lock since it might block on the defaults lock, while we are inside registerDefaults:. - NSUserDefaults *standardDefaults = [self standardUserDefaults]; - - BOOL addObserver = NO; - - [self _webkit_ensureAndLockPreferredLanguageLock]; - - if (!preferredLanguageCode) { - NSArray *languages = [standardDefaults stringArrayForKey:@"AppleLanguages"]; - if ([languages count] == 0) { - preferredLanguageCode = [@"en" retain]; - } else { - preferredLanguageCode = [[[languages objectAtIndex:0] _webkit_HTTPStyleLanguageCode] copy]; - } - addObserver = YES; - } - - NSString *code = [[preferredLanguageCode retain] autorelease]; - - [preferredLanguageLock unlock]; - - if (addObserver) { - [self _webkit_addDefaultsChangeObserver]; - } - - return code; -} - -@end diff --git a/WebKit/mac/Misc/WebNSUserDefaultsExtras.mm b/WebKit/mac/Misc/WebNSUserDefaultsExtras.mm new file mode 100644 index 0000000..a255935 --- /dev/null +++ b/WebKit/mac/Misc/WebNSUserDefaultsExtras.mm @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2005, 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "WebNSUserDefaultsExtras.h" + +#import <WebCore/Language.h> +#import <wtf/text/WTFString.h> + +using namespace WebCore; + +@implementation NSUserDefaults (WebNSUserDefaultsExtras) + ++ (NSString *)_webkit_preferredLanguageCode +{ + return defaultLanguage(); +} + +@end diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index e03bc27..0b9036a 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -50,6 +50,7 @@ #import <WebCore/FrameLoader.h> #import <WebCore/FrameTree.h> #import <WebCore/KURL.h> +#import <WebCore/ProxyServer.h> #import <WebCore/SecurityOrigin.h> #import <WebCore/ScriptController.h> #import <WebCore/ScriptValue.h> @@ -1557,7 +1558,8 @@ bool NetscapePluginInstanceProxy::getProxy(data_t urlData, mach_msg_type_number_ if (!url) return false; - WTF::CString proxyStringUTF8 = proxiesForURL(url); + Vector<ProxyServer> proxyServers = proxyServersForURL(url, 0); + WTF::CString proxyStringUTF8 = toString(proxyServers).utf8(); proxyLength = proxyStringUTF8.length(); mig_allocate(reinterpret_cast<vm_address_t*>(&proxyData), proxyLength); diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h index 9a29cc2..1a4b6bb 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h @@ -145,10 +145,6 @@ class WebHaltablePlugin; namespace WebKit { -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) -WTF::CString proxiesForURL(NSURL *); -#endif - bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, WTF::CString& username, WTF::CString& password); } diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 4966716..708b017 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -960,66 +960,6 @@ String WebHaltablePlugin::pluginName() const namespace WebKit { -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) -CString proxiesForURL(NSURL *url) -{ - RetainPtr<CFDictionaryRef> systemProxies(AdoptCF, CFNetworkCopySystemProxySettings()); - if (!systemProxies) - return "DIRECT"; - - RetainPtr<CFArrayRef> proxiesForURL(AdoptCF, CFNetworkCopyProxiesForURL((CFURLRef)url, systemProxies.get())); - CFIndex proxyCount = proxiesForURL ? CFArrayGetCount(proxiesForURL.get()) : 0; - if (!proxyCount) - return "DIRECT"; - - // proxiesForURL is a CFArray of CFDictionaries. Each dictionary represents a proxy. - // The format of the result should be: - // "PROXY host[:port]" (for HTTP proxy) or - // "SOCKS host[:port]" (for SOCKS proxy) or - // A combination of the above, separated by semicolon, in the order that they should be tried. - String proxies; - for (CFIndex i = 0; i < proxyCount; ++i) { - CFDictionaryRef proxy = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(proxiesForURL.get(), i)); - if (!proxy) - continue; - - CFStringRef type = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyTypeKey)); - bool isHTTP = type == kCFProxyTypeHTTP || type == kCFProxyTypeHTTPS; - bool isSOCKS = type == kCFProxyTypeSOCKS; - - // We can only report HTTP and SOCKS proxies. - if (!isHTTP && !isSOCKS) - continue; - - CFStringRef host = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyHostNameKey)); - CFNumberRef port = static_cast<CFNumberRef>(CFDictionaryGetValue(proxy, kCFProxyPortNumberKey)); - - // If we are inserting multiple entries, add a separator - if (!proxies.isEmpty()) - proxies += ";"; - - if (isHTTP) - proxies += "PROXY "; - else if (isSOCKS) - proxies += "SOCKS "; - - proxies += host; - - if (port) { - SInt32 intPort; - CFNumberGetValue(port, kCFNumberSInt32Type, &intPort); - - proxies += ":" + String::number(intPort); - } - } - - if (proxies.isEmpty()) - return "DIRECT"; - - return proxies.utf8(); -} -#endif - bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, CString& username, CString& password) { diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm index a5e8f73..3d2b68e 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm @@ -174,7 +174,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseEntered(NSEvent* theEvent) EventRecord event; getCarbonEvent(&event, theEvent); - event.what = adjustCursorEvent; + event.what = NPEventType_AdjustCursorEvent; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); @@ -187,7 +187,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseExited(NSEvent* theEvent) EventRecord event; getCarbonEvent(&event, theEvent); - event.what = adjustCursorEvent; + event.what = NPEventType_AdjustCursorEvent; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); @@ -204,7 +204,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent* theEvent) EventRecord event; getCarbonEvent(&event, theEvent); - event.what = adjustCursorEvent; + event.what = NPEventType_AdjustCursorEvent; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); @@ -271,14 +271,14 @@ void WebNetscapePluginEventHandlerCarbon::focusChanged(bool hasFocus) getCarbonEvent(&event); bool acceptedEvent; if (hasFocus) { - event.what = getFocusEvent; + event.what = NPEventType_GetFocusEvent; acceptedEvent = sendEvent(&event); - LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent); + LOG(PluginEvents, "NPP_HandleEvent(NPEventType_GetFocusEvent): %d", acceptedEvent); installKeyEventHandler(); } else { - event.what = loseFocusEvent; + event.what = NPEventType_LoseFocusEvent; acceptedEvent = sendEvent(&event); - LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent); + LOG(PluginEvents, "NPP_HandleEvent(NPEventType_LoseFocusEvent): %d", acceptedEvent); removeKeyEventHandler(); } } diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm index ff0ca77..48574bf 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm @@ -66,6 +66,7 @@ #import <WebCore/HTMLPlugInElement.h> #import <WebCore/Page.h> #import <WebCore/PluginMainThreadScheduler.h> +#import <WebCore/ProxyServer.h> #import <WebCore/ScriptController.h> #import <WebCore/SecurityOrigin.h> #import <WebCore/SoftLinking.h> @@ -2239,7 +2240,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) if (!URL) break; - CString proxiesUTF8 = proxiesForURL(URL); + Vector<ProxyServer> proxyServers = proxyServersForURL(URL, 0); + CString proxiesUTF8 = toString(proxyServers).utf8(); *value = static_cast<char*>(NPN_MemAlloc(proxiesUTF8.length())); memcpy(*value, proxiesUTF8.data(), proxiesUTF8.length()); diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm index 89626fb..2913739 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm @@ -32,6 +32,7 @@ #import "WebDatabaseManagerPrivate.h" #import "WebSecurityOriginInternal.h" +#import <wtf/MainThread.h> #import <wtf/RetainPtr.h> #import <WebCore/SecurityOrigin.h> @@ -50,10 +51,42 @@ WebDatabaseTrackerClient::WebDatabaseTrackerClient() WebDatabaseTrackerClient::~WebDatabaseTrackerClient() { } - + +class DidModifyOriginData : public Noncopyable { +public: + static void dispatchToMainThread(WebDatabaseTrackerClient* client, SecurityOrigin* origin) + { + DidModifyOriginData* context = new DidModifyOriginData(client, origin->threadsafeCopy()); + callOnMainThread(&DidModifyOriginData::dispatchDidModifyOriginOnMainThread, context); + } + +private: + DidModifyOriginData(WebDatabaseTrackerClient* client, PassRefPtr<SecurityOrigin> origin) + : client(client) + , origin(origin) + { + } + + static void dispatchDidModifyOriginOnMainThread(void* context) + { + ASSERT(isMainThread()); + DidModifyOriginData* info = static_cast<DidModifyOriginData*>(context); + info->client->dispatchDidModifyOrigin(info->origin.get()); + delete info; + } + + WebDatabaseTrackerClient* client; + RefPtr<SecurityOrigin> origin; +}; + void WebDatabaseTrackerClient::dispatchDidModifyOrigin(SecurityOrigin* origin) { - RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); + if (!isMainThread()) { + DidModifyOriginData::dispatchToMainThread(this, origin); + return; + } + + RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); [[NSNotificationCenter defaultCenter] postNotificationName:WebDatabaseDidModifyOriginNotification object:webSecurityOrigin.get()]; @@ -61,6 +94,11 @@ void WebDatabaseTrackerClient::dispatchDidModifyOrigin(SecurityOrigin* origin) void WebDatabaseTrackerClient::dispatchDidModifyDatabase(SecurityOrigin* origin, const String& databaseIdentifier) { + if (!isMainThread()) { + DidModifyOriginData::dispatchToMainThread(this, origin); + return; + } + RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); RetainPtr<NSDictionary> userInfo(AdoptNS, [[NSDictionary alloc] initWithObjectsAndKeys:(NSString *)databaseIdentifier, WebDatabaseIdentifierKey, nil]); diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index cef552b..c3fd457 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -94,10 +94,8 @@ #import <WebCore/HTMLFrameElement.h> #import <WebCore/HTMLFrameOwnerElement.h> #import <WebCore/HTMLHeadElement.h> -#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) -#import <WebCore/HTMLMediaElement.h> -#endif #import <WebCore/HTMLNames.h> +#import <WebCore/HTMLParserIdioms.h> #import <WebCore/HTMLPlugInElement.h> #import <WebCore/HistoryItem.h> #import <WebCore/HitTestResult.h> @@ -113,7 +111,6 @@ #import <WebCore/ResourceLoader.h> #import <WebCore/ResourceRequest.h> #import <WebCore/ScriptController.h> -#import <WebCore/ScriptString.h> #import <WebCore/SharedBuffer.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/Widget.h> @@ -124,6 +121,10 @@ #import <wtf/PassRefPtr.h> #import <wtf/Threading.h> +#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) +#import <WebCore/HTMLMediaElement.h> +#endif + #if ENABLE(JAVA_BRIDGE) #import "WebJavaPlugIn.h" #endif @@ -1668,7 +1669,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP if (errorCode && m_webFrame) { WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->plugInFailedWithErrorFunc) { - KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage"))); + KURL pluginPageURL = document->completeURL(stripLeadingAndTrailingHTMLSpaces(parameterValue(paramNames, paramValues, "pluginspage"))); if (!pluginPageURL.protocolInHTTPFamily()) pluginPageURL = KURL(); NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage pluginInfo].name : nil; diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm index d4d0213..b08c161 100644 --- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm +++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm @@ -217,11 +217,9 @@ void WebInspectorFrontendClient::updateWindowTitle() const return nil; // Keep preferences separate from the rest of the client, making sure we are using expected preference values. - // One reason this is good is that it keeps the inspector out of history via "private browsing". WebPreferences *preferences = [[WebPreferences alloc] init]; [preferences setAutosaves:NO]; - [preferences setPrivateBrowsingEnabled:YES]; [preferences setLoadsImagesAutomatically:YES]; [preferences setAuthorAndUserStylesEnabled:YES]; [preferences setJavaScriptEnabled:YES]; @@ -358,8 +356,8 @@ void WebInspectorFrontendClient::updateWindowTitle() const _visible = YES; // If no preference is set - default to an attached window. This is important for inspector LayoutTests. - String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(InspectorController::inspectorStartsAttachedSettingName()); - _shouldAttach = shouldAttach != "false"; + // FIXME: This flag can be fetched directly from the flags storage. + _shouldAttach = [_inspectedWebView page]->inspectorController()->inspectorStartsAttached(); if (_shouldAttach && !_frontendClient->canAttachWindow()) _shouldAttach = NO; @@ -394,7 +392,8 @@ void WebInspectorFrontendClient::updateWindowTitle() const if (_attachedToInspectedWebView) return; - [_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "true"); + // FIXME: This flag can be saved directly to the flags storage. + [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(true); [self close]; [self showWindow:nil]; @@ -405,7 +404,8 @@ void WebInspectorFrontendClient::updateWindowTitle() const if (!_attachedToInspectedWebView) return; - [_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "false"); + // FIXME: This flag can be saved to the flags storage directly. + [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(false); [self close]; [self showWindow:nil]; diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm index 47b16b2..03cb33f 100644 --- a/WebKit/mac/WebCoreSupport/WebSystemInterface.mm +++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm @@ -44,6 +44,7 @@ void InitWebCoreSystemInterface(void) INIT(AdvanceDefaultButtonPulseAnimation); INIT(CGContextGetShouldSmoothFonts); + INIT(CopyCFLocalizationPreferredName); INIT(CopyCONNECTProxyResponse); INIT(CopyNSURLResponseStatusLine); INIT(CreateCustomCFReadStream); diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm index 6c7347f..055e3b4 100644 --- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm +++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm @@ -63,11 +63,6 @@ ASSERT([[self sharedFactory] isKindOfClass:self]); } -- (NSString *)defaultLanguageCode -{ - return [NSUserDefaults _webkit_preferredLanguageCode]; -} - - (BOOL)objectIsTextMarker:(id)object { return object != nil && CFGetTypeID(object) == WKGetAXTextMarkerTypeID(); diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm index 02696f4..4f8c1ba 100644 --- a/WebKit/mac/WebView/WebFrame.mm +++ b/WebKit/mac/WebView/WebFrame.mm @@ -44,7 +44,6 @@ #import "WebFrameViewInternal.h" #import "WebHTMLView.h" #import "WebHTMLViewInternal.h" -#import "WebIconFetcherInternal.h" #import "WebKitStatisticsPrivate.h" #import "WebKitVersionChecks.h" #import "WebNSObjectExtras.h" @@ -530,6 +529,26 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) return [[[NSString alloc] initWithCharactersNoCopy:buf length:length freeWhenDone:YES] autorelease]; } +- (BOOL)_shouldFlattenCompositingLayers:(CGContextRef)context +{ + // -currentContextDrawingToScreen returns YES for bitmap contexts. + BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen]; + if (isPrinting) + return YES; + + if (!WKCGContextIsBitmapContext(context)) + return NO; + + // If we're drawing into a bitmap, we might be snapshotting, or drawing into a layer-backed view. + if ([getWebView(self) _usesDocumentViews]) { + id documentView = [_private->webFrameView documentView]; + if ([documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _web_isDrawingIntoLayer]) + return NO; + } + + return [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap]; +} + - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly { ASSERT([[NSGraphicsContext currentContext] isFlipped]); @@ -546,7 +565,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) if (parentView) shouldFlatten = parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers; } else - shouldFlatten = WKCGContextIsBitmapContext(ctx) && [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap]; + shouldFlatten = [self _shouldFlattenCompositingLayers:ctx]; PaintBehavior oldBehavior = PaintBehaviorNormal; if (shouldFlatten) { @@ -1008,14 +1027,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) return _private->coreFrame->domWindow()->pendingUnloadEventListeners(); } -- (WebIconFetcher *)fetchApplicationIcon:(id)target - selector:(SEL)selector -{ - return [WebIconFetcher _fetchApplicationIconForFrame:self - target:target - selector:selector]; -} - - (void)_setIsDisconnected:(bool)isDisconnected { _private->coreFrame->setIsDisconnected(isDisconnected); diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h index 9cb6232..b0cb0f3 100644 --- a/WebKit/mac/WebView/WebFramePrivate.h +++ b/WebKit/mac/WebView/WebFramePrivate.h @@ -38,7 +38,6 @@ @class DOMDocumentFragment; @class DOMNode; @class DOMRange; -@class WebIconFetcher; @class WebScriptObject; @class WebScriptWorld; @@ -87,9 +86,6 @@ typedef enum { - (unsigned)_pendingFrameUnloadEventCount; -- (WebIconFetcher *)fetchApplicationIcon:(id)target - selector:(SEL)selector; - - (void)_setIsDisconnected:(bool)isDisconnected; - (void)_setExcludeFromTextSearch:(bool)exclude; diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 02d32d9..ec2473f 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -456,6 +456,7 @@ struct WebHTMLViewInterpretKeyEventsParameters { #if USE(ACCELERATED_COMPOSITING) NSView *layerHostingView; + BOOL drawingIntoLayer; #endif NSEvent *mouseDownEvent; // Kept after handling the event. @@ -2232,6 +2233,22 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) return _private->printing; } +- (BOOL)_beginPrintModeWithMinimumPageWidth:(CGFloat)minimumPageWidth height:(CGFloat)minimumPageHeight maximumPageWidth:(CGFloat)maximumPageWidth +{ + Frame* frame = core([self _frame]); + if (!frame) + return NO; + + if (frame->document() && frame->document()->isFrameSet()) { + minimumPageWidth = 0; + minimumPageHeight = 0; + maximumPageWidth = 0; + } + + [self _setPrinting:YES minimumPageWidth:minimumPageWidth height:minimumPageHeight maximumPageWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + return YES; +} + - (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit { Frame* frame = core([self _frame]); @@ -3401,6 +3418,9 @@ WEBCORE_COMMAND(yankAndSelect) [webView _setNeedsOneShotDrawingSynchronization:NO]; } #endif + + if (webView) + CallUIDelegate(webView, @selector(webView:didDrawFrame:), [self _frame]); } // Turn off the additional clip while computing our visibleRect. @@ -5552,6 +5572,14 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) [viewLayer setTransform:CATransform3DMakeScale(scaleFactor, scaleFactor, 1)]; #endif + if ([self layer]) { + // If we are in a layer-backed view, we need to manually initialize the geometry for our layer. + [viewLayer setBounds:NSRectToCGRect([_private->layerHostingView bounds])]; + [viewLayer setAnchorPoint:CGPointMake(0, [self isFlipped] ? 1 : 0)]; + CGPoint layerPosition = NSPointToCGPoint([self convertPointToBase:[_private->layerHostingView frame].origin]); + [viewLayer setPosition:layerPosition]; + } + [_private->layerHostingView setLayer:viewLayer]; [_private->layerHostingView setWantsLayer:YES]; @@ -5591,8 +5619,6 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) NSRect layerViewFrame = [self bounds]; if (layerViewFrame.size.height > maxHeight) { - CGFloat documentHeight = layerViewFrame.size.height; - // Clamp the size of the view to <= maxHeight to avoid the bug. layerViewFrame.size.height = maxHeight; NSRect visibleRect = [[self enclosingScrollView] documentVisibleRect]; @@ -5602,14 +5628,34 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) layerViewFrame.origin.y = topOffset; // Compensate for the moved view by adjusting the sublayer transform on the view's layer (using flipped coords). - CGFloat bottomOffset = documentHeight - layerViewFrame.size.height - topOffset; - [[_private->layerHostingView layer] setSublayerTransform:CATransform3DMakeTranslation(0, -bottomOffset, 0)]; + CATransform3D flipTransform = CATransform3DMakeTranslation(0, topOffset, 0); + flipTransform = CATransform3DScale(flipTransform, 1, -1, 1); + [[_private->layerHostingView layer] setSublayerTransform:flipTransform]; } [_private->layerHostingView _updateLayerGeometryFromView]; // Workaround for <rdar://problem/7071636> [_private->layerHostingView setFrame:layerViewFrame]; } #endif // defined(BUILDING_ON_LEOPARD) + +- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx +{ + if (_private) { + ASSERT(!_private->drawingIntoLayer); + _private->drawingIntoLayer = YES; + } + + [super drawLayer:layer inContext:ctx]; + + if (_private) + _private->drawingIntoLayer = NO; +} + +- (BOOL)_web_isDrawingIntoLayer +{ + return _private->drawingIntoLayer; +} + #endif // USE(ACCELERATED_COMPOSITING) @end diff --git a/WebKit/mac/WebView/WebHTMLViewInternal.h b/WebKit/mac/WebView/WebHTMLViewInternal.h index 2d9e2a9..07a782a 100644 --- a/WebKit/mac/WebView/WebHTMLViewInternal.h +++ b/WebKit/mac/WebView/WebHTMLViewInternal.h @@ -66,6 +66,7 @@ namespace WebCore { #if USE(ACCELERATED_COMPOSITING) - (void)attachRootLayer:(CALayer*)layer; - (void)detachRootLayer; +- (BOOL)_web_isDrawingIntoLayer; #endif #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD) diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h index e1d15dc..1218efc 100644 --- a/WebKit/mac/WebView/WebHTMLViewPrivate.h +++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h @@ -136,6 +136,9 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor; - (WebCGFloat)_adjustedBottomOfPageWithTop:(WebCGFloat)top bottom:(WebCGFloat)bottom limit:(WebCGFloat)bottomLimit; - (BOOL)_isInPrintMode; - (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit; +// Lays out to pages of the given minimum width and height or more (increasing both dimensions proportionally) +// as needed for the content to fit, but no more than the given maximum width. +- (BOOL)_beginPrintModeWithMinimumPageWidth:(WebCGFloat)minimumPageWidth height:(WebCGFloat)minimumPageHeight maximumPageWidth:(WebCGFloat)maximumPageWidth; - (void)_endPrintMode; - (BOOL)_isInScreenPaginationMode; diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h index 8119649..cd9ed8f 100644 --- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h +++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h @@ -96,6 +96,7 @@ #define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel" #define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime" #define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled" +#define WebKitSpatialNavigationEnabledPreferenceKey @"WebKitSpatialNavigationEnabled" #define WebKitPaginateDuringLayoutEnabledPreferenceKey @"WebKitPaginateDuringLayoutEnabled" #define WebKitDNSPrefetchingEnabledPreferenceKey @"WebKitDNSPrefetchingEnabled" #define WebKitFullScreenEnabledPreferenceKey @"WebKitFullScreenEnabled" diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 2ddd8b3..ccfb632 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -365,6 +365,7 @@ static WebCacheModel cacheModelForMainBundle(void) [NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey, [NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey, [NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey, + [NSNumber numberWithBool:NO], WebKitSpatialNavigationEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey, @@ -1313,6 +1314,16 @@ static NSString *classIBCreatorID = nil; [self _setBoolValue:flag forKey:WebKitFrameFlatteningEnabledPreferenceKey]; } +- (BOOL)isSpatialNavigationEnabled +{ + return [self _boolValueForKey:WebKitSpatialNavigationEnabledPreferenceKey]; +} + +- (void)setSpatialNavigationEnabled:(BOOL)flag +{ + [self _setBoolValue:flag forKey:WebKitSpatialNavigationEnabledPreferenceKey]; +} + - (BOOL)paginateDuringLayoutEnabled { return [self _boolValueForKey:WebKitPaginateDuringLayoutEnabledPreferenceKey]; diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h index bb525cd..47e6d71 100644 --- a/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -130,6 +130,9 @@ extern NSString *WebPreferencesRemovedNotification; - (BOOL)isFrameFlatteningEnabled; - (void)setFrameFlatteningEnabled:(BOOL)flag; +- (BOOL)isSpatialNavigationEnabled; +- (void)setSpatialNavigationEnabled:(BOOL)flag; + // zero means do AutoScale - (float)PDFScaleFactor; - (void)setPDFScaleFactor:(float)scale; diff --git a/WebKit/mac/WebView/WebSerializedJSValue.mm b/WebKit/mac/WebView/WebSerializedJSValue.mm index 05a316b..d993790 100644 --- a/WebKit/mac/WebView/WebSerializedJSValue.mm +++ b/WebKit/mac/WebView/WebSerializedJSValue.mm @@ -22,7 +22,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebSerializedJSValue.h" +#import "WebSerializedJSValuePrivate.h" #import <WebCore/SerializedScriptValue.h> #import <wtf/RefPtr.h> @@ -65,6 +65,30 @@ using namespace WebCore; return self; } +- (id)initWithInternalRepresentation:(void *)internalRepresenatation +{ + ASSERT_ARG(internalRepresenatation, internalRepresenatation); + + if (!internalRepresenatation) { + [self release]; + return nil; + } + + self = [super init]; + if (!self) + return nil; + + _private = [[WebSerializedJSValuePrivate alloc] init]; + + _private->value = ((SerializedScriptValue*)internalRepresenatation); + if (!_private->value) { + [self release]; + return nil; + } + + return self; +} + - (JSValueRef)deserialize:(JSContextRef)destinationContext { if (!_private || !_private->value) @@ -79,5 +103,12 @@ using namespace WebCore; [super dealloc]; } +- (void*)internalRepresentation +{ + if (!_private) + return 0; + return _private->value.get(); +} + @end diff --git a/WebKit/mac/WebView/WebSerializedJSValuePrivate.h b/WebKit/mac/WebView/WebSerializedJSValuePrivate.h new file mode 100644 index 0000000..217fe44 --- /dev/null +++ b/WebKit/mac/WebView/WebSerializedJSValuePrivate.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <WebKit/WebSerializedJSValue.h> + +@interface WebSerializedJSValue(WebPrivate) +- (id)initWithInternalRepresentation:(void*)internalRepresenatation; +- (void*)internalRepresentation; +@end diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h index 4565a4e..0b62bcb 100644 --- a/WebKit/mac/WebView/WebUIDelegatePrivate.h +++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h @@ -183,4 +183,6 @@ enum { - (void)webView:(WebView *)sender exitFullScreenForElement:(DOMElement *)element; #endif +- (void)webView:(WebView *)sender didDrawFrame:(WebFrame *)frame; + @end diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.h b/WebKit/mac/WebView/WebVideoFullscreenController.h index 3e7b6cf..69ba9f4 100644 --- a/WebKit/mac/WebView/WebVideoFullscreenController.h +++ b/WebKit/mac/WebView/WebVideoFullscreenController.h @@ -49,7 +49,8 @@ namespace WebCore { BOOL _isWindowLoaded; BOOL _forceDisableAnimation; uint32_t _idleDisplaySleepAssertion; - uint32_t _idleSystemSleepAssertion; + uint32_t _idleSystemSleepAssertion; + NSTimer *_tickleTimer; SystemUIMode _savedUIMode; SystemUIOptions _savedUIOptions; } diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm index 69ded78..1efb93f 100644 --- a/WebKit/mac/WebView/WebVideoFullscreenController.mm +++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm @@ -31,6 +31,7 @@ #import "WebVideoFullscreenHUDWindowController.h" #import "WebWindowAnimation.h" #import <IOKit/pwr_mgt/IOPMLib.h> +#import <OSServices/Power.h> #import <QTKit/QTKit.h> #import <WebCore/HTMLMediaElement.h> #import <WebCore/SoftLinking.h> @@ -43,6 +44,7 @@ SOFT_LINK_CLASS(QTKit, QTMovieLayer) SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) #define QTMovieRateDidChangeNotification getQTMovieRateDidChangeNotification() +static const NSTimeInterval tickleTimerInterval = 1.0; @interface WebVideoFullscreenWindow : NSWindow #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) @@ -82,6 +84,9 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) { ASSERT(!_backgroundFullscreenWindow); ASSERT(!_fadeAnimation); + [_tickleTimer invalidate]; + [_tickleTimer release]; + _tickleTimer = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } @@ -378,6 +383,25 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) _idleSystemSleepAssertion = kIOPMNullAssertionID; } } + +- (void)_enableTickleTimer +{ + [_tickleTimer invalidate]; + [_tickleTimer release]; + _tickleTimer = [[NSTimer scheduledTimerWithTimeInterval:tickleTimerInterval target:self selector:@selector(_tickleTimerFired) userInfo:nil repeats:YES] retain]; +} + +- (void)_disableTickleTimer +{ + [_tickleTimer invalidate]; + [_tickleTimer release]; + _tickleTimer = nil; +} + +- (void)_tickleTimerFired +{ + UpdateSystemActivity(OverallAct); +} #endif - (void)updatePowerAssertions @@ -390,9 +414,11 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) if (rate && !_isEndingFullscreen) { [self _disableIdleSystemSleep]; [self _disableIdleDisplaySleep]; + [self _disableTickleTimer]; } else { [self _enableIdleSystemSleep]; [self _enableIdleDisplaySleep]; + [self _enableTickleTimer]; } #endif } diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 1fca8d1..9b267ef 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -190,7 +190,7 @@ #import <WebCore/GeolocationError.h> #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) #import <glib.h> #endif @@ -385,7 +385,7 @@ static const char webViewIsOpen[] = "At least one WebView is still open."; #if USE(ACCELERATED_COMPOSITING) - (void)_clearLayerSyncLoopObserver; #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) - (void)_clearGlibLoopObserver; #endif @end @@ -637,6 +637,19 @@ static bool shouldEnableLoadDeferring() return _private->usesDocumentViews; } +static NSString *leakMailQuirksUserScriptPath() +{ + NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"]; + return [[NSString alloc] initWithContentsOfFile:scriptPath]; +} + +- (void)_injectMailQuirksScript +{ + static NSString *mailQuirksScriptPath = leakMailQuirksUserScriptPath(); + core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), + mailQuirksScriptPath, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); +} + - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews { WebCoreThreadViolationCheckRoundTwo(); @@ -750,10 +763,12 @@ static bool shouldEnableLoadDeferring() if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS)) ResourceHandle::forceContentSniffing(); -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) [self _scheduleGlibContextIterations]; #endif + if (runningTigerMail() || runningLeopardMail()) + [self _injectMailQuirksScript]; } - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews @@ -1151,7 +1166,7 @@ static bool fastDocumentTeardownEnabled() [self _clearLayerSyncLoopObserver]; #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) [self _clearGlibLoopObserver]; #endif @@ -1472,6 +1487,7 @@ static bool fastDocumentTeardownEnabled() settings->setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]); settings->setLoadDeferringEnabled(shouldEnableLoadDeferring()); settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]); + settings->setSpatialNavigationEnabled([preferences isSpatialNavigationEnabled]); settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]); #if ENABLE(FULLSCREEN_API) settings->setFullScreenEnabled([preferences fullScreenEnabled]); @@ -5632,7 +5648,7 @@ static WebFrameView *containingFrameView(NSView *view) } #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) - (void)_clearGlibLoopObserver { if (!_private->glibRunLoopObserver) @@ -5955,7 +5971,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*) { diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h index 9aa91dc..639c3e0 100644 --- a/WebKit/mac/WebView/WebViewData.h +++ b/WebKit/mac/WebView/WebViewData.h @@ -172,7 +172,7 @@ extern int pluginDatabaseClientCount; WebVideoFullscreenController *fullscreenController; #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) CFRunLoopObserverRef glibRunLoopObserver; #endif id<WebGeolocationProvider> _geolocationProvider; diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h index 71a2660..0a6f462 100644 --- a/WebKit/mac/WebView/WebViewInternal.h +++ b/WebKit/mac/WebView/WebViewInternal.h @@ -88,7 +88,7 @@ namespace WebCore { - (void)_scheduleCompositingLayerSync; #endif -#if ENABLE(VIDEO) && USE(GSTREAMER) +#if ENABLE(GLIB_SUPPORT) - (void)_scheduleGlibContextIterations; #endif |