summaryrefslogtreecommitdiffstats
path: root/WebKit/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac')
-rw-r--r--WebKit/mac/ChangeLog441
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/DOM/WebDOMOperations.mm4
-rw-r--r--WebKit/mac/MigrateHeaders.make1
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm20
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h7
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.m16
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm2
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginStream.mm2
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm2
-rw-r--r--WebKit/mac/Plugins/WebPluginContainerCheck.mm2
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm20
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.h7
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm67
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm5
-rw-r--r--WebKit/mac/WebView/WebDashboardRegion.h51
-rw-r--r--WebKit/mac/WebView/WebDashboardRegion.mm93
-rw-r--r--WebKit/mac/WebView/WebFrame.mm69
-rw-r--r--WebKit/mac/WebView/WebFrameInternal.h2
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm65
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm116
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h2
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm32
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h8
-rw-r--r--WebKit/mac/WebView/WebView.mm79
-rw-r--r--WebKit/mac/WebView/WebViewData.h1
-rw-r--r--WebKit/mac/WebView/WebViewData.mm1
29 files changed, 906 insertions, 215 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index df5ca46..a43b4c5 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,444 @@
+2010-09-20 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (HTML5 Parser): Pages broken due to <tag<tag> parsing changes
+ https://bugs.webkit.org/show_bug.cgi?id=40961
+
+ Implement WebKitUsePreHTML5ParserQuirks preference.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Default WebKitUsePreHTML5ParserQuirks to
+ false.
+ (-[WebPreferences usePreHTML5ParserQuirks]):
+ (-[WebPreferences setUsePreHTML5ParserQuirks:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Update WebCore::Settings
+ with the value of WebKitUsePreHTML5ParserQuirks when a preference
+ changes.
+
+2010-09-20 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Pasteboard doesn't work in WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=42317
+ <rdar://problem/7660537>
+
+ Some changes to fix style inconsistencies.
+ Added OBJC 2.0 style enumeration.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::userVisibleString):
+ (createExcludedElementsForAttributedStringConversion):
+ (WebEditorClient::documentFragmentFromAttributedString): Changed parameter to be
+ a Vector of RefPtr.
+ (WebEditorClient::setInsertionPasteboard):
+ (WebEditorClient::pasteboardTypesForSelection):
+
+2010-09-17 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45993, convert printing to the new pagination model.
+
+ Make printing store the page height in the RenderView and push that into the layout state to
+ use the new pagination model. The old pagination model is retained because it is still used
+ for embedded WebViews.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]):
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * WebView/WebView.mm:
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+ Call functions on Frame instead of FrameView.
+
+2010-09-17 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView/WebView.mm: Added in a call to set the mimimum allowed DOMTimer to 4ms.
+
+2010-09-17 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Add WebKitAccelerated2dCanvasEnabled flag to WebKit for Mac
+ https://bugs.webkit.org/show_bug.cgi?id=45911
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences accelerated2dCanvasEnabled]):
+ (-[WebPreferences setAccelerated2dCanvasEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-09-17 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit should use system wide spell checking preference when application specific one isn't set.
+ https://bugs.webkit.org/show_bug.cgi?id=45789
+ <rdar://problem/8416041>
+
+ * WebView/WebView.mm:
+ (+[WebView initialize]): Use system wide autocorrection and text substitution preferences
+ when the application level preferences are not set.
+
+2010-09-16 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/8395558>
+ https://bugs.webkit.org/show_bug.cgi?id=45938
+ _web_makePluginViewsPerformSelector:: mutates subviews array while iterating it
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _web_makePluginSubviewsPerformSelector:withObject:]):
+ Converted from -[NSArray _web_makePluginViewsPerformSelector:withObject:]. The old method
+ was only ever called on the result of -[WebHTMLView subviews]. By moving that knowledge into
+ this helper method, it can't be used incorrectly. Now it makes a copy of [WebHTMLView subviews]
+ before enumerating it, to ensure that the selector can't mutate the array being enumerated.
+ (-[WebHTMLView viewWillMoveToHostWindow:]):
+ Updated for _web_makePluginSubviewsPerformSelector:: signature change.
+ (-[WebHTMLView viewDidMoveToHostWindow]):
+ Ditto.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation elementDoesAutoComplete:]): Use isPasswordField.
+ (-[WebHTMLRepresentation elementIsPassword:]): Use isPasswordField.
+
+2010-09-16 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Always use a valid string when setting WebKitUserStyleSheetLocationPreferenceKey.
+ https://bugs.webkit.org/show_bug.cgi?id=41510
+
+ This prevents usage of nil value, which would cause an uncaught exception.
+
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences setUserStyleSheetLocation:]):
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Reverted the previous change because r67628 has been reverted.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Build fix after r67628. Added context menu item localizable strings for the items
+ added in r67628, following equivalent menu items in Mac OS X when possible. However,
+ this set of menu items does not make much sense for Mac OS X, and this should be
+ addressed separately.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::contextMenuItemTagOpenMediaInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay):
+ (WebPlatformStrategies::contextMenuItemTagMediaPause):
+ (WebPlatformStrategies::contextMenuItemTagMediaMute):
+ (WebPlatformStrategies::contextMenuItemTagMediaUnMute):
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44715
+ maps.google.com flips upside down when zooming map using trackpad in WebKit2 on Mac
+
+ Move geometry flipping to platform-specific code.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView attachRootLayer:]):
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
+ which provides an inteface to query whether autocorrection panel is shown.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
+ for invalid correction panel tag. Replaced -1 with this constant.
+ (WebEditorClient::dismissCorrectionPanel): Ditto
+ (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
+
+2010-09-14 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Part of <rdar://problem/8420003>. Make it possible to override the version number used in linked-in-or-after checks.
+
+ * Misc/WebKitVersionChecks.h: Remove two unused functions from the header and add a method to set the overriden version.
+ * Misc/WebKitVersionChecks.m:
+ (WebKitLinkedOnOrAfter):
+ (setWebKitLinkTimeVersion): Set the overridden version.
+ (WebKitLinkTimeVersion): Return the overridden version if set, otherwise do the old thing.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences setWebKitLinkTimeVersion:]): Call through to set the overridden version.
+ * WebView/WebPreferencesPrivate.h:
+
+2010-09-14 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, reverting changes r67451 and r67451.
+ Broke lots of builders.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient):
+ (WebEditorClient::dismissCorrectionPanel):
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
+ which provides an inteface to query whether autocorrection panel is shown.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
+ for invalid correction panel tag. Replaced -1 with this constant.
+ (WebEditorClient::dismissCorrectionPanel): Ditto
+ (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
+
+2010-09-13 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Preparation for eliminating deprecatedParseURL
+ https://bugs.webkit.org/show_bug.cgi?id=45695
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMDocument webFrame]): Get rid of unneeded local variable.
+ (-[DOMDocument URLWithAttributeString:]): Remove unhelpful comment.
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (excludedElementsForAttributedStringConversion):
+ (WebEditorClient::documentFragmentFromAttributedString): Added.
+ (WebEditorClient::setInsertionPasteboard):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::canShowMIMETypeAsHTML): Re-implemented at the level
+ of the editor client.
+ * WebView/WebHTMLView.mm: Removed paste method.
+
+2010-09-13 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45677
+ [WebView canMarkAllTextMatches] can crash if called after [WebView close]
+
+ <rdar://problem/8404890>
+
+ * WebView/WebView.mm:
+ (-[WebView canMarkAllTextMatches]):
+ Return NO immediately if the webview has already been closed. This was an overlooked
+ case from the fix for 45175.
+
+2010-09-10 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Moved the actual logic of hasSpellingMarker into WebCore to share
+ it with other ports.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame hasSpellingMarker:length:]):
+
+2010-09-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ Make SecurityOrigin::canDisplay an instance function
+ https://bugs.webkit.org/show_bug.cgi?id=45219
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::loadRequest):
+ * Plugins/WebNetscapePluginStream.mm:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ * Plugins/WebPluginContainerCheck.mm:
+ (-[WebPluginContainerCheck _isForbiddenFileLoad]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _allowsFollowingLink:]):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+ (-[WebView _realZoomMultiplierIsTextOnly]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewData.mm:
+ (-[WebViewPrivate init]):
+ Move tracking of text only zoom here from WebCore.
+
+2010-09-10 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Refactor JavaScriptCore memory statistics so that WebKit doesn't need to know about the JIT and
+ other implementation details of JavaScriptCore. Necessary to fix PPC build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45528
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics memoryStatistics]):
+
+2010-09-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move some Dashboard stuff from WebCore to WebKit along with a bit more FrameMac cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45582
+
+ * MigrateHeaders.make: Removed WebDashboardRegion.h from the set of header to copy.
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::dashboardRegionsChanged): Changed this to call
+ -[WebView _dashboardRegions] so we don't have two copies of that code.
+
+ * WebView/WebDashboardRegion.h: Copied from WebCore/page/mac/WebDashboardRegion.h.
+ * WebView/WebDashboardRegion.mm: Copied from WebCore/page/mac/WebDashboardRegion.m.
+
+ * WebView/WebView.mm:
+ (-[WebView _dashboardRegions]): Moved the code from Frame::dashboardRegions here.
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code is the most confused, but now should be a bit cleaner.
+ There's still a magical fake-setting for creating renderers that needs
+ to be cleaned up, but we can do that in a separate patch.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _commitData:]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation receivedData:withDataSource:]):
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+
+2010-09-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to SelectionController as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45508
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _selectionGranularity]):
+ (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
+ (-[WebFrame _typingStyle]):
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation currentForm]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView jumpToSelection:]):
+ (-[WebHTMLView centerSelectionInVisibleArea:]):
+ (-[WebHTMLView _canSmartCopyOrDelete]):
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+ (-[WebHTMLView selectionRect]):
+ (-[WebHTMLView selectionTextRects]):
+ (-[WebHTMLView selectionImageRect]):
+ * WebView/WebView.mm:
+ (-[WebView setEditable:]):
+ Call functions on selection().
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ Previously, we were checking the document for null. However, Frame can
+ never have a null document, so this check is no longer needed.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _addData:]):
+
2010-09-09 John Therrell <jtherrell@apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 8f8c213..81d912f 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -69,7 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME));
ENABLE_FILTERS_macosx = ENABLE_FILTERS;
-ENABLE_FILE_WRITER = ;
ENABLE_FILE_SYSTEM = ;
ENABLE_FULLSCREEN_API = ENABLE_FULLSCREEN_API;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
@@ -121,4 +120,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_WRITER) $(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_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 9f9441c..67bf769 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 = 8;
+MINOR_VERSION = 9;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm
index d21f2b0..3d69836 100644
--- a/WebKit/mac/DOM/WebDOMOperations.mm
+++ b/WebKit/mac/DOM/WebDOMOperations.mm
@@ -121,8 +121,7 @@ using namespace JSC;
- (WebFrame *)webFrame
{
- Document* document = core(self);
- Frame* frame = document->frame();
+ Frame* frame = core(self)->frame();
if (!frame)
return nil;
return kit(frame);
@@ -130,7 +129,6 @@ using namespace JSC;
- (NSURL *)URLWithAttributeString:(NSString *)string
{
- // FIXME: Is deprecatedParseURL appropriate here?
return core(self)->completeURL(deprecatedParseURL(string));
}
diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make
index 83e2e08..2e6f24a 100644
--- a/WebKit/mac/MigrateHeaders.make
+++ b/WebKit/mac/MigrateHeaders.make
@@ -180,7 +180,6 @@ all : \
$(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathNSResolver.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathResult.h \
- $(PRIVATE_HEADERS_DIR)/WebDashboardRegion.h \
$(PUBLIC_HEADERS_DIR)/WebScriptObject.h \
$(PUBLIC_HEADERS_DIR)/npapi.h \
$(PUBLIC_HEADERS_DIR)/npfunctions.h \
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index cc68cef..5b5a1bc 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -29,11 +29,10 @@
#import "WebCoreStatistics.h"
#import "DOMElementInternal.h"
-#import <JavaScriptCore/RegisterFile.h>
-#import <JavaScriptCore/ExecutableAllocator.h>
#import "WebCache.h"
#import "WebFrameInternal.h"
-#import <runtime/JSLock.h>
+#import <JavaScriptCore/JSLock.h>
+#import <JavaScriptCore/MemoryStatistics.h>
#import <WebCore/Console.h>
#import <WebCore/FontCache.h>
#import <WebCore/Frame.h>
@@ -196,18 +195,19 @@ using namespace WebCore;
+ (NSDictionary *)memoryStatistics
{
WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics();
+
JSLock lock(SilenceAssertionsOnly);
- Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
- size_t jscStackBytes = RegisterFile::committedByteCount();
- size_t jscJITBytes = ExecutableAllocator::committedByteCount();
+ Heap::Statistics heapMemoryStats = heapStatistics(JSDOMWindow::commonJSGlobalData());
+ GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
+
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes",
- [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize",
- [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize",
- [NSNumber numberWithUnsignedInt:(unsigned int)jscStackBytes], @"JavaScriptStackSize",
- [NSNumber numberWithUnsignedInt:(unsigned int)jscJITBytes], @"JavaScriptJITSize",
+ [NSNumber numberWithInt:heapMemoryStats.size], @"JavaScriptHeapSize",
+ [NSNumber numberWithInt:heapMemoryStats.free], @"JavaScriptFreeSize",
+ [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.stackBytes], @"JavaScriptStackSize",
+ [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.JITBytes], @"JavaScriptJITSize",
nil];
}
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 8b34c94..94286d6 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -30,9 +30,9 @@
Version numbers are based on the 'current library version' specified in the WebKit build rules.
All of these methods return or take version numbers with each part shifted to the left 2 bytes.
For example the version 1.2.3 is returned as 0x00010203 and version 200.3.5 is returned as 0x00C80305
- A version of -1 is returned if the main executable did not link against WebKit (should never happen).
+ A version of -1 is returned if the main executable did not link against WebKit.
- Please use the current WebKit version number, available in WebKit/Configurations/Version.xcconfig,
+ Please use the current WebKit version number, available in WebKit/mac/Configurations/Version.xcconfig,
when adding a new version constant.
*/
@@ -60,8 +60,7 @@ extern "C" {
#endif
BOOL WebKitLinkedOnOrAfter(int version);
-int WebKitLinkTimeVersion(void);
-int WebKitRunTimeVersion(void);
+void setWebKitLinkTimeVersion(int);
#ifdef __cplusplus
}
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.m b/WebKit/mac/Misc/WebKitVersionChecks.m
index 5659273..a63e10b 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.m
+++ b/WebKit/mac/Misc/WebKitVersionChecks.m
@@ -29,17 +29,23 @@
#import "WebKitVersionChecks.h"
#import <mach-o/dyld.h>
+static int WebKitLinkTimeVersion(void);
+static int overridenWebKitLinkTimeVersion;
+
BOOL WebKitLinkedOnOrAfter(int version)
{
- return (WebKitLinkTimeVersion() >= version);
+ return (WebKitLinkTimeVersion() >= version);
}
-int WebKitLinkTimeVersion(void)
+void setWebKitLinkTimeVersion(int version)
{
- return NSVersionOfLinkTimeLibrary("WebKit");
+ overridenWebKitLinkTimeVersion = version;
}
-int WebKitRunTimeVersion(void)
+static int WebKitLinkTimeVersion(void)
{
- return NSVersionOfRunTimeLibrary("WebKit");
+ if (overridenWebKitLinkTimeVersion)
+ return overridenWebKitLinkTimeVersion;
+
+ return NSVersionOfLinkTimeLibrary("WebKit");
}
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 88df4cf..c0c480b 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -762,7 +762,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
return NPERR_GENERIC_ERROR;
}
} else {
- if (!SecurityOrigin::canDisplay(URL, String(), core([m_pluginView webFrame])->document()))
+ if (!core([m_pluginView webFrame])->document()->securityOrigin()->canDisplay(URL))
return NPERR_GENERIC_ERROR;
}
diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.mm b/WebKit/mac/Plugins/WebNetscapePluginStream.mm
index 35af439..f39b104 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginStream.mm
@@ -161,7 +161,7 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
WebNetscapePluginView *view = (WebNetscapePluginView *)plugin->ndata;
// This check has already been done by the plug-in view.
- ASSERT(SecurityOrigin::canDisplay([request URL], String(), core([view webFrame])->document()));
+ ASSERT(core([view webFrame])->document()->securityOrigin()->canDisplay([request URL]));
ASSERT([request URL]);
ASSERT(plugin);
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index e98c6b7..3d5d7a1 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -1728,7 +1728,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return NPERR_INVALID_PARAM;
}
} else {
- if (!SecurityOrigin::canDisplay(URL, String(), core([self webFrame])->document()))
+ if (!core([self webFrame])->document()->securityOrigin()->canDisplay(URL))
return NPERR_GENERIC_ERROR;
}
diff --git a/WebKit/mac/Plugins/WebPluginContainerCheck.mm b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
index e273bfc..30368a8 100644
--- a/WebKit/mac/Plugins/WebPluginContainerCheck.mm
+++ b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
@@ -99,7 +99,7 @@ using namespace WebCore;
{
Frame* coreFrame = core([_controller webFrame]);
ASSERT(coreFrame);
- if (!SecurityOrigin::canDisplay([_request URL], String(), coreFrame->document())) {
+ if (!coreFrame->document()->securityOrigin()->canDisplay([_request URL])) {
[self _continueWithPolicy:PolicyIgnore];
return YES;
}
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index d973e2b..68e17be 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -71,8 +71,6 @@
#import <wtf/PassRefPtr.h>
#import <wtf/Vector.h>
-
-
#if USE(ACCELERATED_COMPOSITING)
#import <WebCore/GraphicsLayer.h>
#endif
@@ -111,6 +109,7 @@ using namespace WebCore;
@end
#if ENABLE(FULLSCREEN_API)
+
@interface WebKitFullScreenListener : NSObject <WebKitFullScreenListener>
{
RefPtr<Element> _element;
@@ -118,6 +117,7 @@ using namespace WebCore;
- (id)initWithElement:(Element*)element;
@end
+
#endif
WebChromeClient::WebChromeClient(WebView *webView)
@@ -564,6 +564,7 @@ void WebChromeClient::print(Frame* frame)
}
#if ENABLE(DATABASE)
+
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -579,9 +580,11 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+
void WebChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded)
{
// FIXME: Free some space.
@@ -597,6 +600,7 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
void WebChromeClient::populateVisitedLinks()
@@ -616,17 +620,14 @@ void WebChromeClient::populateVisitedLinks()
}
#if ENABLE(DASHBOARD_SUPPORT)
+
void WebChromeClient::dashboardRegionsChanged()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
- NSMutableDictionary *regions = core([m_webView mainFrame])->dashboardRegionsDictionary();
- [m_webView _addScrollerDashboardRegions:regions];
-
- CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), regions);
-
+ CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), [m_webView _dashboardRegions]);
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
FloatRect WebChromeClient::customHighlightRect(Node* node, const AtomicString& type, const FloatRect& lineRect)
@@ -954,7 +955,9 @@ void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geoloca
@end
#if ENABLE(FULLSCREEN_API)
+
@implementation WebKitFullScreenListener
+
- (id)initWithElement:(Element*)element
{
if (!(self = [super init]))
@@ -989,4 +992,5 @@ void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geoloca
}
@end
+
#endif
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index fe33e05..ad324b9 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -70,9 +70,11 @@ public:
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
- virtual NSString* userVisibleString(NSURL*);
+ virtual NSString* userVisibleString(NSURL *);
+ virtual WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource> >&);
+ virtual void setInsertionPasteboard(NSPasteboard *);
#ifdef BUILDING_ON_TIGER
- virtual NSArray* pasteboardTypesForSelection(WebCore::Frame*);
+ virtual NSArray *pasteboardTypesForSelection(WebCore::Frame*);
#endif
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
@@ -133,6 +135,7 @@ public:
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*);
virtual void dismissCorrectionPanel(bool correctionAccepted);
+ virtual bool isShowingCorrectionPanel();
#endif
private:
void registerCommandForUndoOrRedo(PassRefPtr<WebCore::EditCommand>, bool isRedo);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index 41cff68..2bf3259 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -30,6 +30,7 @@
#import "WebEditorClient.h"
#import "DOMCSSStyleDeclarationInternal.h"
+#import "DOMDocumentFragmentInternal.h"
#import "DOMHTMLElementInternal.h"
#import "DOMHTMLInputElementInternal.h"
#import "DOMHTMLTextAreaElementInternal.h"
@@ -48,8 +49,11 @@
#import "WebKitVersionChecks.h"
#import "WebLocalizableStrings.h"
#import "WebNSURLExtras.h"
+#import "WebResourceInternal.h"
#import "WebViewInternal.h"
+#import <WebCore/ArchiveResource.h>
#import <WebCore/Document.h>
+#import <WebCore/DocumentFragment.h>
#import <WebCore/EditAction.h>
#import <WebCore/EditCommand.h>
#import <WebCore/HTMLInputElement.h>
@@ -73,11 +77,18 @@ using namespace WTF;
using namespace HTMLNames;
+@interface NSAttributedString (WebNSAttributedStringDetails)
+- (id)_initWithDOMRange:(DOMRange*)range;
+- (DOMDocumentFragment*)_documentFromRange:(NSRange)range document:(DOMDocument*)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
+@end
+
static WebViewInsertAction kit(EditorInsertAction coreAction)
{
return static_cast<WebViewInsertAction>(coreAction);
}
+static const int InvalidCorrectionPanelTag = 0;
+
#ifdef BUILDING_ON_TIGER
@interface NSSpellChecker (NotYetPublicMethods)
- (void)learnWord:(NSString *)word;
@@ -175,7 +186,7 @@ WebEditorClient::WebEditorClient(WebView *webView)
, m_undoTarget([[[WebEditorUndoTarget alloc] init] autorelease])
, m_haveUndoRedoOperations(false)
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- , m_correctionPanelTag(-1)
+ , m_correctionPanelTag(InvalidCorrectionPanelTag)
#endif
{
}
@@ -325,13 +336,54 @@ void WebEditorClient::didSetSelectionTypesForPasteboard()
[[m_webView _editingDelegateForwarder] webView:m_webView didSetSelectionTypesForPasteboard:[NSPasteboard generalPasteboard]];
}
-NSString* WebEditorClient::userVisibleString(NSURL *URL)
+NSString *WebEditorClient::userVisibleString(NSURL *URL)
{
return [URL _web_userVisibleString];
}
+static NSArray *createExcludedElementsForAttributedStringConversion()
+{
+ NSArray *elements = [[NSArray alloc] initWithObjects:
+ // Omit style since we want style to be inline so the fragment can be easily inserted.
+ @"style",
+ // Omit xml so the result is not XHTML.
+ @"xml",
+ // Omit tags that will get stripped when converted to a fragment anyway.
+ @"doctype", @"html", @"head", @"body",
+ // Omit deprecated tags.
+ @"applet", @"basefont", @"center", @"dir", @"font", @"isindex", @"menu", @"s", @"strike", @"u",
+ // Omit object so no file attachments are part of the fragment.
+ @"object", nil];
+ CFRetain(elements);
+ return elements;
+}
+
+DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString *string, Vector<RefPtr<ArchiveResource> >& resources)
+{
+ static NSArray *excludedElements = createExcludedElementsForAttributedStringConversion();
+
+ NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: excludedElements, NSExcludedElementsDocumentAttribute,
+ nil, @"WebResourceHandler", nil];
+
+ NSArray *subResources;
+ DOMDocumentFragment* fragment = [string _documentFromRange:NSMakeRange(0, [string length])
+ document:[[m_webView mainFrame] DOMDocument]
+ documentAttributes:dictionary
+ subresources:&subResources];
+ for (WebResource* resource in subResources)
+ resources.append([resource _coreResource]);
+
+ [dictionary release];
+ return core(fragment);
+}
+
+void WebEditorClient::setInsertionPasteboard(NSPasteboard *pasteboard)
+{
+ [m_webView _setInsertionPasteboard:pasteboard];
+}
+
#ifdef BUILDING_ON_TIGER
-NSArray* WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
+NSArray *WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
{
WebFrame* frame = kit(selectedFrame);
return [[[frame frameView] documentView] pasteboardTypesForSelection];
@@ -829,11 +881,16 @@ void WebEditorClient::showCorrectionPanel(const FloatRect& boundingBoxOfReplaced
void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted)
{
- if (m_correctionPanelTag >= 0) {
+ if (m_correctionPanelTag != InvalidCorrectionPanelTag) {
[[NSSpellChecker sharedSpellChecker] dismissCorrection:m_correctionPanelTag acceptCorrection:correctionAccepted];
- m_correctionPanelTag = -1;
+ m_correctionPanelTag = InvalidCorrectionPanelTag;
}
}
+
+bool WebEditorClient::isShowingCorrectionPanel()
+{
+ return m_correctionPanelTag != InvalidCorrectionPanelTag;
+}
#endif
void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index cbb89ec..447c515 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -177,6 +177,7 @@ private:
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const WTF::String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const;
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index dcbca28..a398ef7 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1018,6 +1018,11 @@ bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const
return [getWebView(m_webFrame.get()) _canShowMIMEType:MIMEType];
}
+bool WebFrameLoaderClient::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ return [WebView canShowMIMETypeAsHTML:MIMEType];
+}
+
bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const
{
return [WebView _representationExistsForURLScheme:URLScheme];
diff --git a/WebKit/mac/WebView/WebDashboardRegion.h b/WebKit/mac/WebView/WebDashboardRegion.h
new file mode 100644
index 0000000..4963d04
--- /dev/null
+++ b/WebKit/mac/WebView/WebDashboardRegion.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2004 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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 COMPUTER, 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.
+ */
+
+#if !defined(ENABLE_DASHBOARD_SUPPORT)
+#define ENABLE_DASHBOARD_SUPPORT 1
+#endif
+
+#if ENABLE_DASHBOARD_SUPPORT
+
+typedef enum {
+ WebDashboardRegionTypeNone,
+ WebDashboardRegionTypeCircle,
+ WebDashboardRegionTypeRectangle,
+ WebDashboardRegionTypeScrollerRectangle
+} WebDashboardRegionType;
+
+@interface WebDashboardRegion : NSObject <NSCopying>
+{
+ NSRect rect;
+ NSRect clip;
+ WebDashboardRegionType type;
+}
+- initWithRect:(NSRect)rect clip:(NSRect)clip type:(WebDashboardRegionType)type;
+- (NSRect)dashboardRegionClip;
+- (NSRect)dashboardRegionRect;
+- (WebDashboardRegionType)dashboardRegionType;
+@end
+
+#endif
diff --git a/WebKit/mac/WebView/WebDashboardRegion.mm b/WebKit/mac/WebView/WebDashboardRegion.mm
new file mode 100644
index 0000000..c44977a
--- /dev/null
+++ b/WebKit/mac/WebView/WebDashboardRegion.mm
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2004 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 COMPUTER, 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 COMPUTER, 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 "WebDashboardRegion.h"
+
+#import <wtf/UnusedParam.h>
+
+#if ENABLE(DASHBOARD_SUPPORT)
+
+@implementation WebDashboardRegion
+
+- initWithRect:(NSRect)r clip:(NSRect)c type:(WebDashboardRegionType)t
+{
+ self = [super init];
+ rect = r;
+ clip = c;
+ type = t;
+ return self;
+}
+
+- (id)copyWithZone:(NSZone *)unusedZone
+{
+ UNUSED_PARAM(unusedZone);
+
+ return [self retain];
+}
+
+- (NSRect)dashboardRegionClip
+{
+ return clip;
+}
+
+- (NSRect)dashboardRegionRect
+{
+ return rect;
+}
+
+- (WebDashboardRegionType)dashboardRegionType
+{
+ return type;
+}
+
+static const char* typeName(WebDashboardRegionType type)
+{
+ switch (type) {
+ case WebDashboardRegionTypeNone:
+ return "None";
+ case WebDashboardRegionTypeCircle:
+ return "Circle";
+ case WebDashboardRegionTypeRectangle:
+ return "Rectangle";
+ case WebDashboardRegionTypeScrollerRectangle:
+ return "ScrollerRectangle";
+ }
+ return "Unknown";
+}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"rect:%@ clip:%@ type:%s", NSStringFromRect(rect), NSStringFromRect(clip), typeName(type)];
+}
+
+// FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into a NSSet or is the key in an NSDictionary.
+- (BOOL)isEqual:(id)other
+{
+ return NSEqualRects(rect, [other dashboardRegionRect]) && NSEqualRects(clip, [other dashboardRegionClip]) && type == [other dashboardRegionType];
+}
+
+@end
+
+#endif
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 8d564a3..02696f4 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -487,21 +487,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return dataSource(_private->coreFrame->loader()->documentLoader());
}
-- (void)_addData:(NSData *)data
-{
- Document* document = _private->coreFrame->document();
-
- // Document may be nil if the part is about to redirect
- // as a result of JS executing during load, i.e. one frame
- // changing another's location before the frame's document
- // has been created.
- if (!document)
- return;
-
- document->setShouldCreateRenderers(_private->shouldCreateRenderers);
- _private->coreFrame->loader()->addData((const char *)[data bytes], [data length]);
-}
-
- (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString
{
return _private->coreFrame->documentTypeString() + markupString;
@@ -715,7 +700,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (TextGranularity)_selectionGranularity
{
- return _private->coreFrame->selectionGranularity();
+ return _private->coreFrame->selection()->granularity();
}
- (NSRange)_convertToNSRange:(Range *)range
@@ -859,7 +844,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return;
TypingCommand::insertParagraphSeparatorInQuotedContent(_private->coreFrame->document());
- _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
- (VisiblePosition)_visiblePositionForPoint:(NSPoint)point
@@ -895,9 +880,9 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (DOMCSSStyleDeclaration *)_typingStyle
{
- if (!_private->coreFrame || !_private->coreFrame->typingStyle())
+ if (!_private->coreFrame || !_private->coreFrame->selection()->typingStyle())
return nil;
- return kit(_private->coreFrame->typingStyle()->copy().get());
+ return kit(_private->coreFrame->selection()->typingStyle()->copy().get());
}
- (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
@@ -942,15 +927,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return [self _canProvideDocumentSource];
}
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
+- (void)_commitData:(NSData *)data
{
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncodingName;
- _private->coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
- [self _addData:data];
+ // FIXME: This really should be a setting.
+ Document* document = _private->coreFrame->document();
+ document->setShouldCreateRenderers(_private->shouldCreateRenderers);
+
+ _private->coreFrame->loader()->documentLoader()->commitData((const char *)[data bytes], [data length]);
}
@end
@@ -1167,7 +1150,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return;
applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), core(fragment), selectReplacement, smartReplace, matchStyle));
- _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
@@ -1282,7 +1265,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
{
if (!_private->coreFrame)
return YES;
- return SecurityOrigin::canDisplay(URL, String(), _private->coreFrame->document());
+ return _private->coreFrame->document()->securityOrigin()->canDisplay(URL);
}
- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string withGlobalObject:(JSObjectRef)globalObjectRef inScriptWorld:(WebScriptWorld *)world
@@ -1366,38 +1349,12 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return coreFrame->layerTreeAsText();
}
-static Node* spellingNode(Frame* coreFrame)
-{
- Node* focusedNode = coreFrame->selection()->start().node();
- if (!focusedNode || !focusedNode->renderer())
- return 0;
-
- for (const RenderObject* renderer = focusedNode->renderer(); renderer; renderer = renderer->childAt(0)) {
- if (renderer->isText())
- return renderer->node();
- }
- return 0;
-}
-
- (BOOL)hasSpellingMarker:(int)from length:(int)length
{
Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return NO;
-
- Node* node = spellingNode(coreFrame);
- if (!node)
- return NO;
-
- unsigned int startOffset = static_cast<unsigned int>(from);
- unsigned int endOffset = static_cast<unsigned int>(from + length);
- Vector<DocumentMarker> markers = coreFrame->document()->markers()->markersForNode(node);
- for (size_t i = 0; i < markers.size(); ++i) {
- DocumentMarker marker = markers[i];
- if (marker.startOffset <= startOffset && endOffset <= marker.endOffset && marker.type == DocumentMarker::Spelling)
- return YES;
- }
- return NO;
+ return coreFrame->editor()->selectionStartHasSpellingMarkerFor(from, length);
}
@end
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index dc3de21..8cdc272 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -162,7 +162,7 @@ WebView *getWebView(WebFrame *webFrame);
- (BOOL)_canProvideDocumentSource;
- (BOOL)_canSaveAsWebArchive;
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
+- (void)_commitData:(NSData *)data;
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 188747d..2699472 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -166,23 +166,24 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
WebFrame *webFrame = [dataSource webFrame];
- if (webFrame) {
- if (!_private->pluginView)
- [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
-
- // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
- Frame* coreFrame = core(webFrame);
- if (coreFrame->document() && coreFrame->document()->isMediaDocument())
- coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
-
- if (_private->pluginView) {
- if (!_private->hasSentResponseToPlugin) {
- [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
- _private->hasSentResponseToPlugin = YES;
- }
-
- [_private->manualLoader pluginView:_private->pluginView receivedData:data];
+ if (!webFrame)
+ return;
+
+ if (!_private->pluginView)
+ [webFrame _commitData:data];
+
+ // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
+ Frame* coreFrame = core(webFrame);
+ if (coreFrame->document()->isMediaDocument())
+ coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
+
+ if (_private->pluginView) {
+ if (!_private->hasSentResponseToPlugin) {
+ [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
+ _private->hasSentResponseToPlugin = YES;
}
+
+ [_private->manualLoader pluginView:_private->pluginView receivedData:data];
}
}
@@ -195,25 +196,26 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
{
- WebFrame *frame = [dataSource webFrame];
+ WebFrame* webFrame = [dataSource webFrame];
if (_private->pluginView) {
[_private->manualLoader pluginViewFinishedLoading:_private->pluginView];
return;
}
- if (frame) {
- if (![self _isDisplayingWebArchive]) {
- // Telling the frame we received some data and passing nil as the data is our
- // way to get work done that is normally done when the first bit of data is
- // received, even for the case of a document with no data (like about:blank).
- [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
- }
-
- WebView *webView = [frame webView];
- if ([webView isEditable])
- core(frame)->editor()->applyEditingStyleToBodyElement();
+ if (!webFrame)
+ return;
+
+ if (![self _isDisplayingWebArchive]) {
+ // Telling the frame we received some data and passing nil as the data is our
+ // way to get work done that is normally done when the first bit of data is
+ // received, even for the case of a document with no data (like about:blank).
+ [webFrame _commitData:nil];
}
+
+ WebView *webView = [webFrame webView];
+ if ([webView isEditable])
+ core(webFrame)->editor()->applyEditingStyleToBodyElement();
}
- (BOOL)canProvideDocumentSource
@@ -304,15 +306,14 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
return inputElement
&& inputElement->isTextField()
- && inputElement->inputType() != HTMLInputElement::PASSWORD
+ && !inputElement->isPasswordField()
&& inputElement->autoComplete();
}
- (BOOL)elementIsPassword:(DOMElement *)element
{
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
- return inputElement
- && inputElement->inputType() == HTMLInputElement::PASSWORD;
+ return inputElement && inputElement->isPasswordField();
}
- (DOMElement *)formForElement:(DOMElement *)element
@@ -323,7 +324,7 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
- (DOMElement *)currentForm
{
- return kit(core([_private->dataSource webFrame])->currentForm());
+ return kit(core([_private->dataSource webFrame])->selection()->currentForm());
}
- (NSArray *)controlsInForm:(DOMElement *)form
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index bd71eff..02d32d9 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -1914,12 +1914,11 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (NSImage *)_selectionDraggingImage
{
- if ([self _hasSelection]) {
- NSImage *dragImage = core([self _frame])->selectionImage();
- [dragImage _web_dissolveToFraction:WebDragImageAlpha];
- return dragImage;
- }
- return nil;
+ if (![self _hasSelection])
+ return nil;
+ NSImage *dragImage = core([self _frame])->selectionImage();
+ [dragImage _web_dissolveToFraction:WebDragImageAlpha];
+ return dragImage;
}
- (NSRect)_selectionDraggingRect
@@ -2303,7 +2302,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return bottom;
float newBottom;
- view->adjustPageHeight(&newBottom, top, bottom, bottomLimit);
+ view->adjustPageHeightDeprecated(&newBottom, top, bottom, bottomLimit);
#ifdef __LP64__
// If the new bottom is equal to the old bottom (when both are treated as floats), we just return the original
@@ -2378,10 +2377,6 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
#endif
-@interface NSArray (WebHTMLView)
-- (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object;
-@end
-
@implementation WebHTMLView
+ (void)initialize
@@ -2529,6 +2524,7 @@ WEBCORE_COMMAND(alignLeft)
WEBCORE_COMMAND(alignRight)
WEBCORE_COMMAND(copy)
WEBCORE_COMMAND(cut)
+WEBCORE_COMMAND(paste)
WEBCORE_COMMAND(delete)
WEBCORE_COMMAND(deleteBackward)
WEBCORE_COMMAND(deleteBackwardByDecomposingPreviousCharacter)
@@ -2664,7 +2660,7 @@ WEBCORE_COMMAND(yankAndSelect)
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
+ coreFrame->selection()->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSCellStateValue)selectionHasStyle:(CSSStyleDeclaration*)style
@@ -3080,14 +3076,31 @@ WEBCORE_COMMAND(yankAndSelect)
}
}
+- (void)_web_makePluginSubviewsPerformSelector:(SEL)selector withObject:(id)object
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ // Copy subviews because [self subviews] returns the view's mutable internal array,
+ // and we must avoid mutating the array while enumerating it.
+ NSArray *subviews = [[self subviews] copy];
+
+ NSEnumerator *enumerator = [subviews objectEnumerator];
+ WebNetscapePluginView *view;
+ while ((view = [enumerator nextObject]) != nil)
+ if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
+ [view performSelector:selector withObject:object];
+
+ [subviews release];
+#endif
+}
+
- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow
{
- [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewWillMoveToHostWindow:) withObject:hostWindow];
+ [self _web_makePluginSubviewsPerformSelector:@selector(viewWillMoveToHostWindow:) withObject:hostWindow];
}
- (void)viewDidMoveToHostWindow
{
- [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewDidMoveToHostWindow) withObject:nil];
+ [self _web_makePluginSubviewsPerformSelector:@selector(viewDidMoveToHostWindow) withObject:nil];
}
@@ -4197,7 +4210,7 @@ static BOOL isInPasswordField(Frame* coreFrame)
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
+ coreFrame->selection()->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSData *)_selectionStartFontAttributesAsRTF
@@ -5082,21 +5095,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
@end
-@implementation NSArray (WebHTMLView)
-
-- (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- NSEnumerator *enumerator = [self objectEnumerator];
- WebNetscapePluginView *view;
- while ((view = [enumerator nextObject]) != nil)
- if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
- [view performSelector:selector withObject:object];
-#endif
-}
-
-@end
-
@implementation WebHTMLView (WebInternal)
- (void)_selectionChanged
@@ -5145,7 +5143,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
if (![[self _webView] smartInsertDeleteEnabled])
return NO;
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionGranularity() == WordGranularity;
+ return coreFrame && coreFrame->selection()->granularity() == WordGranularity;
}
- (NSEvent *)_mouseDownEvent
@@ -5163,24 +5161,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
return [_private->dataSource webFrame];
}
-- (void)paste:(id)sender
-{
- COMMAND_PROLOGUE
-
- RetainPtr<WebHTMLView> selfProtector = self;
- RefPtr<Frame> coreFrame = core([self _frame]);
- if (!coreFrame)
- return;
- if (coreFrame->editor()->tryDHTMLPaste())
- return; // DHTML did the whole operation
- if (!coreFrame->editor()->canPaste())
- return;
- if (coreFrame->selection()->isContentRichlyEditable())
- [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
- else
- coreFrame->editor()->pasteAsPlainTextBypassingDHTML();
-}
-
- (void)closeIfNotCurrentView
{
if ([[[self _frame] frameView] documentView] != self)
@@ -5360,7 +5340,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
if (!coreFrame)
return;
- NSRect rect = coreFrame->selectionBounds();
+ NSRect rect = coreFrame->selection()->bounds();
#ifndef BUILDING_ON_TIGER
NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
@@ -5582,7 +5562,11 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
[[NSNotificationCenter defaultCenter] postNotificationName:_WebViewDidStartAcceleratedCompositingNotification object:[self _webView] userInfo:nil];
#if defined(BUILDING_ON_LEOPARD)
+ [viewLayer setSublayerTransform:CATransform3DMakeScale(1, -1, 1)]; // setGeometryFlipped: doesn't exist on Leopard.
[self _updateLayerHostingViewPosition];
+#else
+ // Do geometry flipping here, which flips all the compositing layers so they are top-down.
+ [viewLayer setGeometryFlipped:YES];
#endif
}
@@ -6037,25 +6021,27 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
- (NSRect)selectionRect
{
- if ([self _hasSelection])
- return core([self _frame])->selectionBounds();
- return NSZeroRect;
+ if (![self _hasSelection])
+ return NSZeroRect;
+ return core([self _frame])->selection()->bounds();
}
- (NSArray *)selectionTextRects
{
if (![self _hasSelection])
return nil;
-
+
Vector<FloatRect> list;
if (Frame* coreFrame = core([self _frame]))
- coreFrame->selectionTextRects(list, Frame::RespectTransforms);
+ coreFrame->selection()->getClippedVisibleTextRectangles(list);
+
+ size_t size = list.size();
+
+ NSMutableArray *result = [NSMutableArray arrayWithCapacity:size];
- unsigned size = list.size();
- NSMutableArray *result = [[[NSMutableArray alloc] initWithCapacity:size] autorelease];
- for (unsigned i = 0; i < size; ++i)
+ for (size_t i = 0; i < size; ++i)
[result addObject:[NSValue valueWithRect:list[i]]];
-
+
return result;
}
@@ -6066,16 +6052,16 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
- (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText
{
- if ([self _hasSelection])
- return core([self _frame])->selectionImage(forceBlackText);
- return nil;
+ if (![self _hasSelection])
+ return nil;
+ return core([self _frame])->selectionImage(forceBlackText);
}
- (NSRect)selectionImageRect
{
- if ([self _hasSelection])
- return core([self _frame])->selectionBounds();
- return NSZeroRect;
+ if (![self _hasSelection])
+ return NSZeroRect;
+ return core([self _frame])->selection()->bounds();
}
- (NSArray *)pasteboardTypesForSelection
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 3b750ff..17c8e4d 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -92,6 +92,7 @@
#define WebKitShowDebugBordersPreferenceKey @"WebKitShowDebugBorders"
#define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
+#define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
@@ -111,6 +112,7 @@
#define WebKitCacheModelPreferenceKey @"WebKitCacheModelPreferenceKey"
#define WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey @"WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey"
#define WebKitEditingBehaviorPreferenceKey @"WebKitEditingBehavior"
+#define WebKitUsePreHTML5ParserQuirksKey @"WebKitUsePreHTML5ParserQuirks"
// CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set
// to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index a4a5383..87284bb 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -361,12 +361,14 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitShowDebugBordersPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitAccelerated2dCanvasEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
nil];
@@ -641,7 +643,10 @@ static WebCacheModel cacheModelForMainBundle(void)
} else {
locationString = [URL _web_originalDataAsString];
}
-
+
+ if (!locationString)
+ locationString = @"";
+
[self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey];
}
@@ -1267,6 +1272,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
}
+- (BOOL)accelerated2dCanvasEnabled
+{
+ return [self _boolValueForKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
+}
+
+- (void)setAccelerated2dCanvasEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
+}
+
- (BOOL)usesProxiedOpenPanel
{
return [self _boolValueForKey:WebKitUsesProxiedOpenPanelPreferenceKey];
@@ -1327,6 +1342,16 @@ static NSString *classIBCreatorID = nil;
[self _setIntegerValue:behavior forKey:WebKitEditingBehaviorPreferenceKey];
}
+- (BOOL)usePreHTML5ParserQuirks
+{
+ return [self _boolValueForKey:WebKitUsePreHTML5ParserQuirksKey];
+}
+
+- (void)setUsePreHTML5ParserQuirks:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitUsePreHTML5ParserQuirksKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
@@ -1357,6 +1382,11 @@ static NSString *classIBCreatorID = nil;
return [self _boolValueForKey:WebKitFullScreenEnabledPreferenceKey];
}
++ (void)setWebKitLinkTimeVersion:(int)version
+{
+ setWebKitLinkTimeVersion(version);
+}
+
@end
@implementation WebPreferences (WebInternal)
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 783038d..3bd5e24 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -184,6 +184,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)webGLEnabled;
- (void)setWebGLEnabled:(BOOL)enabled;
+- (BOOL)accelerated2dCanvasEnabled;
+- (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
+
- (BOOL)paginateDuringLayoutEnabled;
- (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
@@ -203,6 +206,8 @@ extern NSString *WebPreferencesRemovedNotification;
+ (void)_setInitialDefaultTextEncodingToSystemEncoding;
+ (void)_setIBCreatorID:(NSString *)string;
++ (void)setWebKitLinkTimeVersion:(int)version;
+
// For WebView's use only.
- (void)willAddToWebView;
- (void)didRemoveFromWebView;
@@ -212,4 +217,7 @@ extern NSString *WebPreferencesRemovedNotification;
- (void)setFullScreenEnabled:(BOOL)flag;
- (BOOL)fullScreenEnabled;
+- (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
+- (BOOL)usePreHTML5ParserQuirks;
+
@end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 0125e1c..20f6e24 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -174,6 +174,10 @@
#import <wtf/StdLibExtras.h>
#import <wtf/Threading.h>
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#import <AppKit/NSTextChecker.h>
+#endif
+
#if ENABLE(DASHBOARD_SUPPORT)
#import <WebKit/WebDashboardRegion.h>
#endif
@@ -692,6 +696,7 @@ static bool shouldEnableLoadDeferring()
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
+ _private->page->settings()->setMinDOMTimerInterval(0.004);
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
@@ -1427,7 +1432,6 @@ static bool fastDocumentTeardownEnabled()
settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]);
settings->setLocalFileContentSniffingEnabled([preferences localFileContentSniffingEnabled]);
settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]);
- settings->setZoomMode([preferences zoomsTextOnly] ? ZoomTextOnly : ZoomPage);
settings->setJavaScriptCanAccessClipboard([preferences javaScriptCanAccessClipboard]);
settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
settings->setEnforceCSSMIMETypeInNoQuirksMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
@@ -1435,11 +1439,13 @@ static bool fastDocumentTeardownEnabled()
// FIXME: Enabling accelerated compositing when WebGL is enabled causes tests to fail on Leopard which expect HW compositing to be disabled.
// Until we fix that, I will comment out the test (CFM)
- settings->setAcceleratedCompositingEnabled((coreVideoHas7228836Fix() || [preferences webGLEnabled]) && [preferences acceleratedCompositingEnabled]);
+ settings->setAcceleratedCompositingEnabled((coreVideoHas7228836Fix() || [preferences webGLEnabled] ||
+ [preferences accelerated2dCanvasEnabled]) && [preferences acceleratedCompositingEnabled]);
settings->setShowDebugBorders([preferences showDebugBorders]);
settings->setShowRepaintCounter([preferences showRepaintCounter]);
settings->setPluginAllowedRunTime([preferences pluginAllowedRunTime]);
settings->setWebGLEnabled([preferences webGLEnabled]);
+ settings->setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]);
settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]);
@@ -1447,9 +1453,14 @@ static bool fastDocumentTeardownEnabled()
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
#endif
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
+ settings->setUsePreHTML5ParserQuirks([preferences usePreHTML5ParserQuirks]);
// Application Cache Preferences are stored on the global cache storage manager, not in Settings.
[WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
+
+ BOOL zoomsTextOnly = [preferences zoomsTextOnly];
+ if (_private->zoomsTextOnly != zoomsTextOnly)
+ [self _setZoomMultiplier:_private->zoomMultiplier isTextOnly:zoomsTextOnly];
}
static inline IMP getMethod(id o, SEL s)
@@ -1908,9 +1919,38 @@ static inline IMP getMethod(id o, SEL s)
Frame* mainFrame = [self _mainCoreFrame];
if (!mainFrame)
return nil;
- NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary();
- [self _addScrollerDashboardRegions:regions];
- return regions;
+
+ const Vector<DashboardRegionValue>& regions = mainFrame->document()->dashboardRegions();
+ size_t size = regions.size();
+
+ NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:size];
+ for (size_t i = 0; i < size; i++) {
+ const DashboardRegionValue& region = regions[i];
+
+ if (region.type == StyleDashboardRegion::None)
+ continue;
+
+ NSString *label = region.label;
+ WebDashboardRegionType type = WebDashboardRegionTypeNone;
+ if (region.type == StyleDashboardRegion::Circle)
+ type = WebDashboardRegionTypeCircle;
+ else if (region.type == StyleDashboardRegion::Rectangle)
+ type = WebDashboardRegionTypeRectangle;
+ NSMutableArray *regionValues = [webRegions objectForKey:label];
+ if (!regionValues) {
+ regionValues = [[NSMutableArray alloc] initWithCapacity:1];
+ [webRegions setObject:regionValues forKey:label];
+ [regionValues release];
+ }
+
+ WebDashboardRegion *webRegion = [[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type];
+ [regionValues addObject:webRegion];
+ [webRegion release];
+ }
+
+ [self _addScrollerDashboardRegions:webRegions];
+
+ return webRegions;
}
- (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag
@@ -2604,6 +2644,13 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
automaticTextReplacementEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticTextReplacementEnabled];
automaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
#endif
+
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
+ automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
+ if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
+ automaticTextReplacementEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+#endif
}
+ (void)_applicationWillTerminate
@@ -3272,17 +3319,16 @@ static bool needsWebViewInitThreadWorkaround()
{
// NOTE: This has no visible effect when viewing a PDF (see <rdar://problem/4737380>)
_private->zoomMultiplier = multiplier;
+ _private->zoomsTextOnly = isTextOnly;
- ASSERT(_private->page);
- if (_private->page)
- _private->page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage);
-
- // FIXME: It would be nice to rework this code so that _private->zoomMultiplier doesn't exist
- // and instead FrameView::zoomFactor is used.
+ // FIXME: It might be nice to rework this code so that _private->zoomMultiplier doesn't exist
+ // and instead the zoom factors stored in Frame are used.
Frame* coreFrame = [self _mainCoreFrame];
if (coreFrame) {
- if (FrameView* view = coreFrame->view())
- view->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage);
+ if (_private->zoomsTextOnly)
+ coreFrame->setPageAndTextZoomFactors(1, multiplier);
+ else
+ coreFrame->setPageAndTextZoomFactors(multiplier, 1);
}
}
@@ -3303,7 +3349,7 @@ static bool needsWebViewInitThreadWorkaround()
if (!_private->page)
return NO;
- return _private->page->settings()->zoomMode() == ZoomTextOnly;
+ return _private->zoomsTextOnly;
}
#define MinimumZoomMultiplier 0.5f
@@ -4366,6 +4412,9 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
- (BOOL)canMarkAllTextMatches
{
+ if (_private->closed)
+ return NO;
+
WebFrame *frame = [self mainFrame];
do {
id <WebDocumentView> view = [[frame frameView] documentView];
@@ -4769,7 +4818,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
mainFrame->editor()->applyEditingStyleToBodyElement();
// If the WebView is made editable and the selection is empty, set it to something.
if (![self selectedDOMRange])
- mainFrame->setSelectionFromNone();
+ mainFrame->selection()->setSelectionFromNone();
}
}
}
diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h
index 558770e..9aa91dc 100644
--- a/WebKit/mac/WebView/WebViewData.h
+++ b/WebKit/mac/WebView/WebViewData.h
@@ -78,6 +78,7 @@ extern int pluginDatabaseClientCount;
BOOL allowsUndo;
float zoomMultiplier;
+ BOOL zoomsTextOnly;
NSString *applicationNameForUserAgent;
WTF::String userAgent;
diff --git a/WebKit/mac/WebView/WebViewData.mm b/WebKit/mac/WebView/WebViewData.mm
index 06da58f..9794d03 100644
--- a/WebKit/mac/WebView/WebViewData.mm
+++ b/WebKit/mac/WebView/WebViewData.mm
@@ -62,6 +62,7 @@ int pluginDatabaseClientCount = 0;
cssAnimationsSuspended = NO;
zoomMultiplier = 1;
+ zoomsTextOnly = NO;
#if ENABLE(DASHBOARD_SUPPORT)
dashboardBehaviorAllowWheelScrolling = YES;