diff options
Diffstat (limited to 'Source/WebKit/mac')
24 files changed, 644 insertions, 244 deletions
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog index 121250d..4a3c74f 100644 --- a/Source/WebKit/mac/ChangeLog +++ b/Source/WebKit/mac/ChangeLog @@ -1,3 +1,467 @@ +2011-02-11 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Oliver Hunt. + + A little more encapsulation for the heap: Removed CollectorHeapIterator + https://bugs.webkit.org/show_bug.cgi?id=54298 + + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): + (+[WebCoreStatistics javaScriptObjectTypeCounts]): Updated for new typedef. + +2011-02-10 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + Update calls to DocumentWriter. + https://bugs.webkit.org/show_bug.cgi?id=50489 + + * WebView/WebFrame.mm: + (-[WebFrame _canProvideDocumentSource]): + +2011-02-10 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Anders Carlsson. + + AX: AX needs to stop using WebCoreViewFactory + https://bugs.webkit.org/show_bug.cgi?id=54153 + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-02-10 Peter Varga <pvarga@webkit.org> + + Reviewed by Csaba Osztrogonác. + + Remove PCRE source from trunk + https://bugs.webkit.org/show_bug.cgi?id=54188 + + * ForwardingHeaders/pcre/pcre.h: Removed. + +2011-02-09 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: follow up on InspectorAgent split - + removing unnecessary methods from InspectorController. + https://bugs.webkit.org/show_bug.cgi?id=54093 + + * WebInspector/WebInspector.mm: + (-[WebInspector showConsole:]): + (-[WebInspector stopProfilingJavaScript:]): + +2011-02-08 Dan Bernstein <mitz@apple.com> + + Reviewed by Jon Honeycutt and Maciej Stachowiak. + + <rdar://problem/8959420> Find in Mail no longer cycles around + + * WebView/WebHTMLView.mm: + (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]): Set + the wrap option according to the flag. + +2011-02-08 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r77980. + http://trac.webkit.org/changeset/77980 + https://bugs.webkit.org/show_bug.cgi?id=54043 + + "Crashes on Windows and Linux..." (Requested by leviw on + #webkit). + + * WebView/WebFrame.mm: + (-[WebFrame _caretRectAtNode:offset:affinity:]): + * WebView/WebFrameInternal.h: + * WebView/WebTextCompletionController.mm: + (-[WebTextCompletionController doCompletion]): + +2011-02-08 Levi Weintraub <leviw@chromium.org> + + Reviewed by Ryosuke Niwa. + + Stop instantiating legacy editing Positions in VisiblePosition + https://bugs.webkit.org/show_bug.cgi?id=52919 + + Changing usage of legacy VisiblePosition constructor. Since we were dealing + with positions from DOM Ranges, we're guaranteed a parent-anchored position. + + * WebView/WebFrame.mm: + (-[WebFrame _caretRectAtPosition:affinity:]): + * WebView/WebFrameInternal.h: + * WebView/WebTextCompletionController.mm: + (-[WebTextCompletionController doCompletion]): + +2011-02-08 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Remove orphan code from old parser + https://bugs.webkit.org/show_bug.cgi?id=53984 + + * WebCoreSupport/WebChromeClient.h: + +2011-02-02 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: move InspectorController's methods from InspectorAgent to InspectorController. + + https://bugs.webkit.org/show_bug.cgi?id=53169 + + Minor change enforced by major changes in WebCore/inspector/InspectorController. + + * WebInspector/WebInspector.mm: + (-[WebInspector isTimelineProfilingEnabled]): + +2011-02-07 Enrica Casucci <enrica@apple.com> + + Reviewed Adam Roben and Darin Adler. + + WebKit2: drag and drop support on Windows. + https://bugs.webkit.org/show_bug.cgi?id=52775 + + Removed createDragImageForLink from DragClient. + + * WebCoreSupport/WebDragClient.h: + * WebCoreSupport/WebDragClient.mm: + (WebDragClient::startDrag): + +2011-02-03 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: remove settings related methods from InspectorClient + https://bugs.webkit.org/show_bug.cgi?id=53686 + + * WebCoreSupport/WebInspectorClient.h: + * WebCoreSupport/WebInspectorClient.mm: + (WebInspectorClient::openInspectorFrontend): + (WebInspectorFrontendClient::WebInspectorFrontendClient): + +2011-02-03 James Kozianski <koz@chromium.org> + + Reviewed by Dimitri Glazkov. + + Add navigator.registerProtocolHandler behind a flag. + https://bugs.webkit.org/show_bug.cgi?id=52609 + + * Configurations/FeatureDefines.xcconfig: + +2011-02-03 Adam Langley <agl@chromium.org> + + Reviewed by Adam Barth. + + Plumb mixed script URL to FrameLoaderClient + https://bugs.webkit.org/show_bug.cgi?id=52384 + + Regressions covered by http/tests/security/mixedContent/* + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::didRunInsecureContent): + +2011-02-03 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + Fix for <rdar://problem/8944544> Ability to animate track + for WKPainter scrollers + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-02-02 Mark Rowe <mrowe@apple.com> + + Reviewed by Beth Dakin. + + <rdar://problem/8928367> Crash when loading canvas pages inside HTMLCanvasElement::createImageBuffer(). + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Add some missing initializers. + +2011-02-02 Steve Lacey <sjl@chromium.org> + + Reviewed by Eric Carlson. + + Implement basic media statistics on media elements. + https://bugs.webkit.org/show_bug.cgi?id=53322 + + * Configurations/FeatureDefines.xcconfig: + +2011-02-01 Sam Weinig <sam@webkit.org> + + Reviewed by Beth Dakin. + + Part 2 for <rdar://problem/8492788> + Adopt WKScrollbarPainterController + + Use header detection to define scrollbar painting controller #define. + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-02-01 David Hyatt <hyatt@apple.com> + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=53520 + + Remove the physical terminology from IntRect and FloatRect. + + Now that we have flipped RenderBlocks for vertical-rl and horizontal-bt writing modes, + we need to update our terminology to be more accurate. + + I'm borrowing a page from AppKit here (which also supports flipped NSViews) and + renaming right() and bottom() to maxX() and maxY(). These terms remain accurate + even for flipped rectangles. + + * WebView/WebHTMLView.mm: + (setNeedsDisplayInRect): + +2011-02-01 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + Fix for <rdar://problem/8492788> Adopt WKScrollbarPainterController + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-02-01 Dave Hyatt <hyatt@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=46422, make printing and pagination work + with vertical text. + + Change printing functions to check writing-mode and properly swap width and height + as needed. + + * WebView/WebDynamicScrollBarsView.mm: + (-[WebDynamicScrollBarsView setScrollOrigin:updatePositionAtAll:immediately:]): + * WebView/WebFrame.mm: + (-[WebFrame _computePageRectsWithPrintScaleFactor:pageSize:]): + * WebView/WebFrameInternal.h: + * WebView/WebHTMLView.mm: + (-[WebHTMLView _web_setPrintingModeRecursive]): + (-[WebHTMLView _web_clearPrintingModeRecursive]): + (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): + (-[WebHTMLView _beginPrintModeWithMinimumPageWidth:height:maximumPageWidth:]): + (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): + (-[WebHTMLView _endPrintMode]): + (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): + (-[WebHTMLView _endScreenPaginationMode]): + (-[WebHTMLView layoutToMinimumPageWidth:height:maximumPageWidth:adjustingViewSize:]): + (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:maximumPageLogicalWidth:adjustViewSize:paginateScreenContent:]): + (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): + (-[WebHTMLView _scaleFactorForPrintOperation:]): + (-[WebHTMLView setPageWidthForPrinting:]): + (-[WebHTMLView knowsPageRange:]): + +2011-01-31 Oliver Hunt <oliver@apple.com> + + Convert markstack to a slot visitor API + https://bugs.webkit.org/show_bug.cgi?id=53219 + + rolling r77098, r77099, r77100, r77109, and + r77111 back in, along with a few more Qt fix attempts. + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + +2011-01-30 Csaba Osztrogonác <ossy@webkit.org> + + Unreviewed, rolling out r77098, r77099, r77100, r77109, and + r77111. + http://trac.webkit.org/changeset/77098 + http://trac.webkit.org/changeset/77099 + http://trac.webkit.org/changeset/77100 + http://trac.webkit.org/changeset/77109 + http://trac.webkit.org/changeset/77111 + https://bugs.webkit.org/show_bug.cgi?id=53219 + + Qt build is broken + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + +2011-01-30 Oliver Hunt <oliver@apple.com> + + Convert markstack to a slot visitor API + https://bugs.webkit.org/show_bug.cgi?id=53219 + + rolling r77006 and r77020 back in. + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + +2011-01-28 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Maciej Stachowiak. + + Some more Heap cleanup. + https://bugs.webkit.org/show_bug.cgi?id=53357 + + Updated for JavaScriptCore changes. + + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics memoryStatistics]): + +2011-01-28 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r77006 and r77020. + http://trac.webkit.org/changeset/77006 + http://trac.webkit.org/changeset/77020 + https://bugs.webkit.org/show_bug.cgi?id=53360 + + "Broke Windows tests" (Requested by rniwa on #webkit). + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + +2011-01-27 Oliver Hunt <oliver@apple.com> + + Reviewed by Geoffrey Garen. + + Convert markstack to a slot visitor API + https://bugs.webkit.org/show_bug.cgi?id=53219 + + Update to new marking api + + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + +2011-01-28 Dan Bernstein <mitz@apple.com> + + Reviewed by Sam Weinig. + + <select> can't display right-to-left (rtl) languages + https://bugs.webkit.org/show_bug.cgi?id=19785 + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::selectItemWritingDirectionIsNatural): Changed to return false. + (WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection): Added. Returns true. + +2011-01-27 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r76891. + http://trac.webkit.org/changeset/76891 + https://bugs.webkit.org/show_bug.cgi?id=53280 + + Makes every layout test crash (Requested by othermaciej on + #webkit). + + * Misc/WebIconDatabase.mm: + (-[ThreadEnabler threadEnablingSelector:]): + (importToWebCoreFormat): + +2011-01-27 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + Use Document::url() instead of FrameLoader::url(). + https://bugs.webkit.org/show_bug.cgi?id=41165 + + * WebView/WebView.mm: + (-[WebView _dispatchDidReceiveIconFromWebFrame:]): + +2011-01-27 Dan Bernstein <mitz@apple.com> + + Rubber-stamped by Anders Carlsson. + + Reverted an accidental change in r76561. + + * WebView/WebHTMLView.mm: + +2011-01-26 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/53192> Add experimental support for HTTP pipelining in CFNetwork + <rdar://problem/8821760> + + Reviewed by Antti Koivisto. + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Added initialization for + GetHTTPPipeliningPriority and SetHTTPPipeliningPriority. + +2011-01-26 Beth Dakin <bdakin@apple.com> + + Reviewed by Darin Adler. + + Fix for <rdar://problem/8895140> Adopt WKScrollbar metrics + when using WKScrollbars. + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-01-25 Darin Adler <darin@apple.com> + + Reviewed by Anders Carlsson. + + WebKit is using CSBackupSetItemExcluded incorrectly + https://bugs.webkit.org/show_bug.cgi?id=53095 + rdar://problem/8790540 + + * Misc/WebIconDatabase.mm: + (importToWebCoreFormat): Removed code that was calling CSBackupSetItemExcluded. + It was incorrect, and this responsibility has been moved to WebCore. + +2011-01-24 Chris Marrin <cmarrin@apple.com> + + Reviewed by Eric Seidel. + + Change ENABLE_3D_CANVAS to ENABLE_WEBGL + https://bugs.webkit.org/show_bug.cgi?id=53041 + + * Configurations/FeatureDefines.xcconfig: + +2011-01-25 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: remove "attached" state related methods from InspectorAgent + https://bugs.webkit.org/show_bug.cgi?id=53086 + + * WebCoreSupport/WebInspectorClient.h: + * WebCoreSupport/WebInspectorClient.mm: + (-[WebInspectorWindowController showWindow:]): + (-[WebInspectorWindowController attach]): + (-[WebInspectorWindowController detach]): + +2011-01-23 Dan Bernstein <mitz@apple.com> + + Reviewed by John Sullivan. + + <rdar://problem/6097826> Mail's cursor does not become a resize cursor when moving mouse from scrolled email to the horizontal splitter + + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::setCursor): If the current cursor comes from a cursor rect, do not override it. + +2011-01-22 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=52473 + Auto-scaling to avoid orphans is broken, remove dysfunctional code + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:paginateScreenContent:]): + (-[WebHTMLView _scaleFactorForPrintOperation:]): + (-[WebHTMLView knowsPageRange:]): + +2011-01-21 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Jon Honeycutt. + + Fix the build when using Clang by removing some unused variables. + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView updateAndSetWindow]): + * WebView/WebFullScreenController.mm: + (-[WebFullScreenController enterFullscreen:]): + (-[WebFullScreenController exitFullscreen]): + 2011-01-21 Chris Rogers <crogers@google.com> Reviewed by Darin Fisher. diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig index 46d5de4..3971037 100644 --- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -38,10 +38,10 @@ ENABLE_ACCELERATED_2D_CANVAS_macosx = $(ENABLE_ACCELERATED_2D_CANVAS_macosx_$(TA 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; -ENABLE_3D_CANVAS_macosx_1070 = ENABLE_3D_CANVAS; +ENABLE_WEBGL = $(ENABLE_WEBGL_$(REAL_PLATFORM_NAME)); +ENABLE_WEBGL_macosx = $(ENABLE_WEBGL_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ENABLE_WEBGL_macosx_1060 = ENABLE_WEBGL; +ENABLE_WEBGL_macosx_1070 = ENABLE_WEBGL; ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(REAL_PLATFORM_NAME)); ENABLE_3D_RENDERING_iphoneos = ENABLE_3D_RENDERING; @@ -91,6 +91,8 @@ ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG; +ENABLE_REGISTER_PROTOCOL_HANDLER = ; + ENABLE_SHARED_WORKERS = $(ENABLE_SHARED_WORKERS_$(REAL_PLATFORM_NAME)); ENABLE_SHARED_WORKERS_macosx = ENABLE_SHARED_WORKERS; @@ -106,6 +108,8 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT; ENABLE_SVG_USE = ENABLE_SVG_USE; ENABLE_VIDEO = ENABLE_VIDEO; +ENABLE_MEDIA_STATISTICS = ; + ENABLE_WEB_AUDIO = ; ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME)); @@ -121,4 +125,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = 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_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_AUDIO) $(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_WEBGL) $(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_REGISTER_PROTOCOL_HANDLER) $(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_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig index f0d3c1f..e74bd18 100644 --- a/Source/WebKit/mac/Configurations/Version.xcconfig +++ b/Source/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 = 16; +MINOR_VERSION = 20; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/WebKit/mac/ForwardingHeaders/pcre/pcre.h b/Source/WebKit/mac/ForwardingHeaders/pcre/pcre.h deleted file mode 100644 index 47c0d3d..0000000 --- a/Source/WebKit/mac/ForwardingHeaders/pcre/pcre.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/pcre.h> diff --git a/Source/WebKit/mac/Misc/WebCoreStatistics.mm b/Source/WebKit/mac/Misc/WebCoreStatistics.mm index 5d96c95..c3c3687 100644 --- a/Source/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/Source/WebKit/mac/Misc/WebCoreStatistics.mm @@ -86,7 +86,7 @@ using namespace WebCore; NSCountedSet *result = [NSCountedSet set]; - OwnPtr<HashCountedSet<const char*> > counts(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts()); + OwnPtr<TypeCountSet> counts(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts()); HashCountedSet<const char*>::iterator end = counts->end(); for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it) for (unsigned i = 0; i < it->second; ++i) @@ -101,7 +101,7 @@ using namespace WebCore; NSCountedSet *result = [NSCountedSet set]; - OwnPtr<HashCountedSet<const char*> > counts(JSDOMWindow::commonJSGlobalData()->heap.objectTypeCounts()); + OwnPtr<TypeCountSet> counts(JSDOMWindow::commonJSGlobalData()->heap.objectTypeCounts()); HashCountedSet<const char*>::iterator end = counts->end(); for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it) for (unsigned i = 0; i < it->second; ++i) @@ -197,15 +197,16 @@ using namespace WebCore; WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics(); JSLock lock(SilenceAssertionsOnly); - MarkedSpace::Statistics heapMemoryStats = heapStatistics(JSDOMWindow::commonJSGlobalData()); + size_t heapSize = JSDOMWindow::commonJSGlobalData()->heap.size(); + size_t heapFree = JSDOMWindow::commonJSGlobalData()->heap.capacity() - heapSize; GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics(); return [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes", [NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes", [NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes", - [NSNumber numberWithInt:heapMemoryStats.size], @"JavaScriptHeapSize", - [NSNumber numberWithInt:heapMemoryStats.free], @"JavaScriptFreeSize", + [NSNumber numberWithInt:heapSize], @"JavaScriptHeapSize", + [NSNumber numberWithInt:heapFree], @"JavaScriptFreeSize", [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.stackBytes], @"JavaScriptStackSize", [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.JITBytes], @"JavaScriptJITSize", nil]; diff --git a/Source/WebKit/mac/Misc/WebIconDatabase.mm b/Source/WebKit/mac/Misc/WebIconDatabase.mm index 7d0a350..14ef037 100644 --- a/Source/WebKit/mac/Misc/WebIconDatabase.mm +++ b/Source/WebKit/mac/Misc/WebIconDatabase.mm @@ -590,24 +590,6 @@ bool importToWebCoreFormat() [ThreadEnabler enableThreading]; ASSERT([NSThread isMultiThreaded]); -#ifndef BUILDING_ON_TIGER - // Tell backup software (i.e., Time Machine) to never back up the icon database, because - // it's a large file that changes frequently, thus using a lot of backup disk space, and - // it's unlikely that many users would be upset about it not being backed up. We do this - // here because this code is only executed once for each icon database instance. We could - // make this configurable on a per-client basis someday if that seemed useful. - // See <rdar://problem/5320208>. - // FIXME: This has nothing to do with importing from the old to the new database format and should be moved elsewhere, - // especially because we might eventually delete all of this legacy importing code and we shouldn't delete this. - CFStringRef databasePath = iconDatabase()->databasePath().createCFString(); - if (databasePath) { - CFURLRef databasePathURL = CFURLCreateWithFileSystemPath(0, databasePath, kCFURLPOSIXPathStyle, FALSE); - CFRelease(databasePath); - CSBackupSetItemExcluded(databasePathURL, true, true); - CFRelease(databasePathURL); - } -#endif - // Get the directory the old icon database *should* be in NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *databaseDirectory = [defaults objectForKey:WebIconDatabaseImportDirectoryDefaultsKey]; diff --git a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index c3ee98b..d3cce46 100644 --- a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -209,7 +209,6 @@ extern "C" { _proxy->resize(boundsInWindow, visibleRectInWindow); - CGRect layerBounds = NSRectToCGRect(boundsInWindow); CGRect bounds = NSRectToCGRect([self bounds]); CGRect frame = NSRectToCGRect([self frame]); diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h index 05db524..dda0bb1 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -152,8 +152,6 @@ public: virtual void formDidFocus(const WebCore::Node*); virtual void formDidBlur(const WebCore::Node*); - virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; } - #if USE(ACCELERATED_COMPOSITING) virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*); virtual void setNeedsOneShotDrawingSynchronization(); @@ -179,6 +177,7 @@ public: virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*) { } virtual bool selectItemWritingDirectionIsNatural(); + virtual bool selectItemAlignmentFollowsMenuWritingDirection(); virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const; virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 74c513d..0e7e2f2 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -80,6 +80,10 @@ #import "NetscapePluginHostManager.h" #endif +@interface NSApplication (WebNSApplicationDetails) +- (NSCursor *)_cursorRectCursor; +@end + @interface NSView (WebNSViewDetails) - (NSView *)_findLastViewInKeyViewLoop; @end @@ -678,6 +682,9 @@ void WebChromeClient::chooseIconForFiles(const Vector<String>& filenames, FileCh void WebChromeClient::setCursor(const WebCore::Cursor& cursor) { + if ([NSApp _cursorRectCursor]) + return; + NSCursor *platformCursor = cursor.platformCursor(); if ([NSCursor currentCursor] == platformCursor) return; @@ -742,7 +749,20 @@ void WebChromeClient::formDidBlur(const WebCore::Node* node) bool WebChromeClient::selectItemWritingDirectionIsNatural() { +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + return false; +#else + return true; +#endif +} + +bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection() +{ +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) return true; +#else + return false; +#endif } PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const diff --git a/Source/WebKit/mac/WebCoreSupport/WebDragClient.h b/Source/WebKit/mac/WebCoreSupport/WebDragClient.h index 216a2fb..34a5c2e 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebDragClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebDragClient.h @@ -36,7 +36,6 @@ public: virtual void dragControllerDestroyed(); virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WTF::String& label, WebCore::Frame*); virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*); private: WebView* m_webView; diff --git a/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm b/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm index b3af658..5a7d597 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm @@ -51,18 +51,6 @@ using namespace WebCore; -const float DragLabelBorderX = 4; -//Keep border_y in synch with DragController::LinkDragBorderInset -const float DragLabelBorderY = 2; -const float DragLabelRadius = 5; -const float LabelBorderYOffset = 2; - -const float MinDragLabelWidthBeforeClip = 120; -const float MaxDragLabelWidth = 320; - -const float DragLinkLabelFontsize = 11; -const float DragLinkUrlFontSize = 10; - WebDragClient::WebDragClient(WebView* webView) : m_webView(webView) { @@ -132,87 +120,6 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const [topHTMLView dragImage:dragNSImage at:at offset:NSZeroSize event:event pasteboard:pasteboard source:sourceHTMLView slideBack:YES]; } -DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& title, Frame* frame) -{ - if (!frame) - return nil; - NSString *label = 0; - if (!title.isEmpty()) - label = title; - NSURL *cocoaURL = url; - NSString *urlString = [cocoaURL _web_userVisibleString]; - - BOOL drawURLString = YES; - BOOL clipURLString = NO; - BOOL clipLabelString = NO; - - if (!label) { - drawURLString = NO; - label = urlString; - } - - NSFont *labelFont = [[NSFontManager sharedFontManager] convertFont:[NSFont systemFontOfSize:DragLinkLabelFontsize] - toHaveTrait:NSBoldFontMask]; - NSFont *urlFont = [NSFont systemFontOfSize:DragLinkUrlFontSize]; - NSSize labelSize; - labelSize.width = [label _web_widthWithFont: labelFont]; - labelSize.height = [labelFont ascender] - [labelFont descender]; - if (labelSize.width > MaxDragLabelWidth){ - labelSize.width = MaxDragLabelWidth; - clipLabelString = YES; - } - - NSSize imageSize; - imageSize.width = labelSize.width + DragLabelBorderX * 2; - imageSize.height = labelSize.height + DragLabelBorderY * 2; - if (drawURLString) { - NSSize urlStringSize; - urlStringSize.width = [urlString _web_widthWithFont: urlFont]; - urlStringSize.height = [urlFont ascender] - [urlFont descender]; - imageSize.height += urlStringSize.height; - if (urlStringSize.width > MaxDragLabelWidth) { - imageSize.width = max(MaxDragLabelWidth + DragLabelBorderY * 2, MinDragLabelWidthBeforeClip); - clipURLString = YES; - } else - imageSize.width = max(labelSize.width + DragLabelBorderX * 2, urlStringSize.width + DragLabelBorderX * 2); - } - NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease]; - [dragImage lockFocus]; - - [[NSColor colorWithDeviceRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set]; - - // Drag a rectangle with rounded corners - NSBezierPath *path = [NSBezierPath bezierPath]; - [path appendBezierPathWithOvalInRect: NSMakeRect(0, 0, DragLabelRadius * 2, DragLabelRadius * 2)]; - [path appendBezierPathWithOvalInRect: NSMakeRect(0, imageSize.height - DragLabelRadius * 2, DragLabelRadius * 2, DragLabelRadius * 2)]; - [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DragLabelRadius * 2, imageSize.height - DragLabelRadius * 2, DragLabelRadius * 2, DragLabelRadius * 2)]; - [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DragLabelRadius * 2, 0, DragLabelRadius * 2, DragLabelRadius * 2)]; - - [path appendBezierPathWithRect: NSMakeRect(DragLabelRadius, 0, imageSize.width - DragLabelRadius * 2, imageSize.height)]; - [path appendBezierPathWithRect: NSMakeRect(0, DragLabelRadius, DragLabelRadius + 10, imageSize.height - 2 * DragLabelRadius)]; - [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DragLabelRadius - 20, DragLabelRadius, DragLabelRadius + 20, imageSize.height - 2 * DragLabelRadius)]; - [path fill]; - - NSColor *topColor = [NSColor colorWithDeviceWhite:0.0f alpha:0.75f]; - NSColor *bottomColor = [NSColor colorWithDeviceWhite:1.0f alpha:0.5f]; - if (drawURLString) { - if (clipURLString) - urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DragLabelBorderX * 2) withFont:urlFont]; - - [urlString _web_drawDoubledAtPoint:NSMakePoint(DragLabelBorderX, DragLabelBorderY - [urlFont descender]) - withTopColor:topColor bottomColor:bottomColor font:urlFont]; - } - - if (clipLabelString) - label = [WebStringTruncator rightTruncateString: label toWidth:imageSize.width - (DragLabelBorderX * 2) withFont:labelFont]; - [label _web_drawDoubledAtPoint:NSMakePoint (DragLabelBorderX, imageSize.height - LabelBorderYOffset - [labelFont pointSize]) - withTopColor:topColor bottomColor:bottomColor font:labelFont]; - - [dragImage unlockFocus]; - - return dragImage; -} - void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame* frame) { ASSERT(pasteboard); diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h index 9de4246..f29ba72 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h @@ -156,7 +156,7 @@ private: virtual void dispatchDidChangeBackForwardIndex() const; virtual void didDisplayInsecureContent(); - virtual void didRunInsecureContent(WebCore::SecurityOrigin*); + virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL&); virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&); diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index f3cdff6..6484584 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -957,7 +957,7 @@ void WebFrameLoaderClient::didDisplayInsecureContent() CallFrameLoadDelegate(implementations->didDisplayInsecureContentFunc, webView, @selector(webViewDidDisplayInsecureContent:)); } -void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin) +void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin, const KURL& insecureURL) { RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h index 75a3cc6..108c2cc 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h @@ -30,6 +30,7 @@ #import <WebCore/InspectorFrontendClientLocal.h> #import <WebCore/PlatformString.h> +#import <wtf/Forward.h> #import <wtf/RetainPtr.h> #ifdef __OBJC__ @@ -59,14 +60,16 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WTF::String& key, WTF::String* value); - virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WTF::String&); + bool inspectorStartsAttached(); + void setInspectorStartsAttached(bool); + void releaseFrontendPage(); private: + WTF::PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings(); + WebView *m_webView; RetainPtr<WebNodeHighlighter> m_highlighter; WebCore::Page* m_frontendPage; @@ -75,7 +78,7 @@ private: class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal { public: - WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*); + WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*, WTF::PassOwnPtr<Settings>); virtual void frontendLoaded(); diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm index 5beedcf..d47784f 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm @@ -102,7 +102,7 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon [windowController.get() setInspectorClient:this]; m_frontendPage = core([windowController.get() webView]); - WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage); + WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings()); m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient); [[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]]; @@ -118,8 +118,8 @@ void WebInspectorClient::hideHighlight() [m_highlighter.get() hideHighlight]; } -WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, WebInspectorWindowController* windowController, InspectorController* inspectorController, Page* frontendPage) - : InspectorFrontendClientLocal(inspectorController, frontendPage) +WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, WebInspectorWindowController* windowController, InspectorController* inspectorController, Page* frontendPage, WTF::PassOwnPtr<Settings> settings) + : InspectorFrontendClientLocal(inspectorController, frontendPage, settings) , m_inspectedWebView(inspectedWebView) , m_windowController(windowController) { @@ -355,9 +355,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const _visible = YES; - // If no preference is set - default to an attached window. This is important for inspector LayoutTests. - // FIXME: This flag can be fetched directly from the flags storage. - _shouldAttach = [_inspectedWebView page]->inspectorController()->inspectorStartsAttached(); + _shouldAttach = _inspectorClient->inspectorStartsAttached(); if (_shouldAttach && !_frontendClient->canAttachWindow()) _shouldAttach = NO; @@ -392,8 +390,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const if (_attachedToInspectedWebView) return; - // FIXME: This flag can be saved directly to the flags storage. - [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(true); + _inspectorClient->setInspectorStartsAttached(true); [self close]; [self showWindow:nil]; @@ -404,8 +401,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const if (!_attachedToInspectedWebView) return; - // FIXME: This flag can be saved to the flags storage directly. - [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(false); + _inspectorClient->setInspectorStartsAttached(false); [self close]; [self showWindow:nil]; diff --git a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm index 70767ee..c39576b 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm @@ -60,6 +60,7 @@ void InitWebCoreSystemInterface(void) INIT(GetFontInLanguageForCharacter); INIT(GetFontInLanguageForRange); INIT(GetGlyphTransformedAdvances); + INIT(GetHTTPPipeliningPriority); INIT(GetMIMETypeForExtension); INIT(GetNSURLResponseLastModifiedDate); INIT(GetPreferredExtensionForMIMEType); @@ -75,6 +76,7 @@ void InitWebCoreSystemInterface(void) INIT(SetCONNECTProxyForStream); INIT(SetCookieStoragePrivateBrowsingEnabled); INIT(SetDragImage); + INIT(SetHTTPPipeliningPriority); INIT(SetNSURLConnectionDefersCallbacks); INIT(SetNSURLRequestShouldContentSniff); INIT(SetPatternBaseCTM); @@ -120,12 +122,50 @@ void InitWebCoreSystemInterface(void) INIT(CreateCTLineWithUniCharProvider); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - INIT(CreateCTTypesetterWithUniCharProviderAndOptions); INIT(IOSurfaceContextCreate); INIT(IOSurfaceContextCreateImage); + INIT(CreateCTTypesetterWithUniCharProviderAndOptions); INIT(MakeScrollbarPainter); + INIT(ScrollbarPainterSetDelegate); INIT(ScrollbarPainterPaint); + INIT(ScrollbarThickness); + INIT(ScrollbarMinimumThumbLength); + INIT(ScrollbarMinimumTotalLengthNeededForThumb); + INIT(ScrollbarPainterKnobAlpha); + INIT(SetScrollbarPainterKnobAlpha); + INIT(ScrollbarPainterTrackAlpha); + INIT(SetScrollbarPainterTrackAlpha); + INIT(ScrollbarPainterIsHorizontal); + INIT(ScrollbarPainterSetOverlayState); + INIT(MakeScrollbarPainterController); + INIT(MakeScrollbarReplacementPainter); + INIT(SetPainterForPainterController); + INIT(VerticalScrollbarPainterForController); + INIT(HorizontalScrollbarPainterForController); + INIT(SetScrollbarPainterControllerStyle); + INIT(ContentAreaScrolled); + INIT(ContentAreaWillPaint); + INIT(MouseEnteredContentArea); + INIT(MouseExitedContentArea); + INIT(MouseMovedInContentArea); + INIT(WillStartLiveResize); + INIT(ContentAreaResized); + INIT(WillEndLiveResize); + INIT(ContentAreaDidShow); + INIT(ContentAreaDidHide); + INIT(ScrollbarPainterUsesOverlayScrollers); #endif + INIT(GetAXTextMarkerTypeID); + INIT(GetAXTextMarkerRangeTypeID); + INIT(CreateAXTextMarker); + INIT(GetBytesFromAXTextMarker); + INIT(CreateAXTextMarkerRange); + INIT(CopyAXTextMarkerRangeStart); + INIT(CopyAXTextMarkerRangeEnd); + INIT(AccessibilityHandleFocusChanged); + INIT(CreateAXUIElementRef); + INIT(UnregisterUniqueIdForElement); + didInit = true; } diff --git a/Source/WebKit/mac/WebInspector/WebInspector.mm b/Source/WebKit/mac/WebInspector/WebInspector.mm index 8ab049f..f38c7ef 100644 --- a/Source/WebKit/mac/WebInspector/WebInspector.mm +++ b/Source/WebKit/mac/WebInspector/WebInspector.mm @@ -68,7 +68,7 @@ using namespace WebCore; - (void)showConsole:(id)sender { if (Page* page = core(_webView)) - page->inspectorController()->showPanel(InspectorController::ConsolePanel); + page->inspectorController()->showConsole(); } - (void)showTimeline:(id)sender @@ -132,7 +132,6 @@ using namespace WebCore; if (!page) return; page->inspectorController()->stopUserInitiatedProfiling(); - page->inspectorController()->showPanel(InspectorController::ProfilesPanel); } - (BOOL)isJavaScriptProfilingEnabled @@ -157,7 +156,7 @@ using namespace WebCore; - (BOOL)isTimelineProfilingEnabled { if (Page* page = core(_webView)) - return page->inspectorController()->timelineAgent() ? YES : NO; + return page->inspectorController()->timelineProfilerEnabled() ? YES : NO; return NO; } diff --git a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm index b8edef8..610cd40 100644 --- a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm +++ b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm @@ -568,7 +568,7 @@ static const unsigned cMaxUpdateScrollbarsPass = 2; return YES; } -- (void)setScrollOrigin:(NSPoint)scrollOrigin updatePosition:(BOOL)updatePosition +- (void)setScrollOrigin:(NSPoint)scrollOrigin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionSynchronously { // The cross-platform ScrollView call already checked to see if the old/new scroll origins were the same or not // so we don't have to check for equivalence here. @@ -579,12 +579,13 @@ static const unsigned cMaxUpdateScrollbarsPass = 2; [docView setBoundsOrigin:NSMakePoint(-scrollOrigin.x, -scrollOrigin.y)]; - _private->scrollOriginChanged = true; + if (updatePositionAtAll) + _private->scrollOriginChanged = true; // Maintain our original position in the presence of the new scroll origin. _private->scrollPositionExcludingOrigin = NSMakePoint(visibleRect.origin.x + scrollOrigin.x, visibleRect.origin.y + scrollOrigin.y); - if (updatePosition) // Otherwise we'll just let the snap happen when we update for the resize. + if (updatePositionAtAll && updatePositionSynchronously) // Otherwise we'll just let the snap happen when we update for the resize. [self adjustForScrollOriginChange]; } diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm index 154156a..4d1c752 100644 --- a/Source/WebKit/mac/WebView/WebFrame.mm +++ b/Source/WebKit/mac/WebView/WebFrame.mm @@ -587,16 +587,11 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) } // Used by pagination code called from AppKit when a standalone web page is printed. -- (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight +- (NSArray*)_computePageRectsWithPrintScaleFactor:(float)printScaleFactor pageSize:(NSSize)pageSize { NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5]; - if (printWidthScaleFactor <= 0) { - LOG_ERROR("printWidthScaleFactor has bad value %.2f", printWidthScaleFactor); - return pages; - } - - if (printHeight <= 0) { - LOG_ERROR("printHeight has bad value %.2f", printHeight); + if (printScaleFactor <= 0) { + LOG_ERROR("printScaleFactor has bad value %.2f", printScaleFactor); return pages; } @@ -612,8 +607,11 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) if (!documentView) return pages; - float docWidth = root->layer()->width(); - float printWidth = docWidth / printWidthScaleFactor; + float docWidth = root->docWidth(); + float docHeight = root->docHeight(); + + float printWidth = root->style()->isHorizontalWritingMode() ? docWidth / printScaleFactor : pageSize.width; + float printHeight = root->style()->isHorizontalWritingMode() ? pageSize.height : docHeight / printScaleFactor; PrintContext printContext(_private->coreFrame); printContext.computePageRectsWithPageSize(FloatSize(printWidth, printHeight), true); @@ -915,7 +913,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (BOOL)_canProvideDocumentSource { Frame* frame = _private->coreFrame; - String mimeType = frame->loader()->writer()->mimeType(); + String mimeType = frame->document()->loader()->writer()->mimeType(); PluginData* pluginData = frame->page() ? frame->page()->pluginData() : 0; if (WebCore::DOMImplementation::isTextMIMEType(mimeType) || diff --git a/Source/WebKit/mac/WebView/WebFrameInternal.h b/Source/WebKit/mac/WebView/WebFrameInternal.h index 7ff5e75..83870ec 100644 --- a/Source/WebKit/mac/WebView/WebFrameInternal.h +++ b/Source/WebKit/mac/WebView/WebFrameInternal.h @@ -124,7 +124,7 @@ WebView *getWebView(WebFrame *webFrame); - (BOOL)_needsLayout; - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly; - (BOOL)_getVisibleRect:(NSRect*)rect; -- (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight; +- (NSArray*)_computePageRectsWithPrintScaleFactor:(float)printWidthScaleFactor pageSize:(NSSize)pageSize; - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string; - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture; diff --git a/Source/WebKit/mac/WebView/WebFullScreenController.mm b/Source/WebKit/mac/WebView/WebFullScreenController.mm index 6529435..5b8b496 100644 --- a/Source/WebKit/mac/WebView/WebFullScreenController.mm +++ b/Source/WebKit/mac/WebView/WebFullScreenController.mm @@ -397,7 +397,6 @@ private: [[self window] setCollectionBehavior:behavior]; NSView* animationView = [[self _fullscreenWindow] animationView]; - NSRect viewBounds = [animationView bounds]; NSRect backgroundBounds = {[[self window] convertScreenToBase:screenFrame.origin], screenFrame.size}; backgroundBounds = [animationView convertRectFromBase:backgroundBounds]; @@ -462,8 +461,7 @@ private: CATransform3D moveTransform = CATransform3DMakeTranslation(_initialFrame.origin.x - shrunkDestinationFrame.origin.x, _initialFrame.origin.y - shrunkDestinationFrame.origin.y, 0); CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, moveTransform); [rendererLayer setTransform:finalTransform]; - CGRect translatedDestinationFrame = [rendererLayer convertRect:destinationFrame toLayer:[animationView layer]]; - + CALayer* backgroundLayer = [[self _fullscreenWindow] backgroundLayer]; // Start the opacity animation. We can use implicit animations here because we don't care when @@ -600,10 +598,9 @@ private: CATransform3D moveTransform = CATransform3DMakeTranslation(layerEndFrame.origin.x - shrunkDestinationFrame.origin.x, layerEndFrame.origin.y - shrunkDestinationFrame.origin.y, 0); CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, moveTransform); [rendererLayer setTransform:finalTransform]; - CGRect translatedDestinationFrame = [rendererLayer convertRect:layerStartFrame toLayer:[animationView layer]]; - + CFTimeInterval duration = [self _animationDuration]; - + CALayer* backgroundLayer = [[self _fullscreenWindow] backgroundLayer]; [CATransaction begin]; [CATransaction setAnimationDuration:duration]; diff --git a/Source/WebKit/mac/WebView/WebHTMLView.mm b/Source/WebKit/mac/WebView/WebHTMLView.mm index ec5ff51..ff1c400 100644 --- a/Source/WebKit/mac/WebView/WebHTMLView.mm +++ b/Source/WebKit/mac/WebView/WebHTMLView.mm @@ -104,6 +104,7 @@ #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/Range.h> #import <WebCore/RenderWidget.h> +#import <WebCore/RenderView.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/SelectionController.h> #import <WebCore/SharedBuffer.h> @@ -311,7 +312,7 @@ static void setNeedsDisplayInRect(NSView *self, SEL cmd, NSRect invalidRect) NSRect invalidRectInWebFrameViewCoordinates = [enclosingWebFrameView convertRect:invalidRect fromView:self]; IntRect invalidRectInFrameViewCoordinates(invalidRectInWebFrameViewCoordinates); if (![enclosingWebFrameView isFlipped]) - invalidRectInFrameViewCoordinates.setY(frameView->frameRect().size().height() - invalidRectInFrameViewCoordinates.bottom()); + invalidRectInFrameViewCoordinates.setY(frameView->frameRect().size().height() - invalidRectInFrameViewCoordinates.maxY()); frameView->invalidateRect(invalidRectInFrameViewCoordinates); } @@ -347,16 +348,6 @@ const float _WebHTMLViewPrintingMinimumShrinkFactor = 1.25; // behavior matches MacIE and Mozilla, at least) const float _WebHTMLViewPrintingMaximumShrinkFactor = 2; -// This number determines how short the last printed page of a multi-page print session -// can be before we try to shrink the scale in order to reduce the number of pages, and -// thus eliminate the orphan. -#define LastPrintedPageOrphanRatio 0.1f - -// This number determines the amount the scale factor is adjusted to try to eliminate orphans. -// It has no direct mathematical relationship to LastPrintedPageOrphanRatio, due to variable -// numbers of pages, logic to avoid breaking elements, and CSS-supplied hard page breaks. -#define PrintingOrphanShrinkAdjustment 1.1f - #define AUTOSCROLL_INTERVAL 0.1f // Any non-zero value will do, but using something recognizable might help us debug some day. @@ -438,7 +429,7 @@ static CachedResourceClient* promisedDataClient() #endif @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; +- (void)_setPrinting:(BOOL)printing minimumPageLogicalWidth:(float)minPageWidth logicalHeight:(float)minPageHeight maximumPageLogicalWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; @end @class NSTextInputContext; @@ -482,7 +473,6 @@ struct WebHTMLViewInterpretKeyEventsParameters { BOOL closed; BOOL ignoringMouseDraggedEvents; BOOL printing; - BOOL avoidingPrintOrphan; BOOL paginateScreenContent; BOOL observingMouseMovedNotifications; BOOL observingSuperviewNotifications; @@ -1091,7 +1081,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursive { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1103,7 +1093,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1114,7 +1104,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_clearPrintingModeRecursive { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1126,7 +1116,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1137,7 +1127,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursiveAndAdjustViewSize { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1149,7 +1139,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -2212,7 +2202,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) maximumPageWidth = 0; } - [self _setPrinting:YES minimumPageWidth:minimumPageWidth height:minimumPageHeight maximumPageWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:minimumPageWidth logicalHeight:minimumPageHeight maximumPageLogicalWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; return YES; } @@ -2222,25 +2212,28 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) if (!frame) return NO; - float minLayoutWidth = 0; - float minLayoutHeight = 0; - float maxLayoutWidth = 0; + Document* document = frame->document(); + bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode(); + + float minLayoutLogicalWidth = isHorizontal ? pageWidth : pageHeight; + float minLayoutLogicalHeight = isHorizontal ? pageHeight : pageWidth; + float maxLayoutLogicalWidth = minLayoutLogicalWidth; // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the page width. - if (!frame->document() || !frame->document()->isFrameSet()) { - minLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMinimumShrinkFactor : pageWidth; - minLayoutHeight = shrinkToFit ? pageHeight * _WebHTMLViewPrintingMinimumShrinkFactor : pageHeight; - maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth; + if (shrinkToFit && (!frame->document() || !frame->document()->isFrameSet())) { + minLayoutLogicalWidth *= _WebHTMLViewPrintingMinimumShrinkFactor; + minLayoutLogicalHeight *= _WebHTMLViewPrintingMinimumShrinkFactor; + maxLayoutLogicalWidth *= _WebHTMLViewPrintingMaximumShrinkFactor; } - [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:minLayoutLogicalWidth logicalHeight:minLayoutLogicalHeight maximumPageLogicalWidth:maxLayoutLogicalWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; return YES; } - (void)_endPrintMode { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; } - (BOOL)_isInScreenPaginationMode @@ -2254,25 +2247,28 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) if (!frame) return NO; - CGFloat minLayoutWidth = 0; - CGFloat minLayoutHeight = 0; - CGFloat maxLayoutWidth = 0; + Document* document = frame->document(); + bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode(); + + float minLayoutLogicalWidth = isHorizontal ? pageSize.width : pageSize.height; + float minLayoutLogicalHeight = isHorizontal ? pageSize.height : pageSize.width; + float maxLayoutLogicalWidth = minLayoutLogicalWidth; - // If we are a frameset just print with the layout we have on the screen. Otherwise do a relayout + // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the page width. - if (!frame->document() || !frame->document()->isFrameSet()) { - minLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.width; - minLayoutHeight = shrinkToFit ? pageSize.height * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.height; - maxLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMaximumShrinkFactor : pageSize.width; + if (shrinkToFit && (!frame->document() || !frame->document()->isFrameSet())) { + minLayoutLogicalWidth *= _WebHTMLViewPrintingMinimumShrinkFactor; + minLayoutLogicalHeight *= _WebHTMLViewPrintingMinimumShrinkFactor; + maxLayoutLogicalWidth *= _WebHTMLViewPrintingMaximumShrinkFactor; } - [self _setPrinting:[self _isInPrintMode] minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:YES]; + [self _setPrinting:[self _isInPrintMode] minimumPageLogicalWidth:minLayoutLogicalWidth logicalHeight:minLayoutLogicalHeight maximumPageLogicalWidth:maxLayoutLogicalWidth adjustViewSize:YES paginateScreenContent:YES]; return YES; } - (void)_endScreenPaginationMode { - [self _setPrinting:[self _isInPrintMode] minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:NO]; + [self _setPrinting:[self _isInPrintMode] minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:NO]; } - (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit @@ -3128,7 +3124,7 @@ WEBCORE_COMMAND(yankAndSelect) // Do a layout, but set up a new fixed width for the purposes of doing printing layout. // minPageWidth==0 implies a non-printing layout -- (void)layoutToMinimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize +- (void)layoutToMinimumPageWidth:(float)minPageLogicalWidth height:(float)minPageLogicalHeight maximumPageWidth:(float)maxPageLogicalWidth adjustingViewSize:(BOOL)adjustViewSize { if (![self _needsLayout]) return; @@ -3144,9 +3140,12 @@ WEBCORE_COMMAND(yankAndSelect) return; if (FrameView* coreView = coreFrame->view()) { - if (minPageWidth > 0.0) - coreView->forceLayoutForPagination(FloatSize(minPageWidth, minPageHeight), maxPageWidth / minPageWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize); - else { + if (minPageLogicalWidth > 0.0) { + FloatSize pageSize(minPageLogicalWidth, minPageLogicalHeight); + if (coreFrame->document() && coreFrame->document()->renderView() && !coreFrame->document()->renderView()->style()->isHorizontalWritingMode()) + pageSize = FloatSize(minPageLogicalHeight, minPageLogicalWidth); + coreView->forceLayoutForPagination(pageSize, maxPageLogicalWidth / minPageLogicalWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize); + } else { coreView->forceLayout(!adjustViewSize); if (adjustViewSize) coreView->adjustViewSize(); @@ -3888,7 +3887,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // Does setNeedsDisplay:NO as a side effect when printing is ending. // pageWidth != 0 implies we will relayout to a new width -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent +- (void)_setPrinting:(BOOL)printing minimumPageLogicalWidth:(float)minPageLogicalWidth logicalHeight:(float)minPageLogicalHeight maximumPageLogicalWidth:(float)maxPageLogicalWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent { if (printing == _private->printing && paginateScreenContent == _private->paginateScreenContent) return; @@ -3901,7 +3900,7 @@ static BOOL isInPasswordField(Frame* coreFrame) WebFrame *subframe = [subframes objectAtIndex:i]; WebFrameView *frameView = [subframe frameView]; if ([[subframe _dataSource] _isDocumentHTML]) { - [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent]; + [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent]; } } @@ -3909,8 +3908,6 @@ static BOOL isInPasswordField(Frame* coreFrame) _private->pageRects = nil; _private->printing = printing; _private->paginateScreenContent = paginateScreenContent; - if (!printing && !paginateScreenContent) - _private->avoidingPrintOrphan = NO; Frame* coreFrame = core([self _frame]); if (coreFrame) { @@ -3924,7 +3921,7 @@ static BOOL isInPasswordField(Frame* coreFrame) } [self setNeedsLayout:YES]; - [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; + [self layoutToMinimumPageWidth:minPageLogicalWidth height:minPageLogicalHeight maximumPageWidth:maxPageLogicalWidth adjustingViewSize:adjustViewSize]; if (!printing) { // Can't do this when starting printing or nested printing won't work, see 3491427. [self setNeedsDisplay:NO]; @@ -3944,7 +3941,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; if (!wasInPrintingMode) - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; *newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit]; @@ -3955,23 +3952,30 @@ static BOOL isInPasswordField(Frame* coreFrame) [self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0]; else // not sure if this is actually ever invoked, it probably shouldn't be - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; } } - (float)_scaleFactorForPrintOperation:(NSPrintOperation *)printOperation { - float viewWidth = NSWidth([self bounds]); - if (viewWidth < 1) { - LOG_ERROR("%@ has no width when printing", self); + bool useViewWidth = true; + Frame* coreFrame = core([self _frame]); + if (coreFrame) { + Document* document = coreFrame->document(); + if (document && document->renderView()) + useViewWidth = document->renderView()->style()->isHorizontalWritingMode(); + } + + float viewLogicalWidth = useViewWidth ? NSWidth([self bounds]) : NSHeight([self bounds]); + if (viewLogicalWidth < 1) { + LOG_ERROR("%@ has no logical width when printing", self); return 1.0f; } float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; float maxShrinkToFitScaleFactor = 1.0f / _WebHTMLViewPrintingMaximumShrinkFactor; - float shrinkToFitScaleFactor = [printOperation _web_availablePaperWidth] / viewWidth; - float shrinkToAvoidOrphan = _private->avoidingPrintOrphan ? (1.0f / PrintingOrphanShrinkAdjustment) : 1.0f; - return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor) * shrinkToAvoidOrphan; + float shrinkToFitScaleFactor = (useViewWidth ? [printOperation _web_availablePaperWidth] : [printOperation _web_availablePaperHeight]) / viewLogicalWidth; + return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor); } // FIXME 3491344: This is a secret AppKit-internal method that we need to override in order @@ -3985,8 +3989,8 @@ static BOOL isInPasswordField(Frame* coreFrame) // This is used for Carbon printing. At some point we might want to make this public API. - (void)setPageWidthForPrinting:(float)pageWidth { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; - [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:pageWidth logicalHeight:0 maximumPageLogicalWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; } - (void)_endPrintModeAndRestoreWindowAutodisplay @@ -4050,9 +4054,10 @@ static BOOL isInPasswordField(Frame* coreFrame) float totalScaleFactor = [self _scaleFactorForPrintOperation:printOperation]; float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; [_private->pageRects release]; + float fullPageWidth = floorf([printOperation _web_availablePaperWidth] / totalScaleFactor); float fullPageHeight = floorf([printOperation _web_availablePaperHeight] / totalScaleFactor); WebFrame *frame = [self _frame]; - NSArray *newPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight]; + NSArray *newPageRects = [frame _computePageRectsWithPrintScaleFactor:userScaleFactor pageSize:NSMakeSize(fullPageWidth, fullPageHeight)]; // AppKit gets all messed up if you give it a zero-length page count (see 3576334), so if we // hit that case we'll pass along a degenerate 1 pixel square to print. This will print @@ -4060,19 +4065,6 @@ static BOOL isInPasswordField(Frame* coreFrame) // the behavior of IE and Camino at least. if ([newPageRects count] == 0) newPageRects = [NSArray arrayWithObject:[NSValue valueWithRect:NSMakeRect(0, 0, 1, 1)]]; - else if ([newPageRects count] > 1) { - // If the last page is a short orphan, try adjusting the print height slightly to see if this will squeeze the - // content onto one fewer page. If it does, use the adjusted scale. If not, use the original scale. - float lastPageHeight = NSHeight([[newPageRects lastObject] rectValue]); - if (lastPageHeight/fullPageHeight < LastPrintedPageOrphanRatio) { - NSArray *adjustedPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight * PrintingOrphanShrinkAdjustment]; - // Use the adjusted rects only if the page count went down - if ([adjustedPageRects count] < [newPageRects count]) { - newPageRects = adjustedPageRects; - _private->avoidingPrintOrphan = YES; - } - } - } _private->pageRects = [newPageRects retain]; @@ -6200,7 +6192,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection { - return [self _findString:string options:(forward ? 0 : WebFindOptionsBackwards) | (caseFlag ? 0 : WebFindOptionsCaseInsensitive) | (startInSelection ? WebFindOptionsStartInSelection : 0)]; + return [self _findString:string options:(forward ? 0 : WebFindOptionsBackwards) | (caseFlag ? 0 : WebFindOptionsCaseInsensitive) | (wrapFlag ? WebFindOptionsWrapAround : 0) | (startInSelection ? WebFindOptionsStartInSelection : 0)]; } @end diff --git a/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm index 63a91a9..96a1a42 100644 --- a/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm +++ b/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm @@ -184,9 +184,9 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; ScopeChainIterator end = scopeChain->end(); for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it) { - JSObject* object = *it; + JSObject* object = it->get(); if (object->isActivationObject()) - object = new (scopeChain->globalData) DebuggerActivation(object); + object = new (scopeChain->globalData) DebuggerActivation(*scopeChain->globalData, object); [scopes addObject:[self _convertValueToObjcValue:object]]; } diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm index 82e4f2c..e01877b 100644 --- a/Source/WebKit/mac/WebView/WebView.mm +++ b/Source/WebKit/mac/WebView/WebView.mm @@ -5834,7 +5834,7 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num) WebFrameLoadDelegateImplementationCache* cache = &_private->frameLoadDelegateImplementations; if (cache->didReceiveIconForFrameFunc) { - Image* image = iconDatabase()->iconForPageURL(core(webFrame)->loader()->url().string(), IntSize(16, 16)); + Image* image = iconDatabase()->iconForPageURL(core(webFrame)->document()->url().string(), IntSize(16, 16)); if (NSImage *icon = webGetNSImage(image, NSMakeSize(16, 16))) CallFrameLoadDelegate(cache->didReceiveIconForFrameFunc, self, @selector(webView:didReceiveIcon:forFrame:), icon, webFrame); } |