WebCore:
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2005 21:31:10 +0000 (21:31 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2005 21:31:10 +0000 (21:31 +0000)
        Reviewed by Kevin.

        - rolled in changes from experimental-ui-branch to support resizable textareas
        and find-as-you-type. The files/functions modified are listed just below. After
        that are the ChangeLog comments from the branch.

        * Resources/textAreaResizeCorner.tiff: Added.
        * WebCore.pbproj/project.pbxproj:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::findString):
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea textDidChange:]):
        (-[KWQTextAreaTextView _resizeCornerImage]):
        (-[KWQTextAreaTextView _resizeCornerRect]):
        (-[KWQTextAreaTextView resetCursorRects]):
        (-[KWQTextAreaTextView drawRect:]):
        (-[KWQTextAreaTextView mouseDown:]):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):

        2005-05-05  John Sullivan  <sullivan@apple.com>

                Reviewed by Chris.

                * kwq/KWQTextArea.mm:
                (-[KWQTextAreaTextView _resizeCornerRect]):
                Get corner rect from enclosing clipView, rather than using visibleRect.
                VisibleRect would return the wrong result when the textarea was clipped
                by the bottom of the window, leading to redraw schmutz among other things.

        2005-05-02  John Sullivan  <sullivan@apple.com>

                Reviewed by Chris.

                Improvements to resizable textarea experiment:
                - resize image is now drawn in the resize corner
                - cursor sometimes tracks to arrow when over resize corner (but usually not)
                - cursor changes to arrow on mouse down in any case

                * Resources/textAreaResizeCorner.tiff: Added.
                * WebCore.pbproj/project.pbxproj:
                updated for added image file

                * kwq/KWQTextArea.mm:
                (-[KWQTextAreaTextView _resizeCornerImage]):
                new method, reads resize image once and caches it
                (-[KWQTextAreaTextView _resizeCornerRect]):
                new method, computes rect from image
                (-[KWQTextAreaTextView resetCursorRects]):
                overridden to attempt to make the cursor change to an arrow when over this
                corner. Only works sometimes, as explained in comments.
                (-[KWQTextAreaTextView drawRect:]):
                overridden to draw resize image
                (-[KWQTextAreaTextView mouseDown:]):
                now uses _resizeCornerRect, and sets cursor to arrow when pressed in resize corner

        2005-04-18  John Sullivan  <sullivan@apple.com>

                WebCore support for notifying a form delegate when a
                textarea's contents have changed (as opposed to a
                textfield, which was already handled).

                Reviewed by Maciej.

                * kwq/WebCoreBridge.h:
                add textDidChange: method

                * kwq/KWQTextArea.mm:
                (-[KWQTextArea textDidChange:]):
                call through to bridge

        2005-04-07  John Sullivan  <sullivan@apple.com>

                WebCore support for find-as-you-type; needed an additional parameter
                to findString and searchFor:...

                Reviewed by Dave Hyatt.

                * kwq/KWQKHTMLPart.h:
                * kwq/KWQKHTMLPart.mm:
                (KWQKHTMLPart::findString):
                new findInSelection parameter; if true, start from the beginning of the selection
                when searching forward, or the end of the selection when searching backward

                * kwq/WebCoreBridge.h:
                * kwq/WebCoreBridge.mm:
                (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):
                new findInSelection parameter; passed through to findString

WebKit:

        Reviewed by Kevin.

        - rolled in changes from experimental-ui-branch to support resizable textareas
        and find-as-you-type and confirming unsubmitted form changes. The files/functions
        modified are listed just below. After that are the ChangeLog comments from the branch.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge textDidChange:]):
        * WebView.subproj/WebFormDelegate.h:
        * WebView.subproj/WebFormDelegate.m:
        (-[WebFormDelegate textDidChange:inFrame:]):
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView maintainsInactiveSelection]):
        (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]):
        (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
        * WebView.subproj/WebView.m:
        (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
        (-[WebView searchFor:direction:caseSensitive:wrap:]):
        (-[WebView makeTextStandardSize:]):
        (-[WebView maintainsInactiveSelection]):
        * WebView.subproj/WebViewPrivate.h:

        2005-04-18  John Sullivan  <sullivan@apple.com>

                WebKit support for notifying a form delegate when a
                textarea's contents have changed (as opposed to a
                textfield, which was already handled).

                Reviewed by Maciej.

                * WebView.subproj/WebFormDelegate.h:
                * WebView.subproj/WebFormDelegate.m:
                (-[WebFormDelegate textDidChange:inFrame:]):
                new form delegate method

                * WebCoreSupport.subproj/WebBridge.m:
                (-[WebBridge textDidChange:]):
                new method, calls through to form delegate

        2005-04-11  John Sullivan  <sullivan@apple.com>

                Fixed inability to wrap around in Find in Page

                * WebView.subproj/WebView.m:
                (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
                changed wrapFlag from NO to YES on two lines (copy/paste error)

        2005-04-07  John Sullivan  <sullivan@apple.com>

                WebKit support for find-as-you-type. Needed an additional parameter on
                a method from WebDocumentSearching protocol. Since that's a public protocol,
                I couldn't just add the parameter. For now I hacked it with an undeclared
                internal method that's discovered via respondsToSelector. Probably the right
                long-term approach is to deprecate the WebDocumentSearching protocol and introduce
                a replacement that has a more flexible set of parameters for possible future
                expansion.

                Reviewed by Dave Hyatt.

                * WebView.subproj/WebHTMLView.m:
                (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]):
                now calls new one-more-parameter version passing NO for new parameter to match old behavior
                (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
                new method, adds findInSelection parameter and passes it through to bridge

                * WebView.subproj/WebView.m:
                (-[WebView searchFor:direction:caseSensitive:wrap:]):
                now calls new one-more-parameter version passing NO for new parameter to match old behavior
                (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
                new method, adds findInSelection parameter and passes it through

        2005-04-07  John Sullivan  <sullivan@apple.com>

                WebKit support to allow clients to control whether the selection is still
                drawn when the first responder is elsewhere. Formerly this was hardwired
                to be true only when -[WebView isEditable] was true.

                Reviewed by Darin.

                * WebView.subproj/WebHTMLView.m:
                (-[WebHTMLView maintainsInactiveSelection]):
                check [WebView maintainsInactiveSelection] rather than just [WebView isEditable]

                * WebView.subproj/WebViewPrivate.h:
                * WebView.subproj/WebView.m:
                (-[WebView maintainsInactiveSelection]):
                new method for clients to override, returns -[self isEditable]

WebBrowser:

        Reviewed by Kevin.

        - rolled in changes from experimental-ui-branch to support resizable textareas
        and find-as-you-type and confirmations when closing tab/window/app and full screen
        mode. I renamed "WebPageBannner" to just "Banner" at the same time, since
        the banner will have to be used on non-webpages (source documents) too. The
        files/functions modified are listed just below. After that are the ChangeLog
        comments from the branch. Note that I did not roll over the LabelBanner stuff,
        though we can of course do so later if we decide to.

        * AppController.h:
        * AppController.m:
        (-[AppController _OKToCloseBrowserWindows]):
        (-[AppController applicationShouldTerminate:]):
        (-[AppController validateUserInterfaceItem:]):
        * Banner.h: Added.
        * Banner.m: Added.
        (-[Banner init]):
        (-[Banner dealloc]):
        (-[Banner bannerView]):
        (-[Banner standardBannerColor]):
        (-[Banner bannerNibName]):
        (_loadCloseButtonImages):
        (-[Banner _closeButtonClicked:]):
        (-[Banner _createCloseButton]):
        (-[Banner _populateBannerViewFromNib:]):
        (-[Banner createBannerView]):
        (-[Banner _advanceAnimation]):
        (-[Banner _moveBannerIntoPlace:withAnimation:]):
        (-[Banner didInstallBannerView]):
        (-[Banner installIntoWebView:withAnimation:]):
        (-[Banner uninstallFromWebViewWithAnimation:]):
        * BarBackground.h:
        * BarBackground.m:
        (+[BarBackground defaultBottomBorderLineColor]):
        (-[BarBackground drawRect:]):
        (-[BarBackground setBackgroundColor:]):
        (-[BarBackground setBottomBorderColor:]):
        * BrowserDocument.h:
        * BrowserDocument.m:
        (-[BrowserDocument saveDocumentTo:]):
        (-[BrowserDocument showFindPanel:]):
        (-[BrowserDocument findNext:]):
        (-[BrowserDocument findPrevious:]):
        (-[BrowserDocument reportBugToApple:]):
        (-[BrowserDocument printWebFrameView:showingPrintPanel:useSheet:]):
        (-[BrowserDocument proposeBookmarkRespectingProvisionalPage:]):
        (-[BrowserDocument validateUserInterfaceItem:]):
        (-[BrowserDocument mailPage:]):
        (-[BrowserDocument _reportLaunchFailureForMailApplicationAtPath:]):
        (-[BrowserDocument mailPageAddress:]):
        * BrowserDocumentController.h:
        * BrowserDocumentController.m:
        (-[BrowserDocumentController tabsWithUnsubmittedFormText]):
        * BrowserTabViewItem.h:
        * BrowserTabViewItem.m:
        (-[BrowserTabViewItem setView:]):
        (-[BrowserTabViewItem webView]):
        * BrowserWebController.h:
        * BrowserWebController.m:
        (-[BrowserWebView initWithDocument:request:frameName:]):
        (-[BrowserWebView dealloc]):
        (-[BrowserWebView findInPageBanner]):
        (-[BrowserWebView currentBanner]):
        (-[BrowserWebView setCurrentBanner:]):
        (-[BrowserWebView addFavoriteForParentControlledPageInFrame:]):
        (-[BrowserWebView containsEditedForm]):
        (-[BrowserWebView maintainsInactiveSelection]):
        (-[BrowserWebView dataSourceHasChanged:forFrame:]):
        (-[FormDelegate initWithDocument:]):
        (-[FormDelegate _setFormWasEdited:]):
        (-[FormDelegate controlTextDidChange:inFrame:]):
        (-[FormDelegate textDidChange:inFrame:]):
        (-[FormDelegate frameLayoutHasChanged:]):
        (-[FormDelegate dataSourceHasChangedForFrame:]):
        (-[FormDelegate formWasEdited]):
        * BrowserWindow.m:
        (-[BrowserWindow canBecomeKeyWindow]):
        (-[BrowserWindow canBecomeMainWindow]):
        * BrowserWindowController.h:
        * BrowserWindowController.m:
        (-[BrowserWindowController _makeFirstResponder:]):
        (-[BrowserWindowController mainWebFrameView]):
        (-[BrowserWindowController updateKeyboardLoop]):
        (-[BrowserWindowController webViewBannerHasChanged:]):
        (-[BrowserWindowController updateLabelForTab:evenIfTabBarHidden:]):
        (-[BrowserWindowController setUpTabForWebView:addToRightSide:]):
        (-[BrowserWindowController windowDidLoad]):
        (-[BrowserWindowController dealloc]):
        (-[BrowserWindowController _confirmCloseWindowDidEnd:returnCode:contextInfo:]):
        (-[BrowserWindowController _displayCloseConfirmation]):
        (-[BrowserWindowController windowShouldClose:]):
        (-[BrowserWindowController showLocationBarTemporarilyIfHidden]):
        (-[BrowserWindowController toggleTabBarWithAnimation:]):
        (-[BrowserWindowController _closeTabWithoutConfirming:]):
        (-[BrowserWindowController _confirmCloseTabForEditedFormDidEnd:returnCode:contextInfo:]):
        (-[BrowserWindowController _confirmClosingEditedTab:]):
        (-[BrowserWindowController closeTab:]):
        (-[BrowserWindowController closeOtherTabs:]):
        (-[BrowserWindowController reloadTabsMatchingURLs:]):
        (-[BrowserWindowController didSelectTabViewItem]):
        (-[BrowserWindowController findTabForWebView:]):
        (-[BrowserWindowController tabBarView:menuForClippedTabViewItems:]):
        (-[BrowserWindowController reloadTab:]):
        (-[BrowserWindowController reloadParentallyRestrictedFrames]):
        (-[BrowserWindowController updateDocumentIsEdited]):
        (-[BrowserWindowController defaultsDidChange]):
        (-[BrowserWindowController windowDidResignKey:]):
        (-[BrowserWindowController replaceTabSwitcher:]):
        (-[BrowserWindowController releaseTabSwitcher:]):
        (-[BrowserWindowController replaceTabURLs:usingTabLabelsFromBookmarks:]):
        (-[BrowserWindowController orderedTabs]):
        (-[BrowserWindowController tabBarView:performDragOperationForTabViewItem:URL:]):
        (-[BrowserWindowController tabsWithUnsubmittedFormText]):
        (-[BrowserWindowController canReloadTab:]):
        (-[BrowserWindowController canReloadAllTabs]):
        (-[BrowserWindowController validateMenuItem:]):
        (-[BrowserWindowController isFullScreen]):
        (-[BrowserWindowController firstResponderView]):
        (-[BrowserWindowController setFullScreen:]):
        (-[BrowserWindowController toggleFullScreen:]):
        (-[BrowserWindowController windowForSheet]):
        (-[NSTabView makeWebViewsPerformSelector:withObject:]):
        * CoachMark.h: Added.
        * CoachMark.m: Added.
        (-[CoachMark initWithBounds:forView:]):
        (-[CoachMark dealloc]):
        (-[CoachMark width]):
        (-[CoachMark setWidth:]):
        (-[CoachMark duration]):
        (-[CoachMark setDuration:]):
        (-[CoachMark fractionComplete]):
        (-[CoachMark invalidate]):
        (getHostTime):
        (-[CoachMark redrawTimer:]):
        * CoachMarkController.h: Added.
        * CoachMarkController.m: Added.
        (+[CoachMarkController sharedCoachMarkController]):
        (-[CoachMarkController init]):
        (-[CoachMarkController dealloc]):
        (-[CoachMarkController addCoachMarkWithBounds:forView:]):
        (-[CoachMarkController coachMarkExpired:]):
        * CoachMarkView.h: Added.
        * CoachMarkView.m: Added.
        (-[CoachMarkView dealloc]):
        (-[CoachMarkView setCoach:]):
        (-[CoachMarkView width]):
        (-[CoachMarkView setWidth:]):
        (-[CoachMarkView _color]):
        (-[CoachMarkView roundedRect:withRadius:]):
        (-[CoachMarkView drawRect:]):
        * ContextMenuHandler.m:
        (-[BrowserWebView downloadURLUsingSavePanel:]):
        (-[BrowserWebView reportErrorForBadFileWrapper:]):
        (-[BrowserWebView saveFileWrapperToDownloadsFolder:]):
        (-[BrowserWebView reportiPhotoErrorWithMessage:]):
        * Debug/DebugUtilities.m:
        (-[DebugUtilities createDebugMenu]):
        (-[BrowserDocument toggleTransparentWindow:]):
        (-[BrowserDocument validate_toggleUseThreadedImageDecoding:]):
        (-[BrowserDocument toggleConfirmUnsubmittedFormText:]):
        (-[BrowserDocument toggleConfirmClosingMultiplePages:]):
        (-[BrowserDocument toggleUseFindBanner:]):
        (-[BrowserDocument toggleGradient:]):
        (-[BrowserDocument validate_toggleGradient:]):
        (-[BrowserDocument showFindBannerSettings:]):
        (-[BrowserDocument validate_toggleConfirmUnsubmittedFormText:]):
        (-[BrowserDocument validate_toggleConfirmClosingMultiplePages:]):
        (-[BrowserDocument validate_toggleUseFindBanner:]):
        * Debug/FindBannerSettings.nib: Added.
        * Debug/FindBannerSettingsController.h: Added.
        * Debug/FindBannerSettingsController.m: Added.
        (+[FindBannerSettingsController sharedController]):
        (-[FindBannerSettingsController windowNibName]):
        (-[FindBannerSettingsController colorFromPopUp]):
        (-[FindBannerSettingsController selectOtherColor:]):
        (-[FindBannerSettingsController setOutlineColorFromSelectedItem]):
        (-[FindBannerSettingsController colorPickedInColorPanel:]):
        (-[FindBannerSettingsController takeOutlineColorFrom:]):
        (-[FindBannerSettingsController takeDurationFrom:]):
        (-[FindBannerSettingsController updateColorViews]):
        (-[FindBannerSettingsController toggleUseFadingOutline:]):
        (-[FindBannerSettingsController updateViews]):
        (-[FindBannerSettingsController windowDidLoad]):
        * Defaults.plist:
        * English.lproj/FindBanner.nib: Added.
        * English.lproj/Localizable.strings:
        * English.lproj/MainMenu.nib:
        * English.lproj/StringsNotToBeLocalized.txt:
        * FindBanner.h: Added.
        * FindBanner.m: Added.
        (-[FindBanner bannerNibName]):
        (-[FindBanner _updateNextAndPreviousButtons]):
        (-[FindBanner _makeSearchFieldFirstResponder]):
        (-[FindBanner didInstallBannerView]):
        (-[FindBanner controlTextDidChange:]):
        (-[FindBanner _updateFindPasteboardFromSearchField]):
        (-[FindBanner _updateSearchFieldFromFindPasteboard]):
        (-[FindBanner _searchString]):
        (-[FindBanner _searchTarget]):
        (-[FindBanner _doSearchForString:direction:caseSensitive:findInSelection:inTarget:]):
        (-[FindBanner readyToFind]):
        (-[FindBanner _setStatus:]):
        (-[FindBanner _callAttentionToSelectedText]):
        (-[FindBanner _findWithDirection:caseSensitive:findInSelection:]):
        (-[FindBanner findFromSearchField:]):
        (-[FindBanner findNext:]):
        (-[FindBanner findPrevious:]):
        (-[FindBanner focusOrHide]):
        * FormCompletionController.m:
        (+[FormCompletionController autoFillInWebView:]):
        * LocationChangeHandler.m:
        (-[LocationChangeHandler handleCertificateError:forDataSource:]):
        * PreferenceKeys.h:
        * RendezvousController.m:
        (-[RendezvousController reportErrorForServiceName:]):
        * WebBrowser.pbproj/project.pbxproj:

        2005-05-05  John Sullivan  <sullivan@apple.com>

                Reviewed by Chris.

                - preserve the first responder when going to full screen and back.

                * BrowserWindowController.m:
                (-[BrowserWindowController firstResponderView]):
                new method, full of hideous AppKit inside knowledge, that returns the view that
                is first responder, if any. If the first responder is a field editor, this returns
                the associated control. The hideous AppKit inside knowledge is all straight from
                Andrew Platzer and Mike Engber.
                (-[BrowserWindowController setFullScreen:]):
                get the first responder before switching, then reset it if it was a view that
                survived the journey to the new window. Do some special case tomfoolery to
                restore the selected range also.

        2005-05-03  John Sullivan  <sullivan@apple.com>

                Reviewed by Darin.

                - make the full screen window textured so the bookmarks bar, tab bar,
                and status bar use the same background as in a standard browser window.

                * BrowserWindowController.m:
                (-[BrowserWindowController setFullScreen:]):
                include textured window flag in style mask

        2005-05-02  John Sullivan  <sullivan@apple.com>

                Reviewed by Chris.

                Improvements to Find in Page experiment:
                - get the close button images from NSSearchField. These look better in this context
                  than the ones used for tabs.
                - move close box to right side of banner.

                * English.lproj/FindBanner.nib:
                Move views around to account for close button being moved to right side

                * WebPageBanner.m:
                (_loadCloseButtonImages):
                get images from an NSSearchFieldCell
                (-[WebPageBanner _populateBannerViewFromNib:]):
                account for close button being on right side now

        2005-04-22  John Sullivan  <sullivan@apple.com>

                 Reviewed by John.

                - first cut at full screen mode

                * BrowserWindowController.h: Added _normalWindow and _fullScreenWindow fields, toggleFullScreen:, windowForSheet,
                setFullScreen:, and isFullScreen methods.
                * BrowserWindowController.m:
                (-[BrowserWindowController _makeFirstResponder:]): Removed assertion that we end up stumbling over when switching
                to/from full screen mode. I think we can do without it.
                (-[BrowserWindowController dealloc]): Release the two new fields.
                (-[BrowserWindowController showLocationBarTemporarilyIfHidden]): Pop out of full screen mode whenever we would show
                the location bar, since right now it's not compatible with full screen.
                (-[BrowserWindowController windowDidResignKey:]): Pop out of full screen mode when a window comes in front of us.
                (-[BrowserWindowController validateMenuItem:]): Set state of toggle menu item based on current state of window.
                (-[BrowserWindowController isFullScreen]): Added.
                (-[BrowserWindowController setFullScreen:]): Added. This does the real bulk of the work.
                (-[BrowserWindowController toggleFullScreen:]): Added.
                (-[BrowserWindowController windowForSheet]): Added. Turns off full screen mode and then returns the window.

                * BrowserWindow.m:
                (-[BrowserWindow canBecomeKeyWindow]): Override to return YES. Harmless for normal window, needed for full screen window.
                (-[BrowserWindow canBecomeMainWindow]): Ditto.

                * BrowserDocument.m:
                (-[BrowserDocument saveDocumentTo:]): Get out of full screen mode before running a sheet.
                (-[BrowserDocument reportBugToApple:]): Use windowForSheet to get out of full screen mode before running a sheet.
                (-[BrowserDocument printWebFrameView:showingPrintPanel:useSheet:]): Ditto.
                (-[BrowserDocument proposeBookmarkRespectingProvisionalPage:]): Ditto.
                (-[BrowserDocument mailPage:]): Ditto.
                (-[BrowserDocument _reportLaunchFailureForMailApplicationAtPath:]): Ditto.
                (-[BrowserDocument mailPageAddress:]): Ditto.

                * BrowserWebController.m:
                (-[BrowserWebView addFavoriteForParentControlledPageInFrame:]): Ditto.

                * ContextMenuHandler.m:
                (-[BrowserWebView downloadURLUsingSavePanel:]): Use windowForSheet to get out of full screen mode before running a sheet.
                (-[BrowserWebView reportErrorForBadFileWrapper:]): Ditto.
                (-[BrowserWebView saveFileWrapperToDownloadsFolder:]): Ditto.
                (-[BrowserWebView reportiPhotoErrorWithMessage:]): Ditto.

                * Debug/DebugUtilities.m: (-[DebugUtilities createDebugMenu]): Include a Full-Screen-toggling menu item.

                * FormCompletionController.m:
                (+[FormCompletionController autoFillInWebView:]): Use windowForSheet to get out of full screen mode before running a sheet.
                * LocationChangeHandler.m:
                (-[LocationChangeHandler handleCertificateError:forDataSource:]): Ditto.
                * RendezvousController.m:
                (-[RendezvousController reportErrorForServiceName:]): Ditto.

        2005-04-21  John Sullivan  <sullivan@apple.com>

                Added confirmation on closing window with multiple tabs or quitting Safari
                with multiple windows or tabs. This confirmation can be turned on and off
                from the Debug menu; it defaults to on. Made state of "dirty dot" update
                appropriately when the pref for confirming unsubmitted form text is toggled.
                Fixed a few other bugs in this confirmation stuff.

                Reviewed by Adele.

                * PreferenceKeys.h:
                added new preference DebugConfirmClosingMultiplePagesPreferenceKey
                * Defaults.plist:
                initial value for new preference is true

                * AppController.m:
                (-[AppController _OKToCloseBrowserWindows]):
                Renamed from _OKToAbandonUnsubmittedFormText. Now considers multiple windows/tabs in
                addition to unsubmitted form text. Lots and lots of variations of the message text.
                (-[AppController applicationShouldTerminate:]):
                updated for name change

                * BrowserWebController.m:
                (-[FormDelegate _setFormWasEdited:]):
                only turn on the "dirty dot" if the pref for confirming unsubmitted form text is on

                * BrowserWindowController.h:
                added _confirmUnsubmittedFormText to cache value of this pref to avoid looking it up
                over and over
                * BrowserWindowController.m:
                (-[BrowserWindowController windowDidLoad]):
                set value of _confirmUnsubmittedFormText from NSUserDefaults
                (-[BrowserWindowController _confirmCloseWindowDidEnd:returnCode:contextInfo:]):
                changed name from _confirmCloseForEditedFormDidEnd...
                (-[BrowserWindowController _displayCloseConfirmation]):
                Changed name from _displayConfirmationSheetForUnsubmittedFormText. Now considers
                multiple tabs in addition to unsubmitted form text.
                (-[BrowserWindowController windowShouldClose:]):
                updated for name change
                (-[BrowserWindowController _confirmClosingEditedTab:]):
                removed some extraneous periods following question marks in user messages
                (-[BrowserWindowController closeTab:]):
                fixed bug where the close-tab confirmation was being put up even in the case where
                the tab was closed with no confirmation (d'oh!)
                (-[BrowserWindowController updateDocumentIsEdited]):
                new method, synchronizes the "dirty dot" with current preferences and state
                (-[BrowserWindowController defaultsDidChange]):
                now calls updateDocumentIsEdited

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                added menu item "Confirm Closing Multiple Pages"
                (-[BrowserDocument toggleConfirmClosingMultiplePages:]):
                new method, toggles the pref
                (-[BrowserDocument validate_toggleConfirmClosingMultiplePages:]):
                new method, syncs check mark on menu item

                * English.lproj/Localizable.strings:
                updated for these changes

        2005-04-20  John Sullivan  <sullivan@apple.com>

                More work on confirmations for unsubmitted form text. Now it confirms for the current page
                of any tab when closing a window. Now it confirms when closing a single tab rather than
                closing the window. Now it confirms when quitting. Now it displays the "dirty dot" in the
                close box if the window has unsubmitted form text in the current page of any tab.

                Reviewed by Adele.

                * AppController.m:
                (-[AppController _OKToAbandonUnsubmittedFormText]):
                new method, puts up app-modal dialog if necessary to confirm abandoning unsubmitted
                form text. Names one such page by title, and mentions how many others there are.
                (-[AppController applicationShouldTerminate:]):
                Check for unsubmitted form text before checking for downloads in progress.

                * BrowserDocumentController.h:
                * BrowserDocumentController.m:
                (-[BrowserDocumentController tabsWithUnsubmittedFormText]):
                new method, returns an array collected from all open windows.

                * BrowserWebController.m:
                (-[BrowserWebView initWithDocument:request:frameName:]):
                now passes self's document as an init parameter to FormDelegate
                (-[FormDelegate initWithDocument:]):
                now takes a document as an init parameter
                (-[FormDelegate _setFormWasEdited:]):
                new method, sets the local flag and also tells the window controller to
                update its UI (the "dirty dot")
                (-[FormDelegate controlTextDidChange:inFrame:]):
                call new setter method rather than setting _formWasEdited ivar directly
                (-[FormDelegate textDidChange:inFrame:]):
                ditto
                (-[FormDelegate dataSourceHasChangedForFrame:]):
                ditto

                * BrowserWindowController.h:
                new public method -tabsWithUnsubmittedFormText
                * BrowserWindowController.m:
                (-[BrowserWindowController _displayConfirmationSheetForUnsubmittedFormText]):
                renamed from _confirmCloseForEditedForm; now handles the logic about whether confirmation
                is necessary that was formerly handled by the caller. Now names page by title instead of
                URL. Now handles 1, 2, and 3-or-more dirty tab cases (used to only check frontmost tab).
                Now brings dirty tab to front before showing sheet, if necessary.
                (-[BrowserWindowController windowShouldClose:]):
                moved some code into _displayConfirmationSheetForUnsubmittedFormText
                (-[BrowserWindowController _closeTabWithoutConfirming:]):
                new method, contains code formerly in -closeTab:
                (-[BrowserWindowController _confirmCloseTabForEditedFormDidEnd:returnCode:contextInfo:]):
                new method, called when sheet is dismissed. Closes the tab without confirming or does nothing.
                (-[BrowserWindowController _confirmClosingEditedTab:]):
                new method, puts up confirmation sheet for edited tab
                (-[BrowserWindowController closeTab:]):
                now checks whether confirmation is necessary instead of closing immediately as it did before
                (-[BrowserWindowController tabsWithUnsubmittedFormText]):
                new method, returns an array of tabs from this window; used when closing the window and when quitting

                * English.lproj/Localizable.strings:
                updated for these changes

        2005-04-18  John Sullivan  <sullivan@apple.com>

                Added Debug menu item to control whether to confirm before closing a window that
                contains unsubmitted form text.

                Reviewed by Kevin.

                * PreferenceKeys.h:
                new default DebugConfirmTossingUnsubmittedFormTextPreferenceKey
                * Defaults.plist:
                initial value of new default is true

                * BrowserWindowController.m:
                (-[BrowserWindowController windowShouldClose:]):
                only confirm if the preference is set

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                add menu item "Confirm Unsubmitted Form Text"
                (-[BrowserDocument toggleConfirmUnsubmittedFormText:]):
                callback from menu item, toggles the default value
                (-[BrowserDocument validate_toggleConfirmUnsubmittedFormText:]):
                validate the menu item by adding a checkmark if appropriate

        2005-04-18  John Sullivan  <sullivan@apple.com>

                Made form-text-changed confirmation work for textareas as well as textfields.

                Reviewed by Maciej.

                * BrowserWebController.m:
                (-[FormDelegate textDidChange:inFrame:]):
                implement this new FormDelegate method to set the dirty bit

        2005-04-18  John Sullivan  <sullivan@apple.com>

                First cut at confirming before closing a window that contains edited form text.

                Reviewed by Adele.

                * BrowserWebController.h:
                new method -containsEditedForm

                * BrowserWebController.m:
                (-[BrowserWebView containsEditedForm]):
                new method; asks FormDelegate object
                (-[BrowserWebView dataSourceHasChanged:forFrame:]):
                now calls dataSourceHasChangedForFrame: rather than frameLayoutHasChanged: on
                FormDelegate object
                (-[FormDelegate controlTextDidChange:inFrame:]):
                set _formWasEdited bit
                (-[FormDelegate dataSourceHasChangedForFrame:]):
                new method; calls frameLayoutHasChanged (to match old behavior), clears _formWasEdited bit
                (-[FormDelegate formWasEdited]):
                new method; returns _formWasEdited bit

                * BrowserWindowController.m:
                (-[BrowserWindowController _confirmCloseForEditedFormDidEnd:returnCode:contextInfo:]):
                if user hit Close button, close the window now, else do nothing
                (-[BrowserWindowController _confirmCloseForEditedForm]):
                put up a confirmation sheet
                (-[BrowserWindowController windowShouldClose:]):
                if the current page returns yes for containsEditedForm

                * English.lproj/Localizable.strings:
                Updated for text in confirmation sheet.

        2005-04-13  John Sullivan  <sullivan@apple.com>

                Added a close box to all banners (using same art as tabs, which is pretty
                ugly; we'll have to prettify this).
                Fixed a small redraw bug with the sliding-in/out animation.

                Reviewed by Dave Hyatt.

                * WebPageBanner.m:
                (_loadCloseButtonImages):
                new function, loads the three images used by the close button into static
                variables so we don't load from the bundle every time a banner is used.
                (-[WebPageBanner _closeButtonClicked:]):
                new method, closes the banner
                (-[WebPageBanner _createCloseButton]):
                new method, creates a RolloverImageButton with the right attributes, images,
                and size
                (-[WebPageBanner _populateBannerViewFromNib:]):
                put the close button in as first subview, at a standard location
                (-[WebPageBanner _advanceAnimation]):
                use setFocusRingNeedsDisplayInRect: instead of just setNeedsDisplay: to avoid
                focus ring schmutz from being left behind during the animation

        2005-04-13  John Sullivan  <sullivan@apple.com>

                Added support for tabbing through banners, and made it work for the Find banner.

                Reviewed by Chris.

                * BrowserWindowController.h:
                new webViewBannerHasChanged: method for BrowserWebView to call
                * BrowserWindowController.m:
                (-[BrowserWindowController updateKeyboardLoop]):
                insert the current banner into the keyboard loop
                (-[BrowserWindowController webViewBannerHasChanged:]):
                call updateKeyboardLoop

                * BrowserWebController.m:
                (-[BrowserWebView setCurrentBanner:]):
                call webViewBannerHasChanged:

                * WebPageBanner.h:
                new outlets for first and last subviews for keyboard loop
                * WebPageBanner.m:
                (-[WebPageBanner _populateBannerViewFromNib:]):
                use new outlets and BarBackgrounds support for keyboard loops to wire
                the subviews into the keyboard loop

                * English.lproj/FindBanner.nib:
                Wired the nextKeyView connections up, and wired up the new firstChildSubview and
                lastChildSubview outlets.

        2005-04-12  John Sullivan  <sullivan@apple.com>

                Made banners animate into and out of place (no animation occurs if
                one banner is switching to another).

                Reviewed by Maciej.

                * WebPageBanner.h:
                added animation parameters to install and uninstall methods; some new
                animation-related ivars

                * WebPageBanner.m:
                (-[WebPageBanner _advanceAnimation]):
                new method, repositions banner and resizes webview based on fraction
                complete of animation
                (-[WebPageBanner _moveBannerIntoPlace:withAnimation:]):
                new method, initializes and starts animation
                (-[WebPageBanner didInstallBannerView]):
                new method for subviews to override; does nothing here
                (-[WebPageBanner installIntoWebView:withAnimation:]):
                added withAnimation: parameter; removed the webView-sizing code that's
                now done in _advanceAnimation; calls didInstallBannerView right before
                animating
                (-[WebPageBanner uninstallFromWebViewWithAnimation:]):
                ditto

                * FindBanner.m:
                (-[FindBanner didInstallBannerView]):
                set up initial state here rather than in installIntoWebView: so that views
                look correct during the animation

                * BrowserWebController.m:
                (-[BrowserWebView setCurrentBanner:]):
                animate unless we're switching from one banner to another

        2005-04-12  John Sullivan  <sullivan@apple.com>

                Disable Next/Previous buttons in Find banner appropriately.
                Also, Command-F now focuses the find-in-page search field in all cases except
                when it's already focused; in that case it hides the banner.

                Reviewed by Chris.

                * BrowserDocument.m:
                (-[BrowserDocument showFindPanel:]):
                If the Find banner is already showing, call new focusOrHide method on it.

                * FindBanner.h:
                declare new focusOrHide method
                * FindBanner.m:
                (-[FindBanner _updateNextAndPreviousButtons]):
                new method, enables the Next/Previous buttons if readyToFind returns YES
                (-[FindBanner _makeSearchFieldFirstResponder]):
                new method, extracted from installIntoWebView
                (-[FindBanner installIntoWebView:]):
                now calls extracted method; also now calls _updateNextAndPreviousButtons
                (-[FindBanner controlTextDidChange:]):
                new method, calls _updateNextAndPreviousButtons
                (-[FindBanner _updateFindPasteboardFromSearchField]):
                renamed to start with underscore for consistency (though I didn't make all
                the other ones consistent yet)
                (-[FindBanner _findWithDirection:caseSensitive:findInSelection:]):
                updated for name change
                (-[FindBanner findFromSearchField:]):
                ditto
                (-[FindBanner focusOrHide]):
                new method, hides the banner if the search field is focused, otherwise
                focuses the search field. (Makes Command-F do what seems natural to me.)

                * WebPageBanner.h:
                Declare _webView a BrowserWebView*, not just a WebView*. Replace #import of
                WebView.h with a @class declaration of BrowserWebView
                * WebPageBanner.m:
                add #import of BrowserWebController.h
                (-[WebPageBanner installIntoWebView:]):
                change parameter from WebView* to BrowserWebView* to match superclass

        2005-04-12  John Sullivan  <sullivan@apple.com>

                Added slider to Find Banner Settings window to control fading-outline duration.
                Made Next and Previous buttons in Find banner highlight on Command-G and Command-Shift-G

                Reviewed by Vicki.

                * PreferenceKeys.h:
                * Defaults.plist:
                new preference DebugFindOutlineDurationPreferenceKey

                * CoachMark.m:
                (-[CoachMark initWithBounds:forView:]):
                Read the duration from preferences

                * Debug/FindBannerSettings.nib:
                added Duration slider

                * Debug/FindBannerSettingsController.h:
                * Debug/FindBannerSettingsController.m:
                (-[FindBannerSettingsController takeDurationFrom:]):
                new method, sets preference from duration slider
                (-[FindBannerSettingsController updateViews]):
                sets slider value from preferences

                * English.lproj/FindBanner.nib:
                Added key equivalents for Next and Previous buttons

        2005-04-11  Kevin Decker  <kdecker@apple.com>

                Reviewed by John.

                * BarBackground.h: Need to be able to specify a different bottom line color. Added ivar and method to do this.
                * BarBackground.m: Ditto
                (+[BarBackground defaultBottomBorderLineColor]): Renamed method.
                (-[BarBackground drawRect:]): If bottom border color hasn't been specified, use the default.
                (-[BarBackground setBottomBorderColor:]): Added
                * Debug/DebugUtilities.m: Created a toggle for a gradient filled version of our banner.
                (-[DebugUtilities createDebugMenu]):
                (-[BrowserDocument toggleGradient:]): Added.
                (-[BrowserDocument validate_toggleGradient:]): Added.
                * PreferenceKeys.h: Added DebugGradientBannerKey.
                * Resources/Images/BannerBackground.tiff: Added.
                * WebPageBanner.h:
                * WebPageBanner.m:  Checked user preferences for the gradient look.
                (-[WebPageBanner dealloc]): Deallocate the gradient NSImageView.
                (-[WebPageBanner _populateBannerViewFromNib:]):
                (-[WebPageBanner createBannerView]): Checked user preferences for the gradient look. Also adds a one pixel border to the bottom of the banner.

        2005-04-11  John Sullivan  <sullivan@apple.com>

                Added Debug-menu window to tweak with Find in Page settings. The new initial
                setting is a bright red fading round rect. I think this works much better than
                the "Alternate Selection Color" fading round rect that was used before (still a
                choice in the settings window).

                Reviewed by Chris.

                * PreferenceKeys.h:
                * Defaults.plist:
                New NSUserDefaults keys:
                DebugUseFindOutlinePreferenceKey
                DebugFindOutlineIsSelectionColorPreferenceKey
                DebugFindOutlineIsAlternateSelectionColorPreferenceKey
                DebugFindOutlineCustomColorPreferenceKey

                * CoachMark.m:
                (-[CoachMark initWithBounds:forView:]):
                just added a comment

                * CoachMarkView.m:
                (-[CoachMarkView _color]):
                new method, determines color by checking various new preferences
                (-[CoachMarkView drawRect:]):
                call new method

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                add "Show Find Banner Settings" item
                (-[BrowserDocument showFindBannerSettings:]):
                new method, opens Find Banner Settings window

                * Debug/FindBannerSettings.nib: Added.
                Nib for Find Banner Settings window. I'll be adding more stuff to this, but for
                now it has a checkbox for drawing the fading outlines, and a pop-up menu to
                choose a color.

                * Debug/FindBannerSettingsController.h: Added.
                * Debug/FindBannerSettingsController.m: Added.
                (+[FindBannerSettingsController sharedController]):
                new method, returns single instance
                (-[FindBannerSettingsController windowNibName]):
                returns name of nib file
                (-[FindBannerSettingsController colorFromPopUp]):
                new method, determines an NSColor from the selected item in the popup menu
                (-[FindBannerSettingsController selectOtherColor:]):
                new method, used by "Other..." item
                (-[FindBannerSettingsController setOutlineColorFromSelectedItem]):
                new method, sets the new preference based on the selected item in the popup
                (-[FindBannerSettingsController colorPickedInColorPanel:]):
                new method, updates the "Other" color
                (-[FindBannerSettingsController takeOutlineColorFrom:]):
                new method, callback from selected menu item in color menu
                (-[FindBannerSettingsController updateColorViews]):
                new method, synchronizes the color menu and  with prefs values
                (-[FindBannerSettingsController toggleUseFadingOutline:]):
                new method, toggles pref that controls fading outline (CoachMark)
                (-[FindBannerSettingsController updateViews]):
                new method, just calls updateColorViews (will do more later)
                (-[FindBannerSettingsController windowDidLoad]):
                new method, sets up color menu and views

                * FindBanner.m:
                (-[FindBanner _callAttentionToSelectedText]):
                new method, extracted from _findWithDirection:... Now respects new preference.
                (-[FindBanner _findWithDirection:caseSensitive:findInSelection:]):
                Now calls extracted method.

                * WebBrowser.pbproj/project.pbxproj:
                updated for new files

        2005-04-08  John Sullivan  <sullivan@apple.com>

                First cut at using the fading-oval approach to highlighting the found text. Kinda cool;
                probably needs some tweaking.

                Reviewed by Kevin.

                * CoachMark.m:
                (getHostTime):
                remove cast to eliminate compiler warning

                * FindBanner.m:
                (-[FindBanner _findWithDirection:caseSensitive:findInSelection:]):
                hackily determine the selection rect after finding text, and slap a fading oval around it.

        2005-04-08  John Sullivan  <sullivan@apple.com>

                Checked in the CoachMark classes stolen from Preview.
                I'll be using these as a Find in Page feedback experiment.
                I checked these files in verbatim, and they aren't yet
                used anywhere.

                * CoachMark.h: Added.
                * CoachMark.m: Added.
                (-[CoachMark initWithBounds:forView:]):
                (-[CoachMark dealloc]):
                (-[CoachMark width]):
                (-[CoachMark setWidth:]):
                (-[CoachMark duration]):
                (-[CoachMark setDuration:]):
                (-[CoachMark fractionComplete]):
                (-[CoachMark invalidate]):
                (getHostTime):
                (-[CoachMark redrawTimer:]):
                * CoachMarkController.h: Added.
                * CoachMarkController.m: Added.
                (+[CoachMarkController sharedCoachMarkController]):
                (-[CoachMarkController init]):
                (-[CoachMarkController dealloc]):
                (-[CoachMarkController addCoachMarkWithBounds:forView:]):
                (-[CoachMarkController coachMarkExpired:]):
                * CoachMarkView.h: Added.
                * CoachMarkView.m: Added.
                (-[CoachMarkView dealloc]):
                (-[CoachMarkView setCoach:]):
                (-[CoachMarkView width]):
                (-[CoachMarkView setWidth:]):
                (-[CoachMarkView roundedRect:withRadius:]):
                (-[CoachMarkView drawRect:]):

                * WebBrowser.pbproj/project.pbxproj:
                updated for new files

        2005-04-07  John Sullivan  <sullivan@apple.com>

                Fixed problem where each letter typed in find-as-you-type would jump to
                the next instance of the text to find, instead of extending the selection
                when appropriate.

                Reviewed by Dave Hyatt.

                * FindBanner.m:
                (-[FindBanner _doSearchForString:direction:caseSensitive:findInSelection:inTarget:]):
                added findInSelection parameter, passes through to WebKit
                (-[FindBanner _findWithDirection:caseSensitive:findInSelection:]):
                added findInSelection parameter, passes through to _doSearchForString:
                (-[FindBanner findFromSearchField:]):
                pass YES for findInSelection parameter
                (-[FindBanner findNext:]):
                pass NO for findInSelection parameter
                (-[FindBanner findPrevious:]):
                pass NO for findInSelection parameter

        2005-04-07  John Sullivan  <sullivan@apple.com>

                First draft at search-as-you-type using the Find banner. There are some
                obvious flaws, perhaps the most obvious being that adding a letter will start
                the new search from the end of the current selection. But it works well enough
                to start seeing the flaws, so that's a good thing.

                Reviewed by Darin.

                * BrowserDocument.h:
                declare findNext: and findPrevious: methods
                * BrowserDocument.m:
                (-[BrowserDocument findNext:]):
                call through to FindBanner (or AppController if the pref is set to not use banner)
                (-[BrowserDocument findPrevious:]):
                ditto
                (-[BrowserDocument validateUserInterfaceItem:]):
                findNext: and findPrevious: are enabled if the Find banner returns YES
                for readyToFind

                * BrowserWebController.h:
                the findInPageBanner is now declared as a FindBanner*
                * BrowserWebController.m:
                (-[BrowserWebView findInPageBanner]):
                now returns a FindBanner* rather than just a WebPageBanner*
                (-[BrowserWebView maintainsInactiveSelection]):
                override this new WebView method to return YES if the first responder
                is in a banner on the page.

                * English.lproj/FindBanner.nib:
                Turn off the "sendsWholeSearchString" bit so the searching is as-you-type

                * English.lproj/MainMenu.nib:
                make "Find Again" and "Find Previous" target the first responder rather
                than the AppController, so BrowserDocument can intercept them.

                * FindBanner.h:
                made -readyToFind public so it can be used in -[BrowserDocument validateUserInterfaceItem:]
                * FindBanner.m:
                (-[FindBanner _findWithDirection:caseSensitive:]):
                remove the #if guards around the code that forces the first responder to
                stay in the textfield as you type.

        2005-04-06  John Sullivan  <sullivan@apple.com>

                Refactored the code that populates the Find banner from the nib so
                that other WebPageBanners can do the same thing. Kevin will take
                advantage of this shortly.

                Reviewed by Maciej.

                * WebPageBanner.h:
                added bannerContents IBOutlet and -bannerNibName method, both used in nib loading
                * WebPageBanner.m:
                (-[WebPageBanner bannerNibName]):
                new method, returns nil, subclasses can override to use built-in view population method
                (-[WebPageBanner _populateBannerViewFromNib:]):
                new method, generalized from FindBanner code, extracts all the subviews of a given
                nib object and sticks 'em in the banner
                (-[WebPageBanner createBannerView]):
                now calls _populateBannerViewFromNib:

                * English.lproj/FindBanner.nib:
                wired up new bannerContents outlet

                * FindBanner.m:
                removed override of createBannerView since superclass does this now
                (-[FindBanner bannerNibName]):
                implement this one-liner in its place

        2005-04-06  John Sullivan  <sullivan@apple.com>

                First cut at making the Find Banner actually find. I copied/pasted/simplified
                code from the existing Find dialog (which would eventually go away if we
                adopt this new model, so I didn't feel guilty about duplicating the code).
                I haven't cleaned this all up nicely yet, but I wanted to get this semi-working
                version in. It's only semi-working because it doesn't do find-as-you-type, only
                find-when-you-hit-return. That's because the found text is only drawn as selected
                when the webview is first responder, which makes find-as-you-type useless. I'll
                add WebKit support for showing the selection when not first responder soon, and
                then make find-as-you-type work.

                Reviewed by Kevin.

                * English.lproj/FindBanner.nib: Added. Contains the views that will be in the banner.

                * WebPageBanner.m:
                (-[WebPageBanner createBannerView]):
                used #defines for initial width and standard height for clarity
                (-[WebPageBanner installIntoWebView:]):
                removed obsolete comment

                * FindBanner.h: Added.
                * FindBanner.m: Added.
                (-[FindBanner createBannerView]):
                overridden to install subviews from nib
                (-[FindBanner installIntoWebView:]):
                overridden to set focus on search field

                The following methods are all copied/pasted from FindPanelController,
                then tweaked (mostly simplified) to work here.
                (-[FindBanner updateFindPasteboardFromSearchField]):
                (-[FindBanner _updateSearchFieldFromFindPasteboard]):
                (-[FindBanner _searchString]):
                (-[FindBanner _searchTarget]):
                (-[FindBanner _doSearchForString:direction:caseSensitive:inTarget:]):
                (-[FindBanner readyToFind]):
                (-[FindBanner _setStatus:]):
                (-[FindBanner _findWithDirection:caseSensitive:]):
                (-[FindBanner findFromSearchField:]):
                (-[FindBanner findNext:]):
                (-[FindBanner findPrevious:]):

                * BrowserWebController.m:
                (-[BrowserWebView findInPageBanner]):
                Create a FindBanner, not just a generic WebPageBanner. Took out the temporary
                hack contents.

                * WebBrowser.pbproj/project.pbxproj:
                updated for new files

        2005-04-05  John Sullivan  <sullivan@apple.com>

                Some work in the direction of making Find in the Edit menu
                use the Find banner. The Debug menu now has a toggle item
                that controls whether Find in Page (command-F) uses the
                banner or not. I've left the Find dialog in for now so we
                can compare behaviors easily.

                Reviewed by Kevin.

                * PreferenceKeys.h:
                new preference key to control whether Command-F "Find" uses Find bar

                * AppController.h:
                declare NSUserInterfaceValidations protocol so other code can call
                through to [AppController validateUserInterfaceItem:] without making
                the compiler upset.
                * AppController.m:
                (-[AppController validateUserInterfaceItem:]):
                Reset menu title and state to the old as-in-nib versions ("Find�, unchecked)

                * BrowserDocument.h:
                declare showFindPanel: IBAction
                * BrowserDocument.m:
                (-[BrowserDocument showFindPanel:]):
                if the new pref isn't set, just call through to AppController. if it is, toggle
                the Find panel (using code formerly in DebugUtilities)
                (-[BrowserDocument validateUserInterfaceItem:]):
                When Find banner is not showing, use "Find in Page�, unchecked. When Find banner
                is showing, use "Find in Page", checked. Probably we can come up with something
                less weird.

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                remove menu item for toggling Find bar; add menu item for toggling preference
                that controls whether Command-F "Find" uses Find bar
                (-[BrowserDocument toggleUseFindBanner:]):
                new method, toggles preference
                (-[BrowserDocument validate_toggleUseFindBanner:]):
                new method, checks or unchecks according to preference

                * English.lproj/Localizable.strings:
                updated for these changes

                * English.lproj/MainMenu.nib:
                changed target of "Find� menu item to be FirstResponder rather than AppController

        2005-04-05  John Sullivan  <sullivan@apple.com>

                More work on banner mechanism. Made each BrowserWebView have its own
                Find In Page banner (no content yet), in order to enable hiding that
                particular banner rather than hiding whatever banner happened to be
                showing. Renamed some methods and variables for clarity.

                Reviewed by Kevin.

                * BrowserWebController.h:
                added _findInPageBanner, renamed _banner -> _currentBanner; added
                -findInPageBanner, renamed -banner -> -currentBanner and -setBanner:
                -> -setCurrentBanner:
                * BrowserWebController.m:
                (-[BrowserWebView dealloc]):
                updated for renamings, and now releases _findInPageBanner
                (-[BrowserWebView findInPageBanner]):
                new method, lazily creates banner that will be used for Find in Page
                (-[BrowserWebView currentBanner]):
                updated for renamings
                (-[BrowserWebView setCurrentBanner:]):
                ditto

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                changed Show/Hide Test Banner to Show/Hide Find Banner (this will go away
                entirely when I hook the Find banner up to the existing Find menu item)
                (-[BrowserDocument toggleFindInPageBanner:]):
                renamed from toggleBanner:; the code to create the banner is now in
                BrowserWebView. This method now checks for the specific banner rather
                than hiding whatever banner is showing.
                (-[BrowserDocument validate_toggleFindInPageBanner:]):
                updated for renamings, and now checks for the specific banner

        2005-04-04  John Sullivan  <sullivan@apple.com>

                Reviewed by Maciej.

                * BrowserTabViewItem.h:
                added _webView ivar
                * BrowserTabViewItem.m:
                (-[BrowserTabViewItem setView:]):
                find webView inside passed-in view, stash in ivar
                (-[BrowserTabViewItem webView]):
                return cached webview

                * BrowserWindowController.m:
                (-[BrowserWindowController setUpTabForWebView:addToRightSide:]):
                make tab item's view be a container holding the webview, rather
                than the webview itself. That way we can insert the banner later
                in a per-tab manner.

                * Debug/DebugUtilities.m:
                (-[BrowserDocument toggleBanner:]):
                don't use a static banner anymore since there can be more than one.

                * WebPageBanner.m:
                (-[WebPageBanner installIntoWebView:]):
                added support for unflipped parent view, works with generic NSView.
                I could have flipped the container view created in the tab, but this
                way is more general.
                (-[WebPageBanner uninstallFromWebView]):
                ditto

        2005-04-04  John Sullivan  <sullivan@apple.com>

                To make the blue banners work with tabs, I'll have to make the BrowserTabItem's view
                not be the webView itself but rather a new container view that holds the webView and
                optionally a banner. This checkin refactors the code that assumes that
                [BrowserTabItem view] is a webView to not assume that. I'll make the actual view
                hierarchy change in a separate checkin.

                * BrowserTabViewItem.h:
                Made -webView a public method. This method was implemented but not public and not
                used internally, so I guess it was either going to be public or used to be public.
                But regardless of the past, I wanted it public again, so public it shall be.

                * BrowserWindowController.m:
                (-[BrowserWindowController mainWebFrameView]):
                replaced code that casts [BrowserTabViewItem view] to a WebView with code
                to call [BrowserTabViewItem webView], since soon [BrowserTabViewItem view]
                won't be a webView.
                (-[BrowserWindowController updateKeyboardLoop]):
                (-[BrowserWindowController updateLabelForTab:evenIfTabBarHidden:]):
                (-[BrowserWindowController toggleTabBarWithAnimation:]):
                (-[BrowserWindowController closeTab:]):
                (-[BrowserWindowController closeOtherTabs:]):
                (-[BrowserWindowController reloadTabsMatchingURLs:]):
                (-[BrowserWindowController didSelectTabViewItem]):
                (-[BrowserWindowController findTabForWebView:]):
                (-[BrowserWindowController tabBarView:menuForClippedTabViewItems:]):
                (-[BrowserWindowController reloadTab:]):
                (-[BrowserWindowController reloadParentallyRestrictedFrames]):
                (-[BrowserWindowController replaceTabSwitcher:]):
                (-[BrowserWindowController releaseTabSwitcher:]):
                (-[BrowserWindowController replaceTabURLs:usingTabLabelsFromBookmarks:]):
                (-[BrowserWindowController orderedTabs]):
                (-[BrowserWindowController tabBarView:performDragOperationForTabViewItem:URL:]):
                (-[BrowserWindowController canReloadTab:]):
                (-[BrowserWindowController canReloadAllTabs]):
                (-[NSTabView makeWebViewsPerformSelector:withObject:]):
                ditto

                * WebPageBanner.m:
                (-[WebPageBanner standardBannerColor]):
                Made #defines for the RGB values

        2005-04-04  John Sullivan  <sullivan@apple.com>

                - first cut at transient blue bar to be used for page metadata, find, and
                pop-up banner experiments. It doesn't do anything yet other than show and
                hide itself on demand. It doesn't yet work with multiple tabs (I'll fix
                that next.)

                I made the bar use the blue color that Kevin extracted from Mail's mailbox
                tableview. To see a demo, choose "Show Banner" and then "Hide Banner" from
                the Debug menu.

                Reviewed by Kevin. (Reviews not strictly required for experimental checkins,
                but it's never a bad idea.)

                * WebPageBanner.h: Added.
                * WebPageBanner.m: Added.
                (-[WebPageBanner init]):
                calls createBannerView
                (-[WebPageBanner dealloc]):
                cleans up
                (-[WebPageBanner bannerView]):
                returns ivar
                (-[WebPageBanner standardBannerColor]):
                returns standard color in case subclasses want to use it in a createBannerView override
                (-[WebPageBanner createBannerView]):
                creates new BarBackground with the standard color. Clients can add subviews to this
                view, or could subclass and override to create the view a completely different way.
                (-[WebPageBanner installIntoWebView:]):
                squeezes itself above the webview (no animation yet)
                (-[WebPageBanner uninstallFromWebView]):
                removes itself and restores webview (no animation yet)

                * BrowserWebController.h:
                * BrowserWebController.m:
                (-[BrowserWebView dealloc]):
                release _banner ivar
                (-[BrowserWebView banner]):
                returns ivar
                (-[BrowserWebView setBanner:]):
                sets the banner; call with nil to hide the banner. Currently only one banner can
                be showing at a time.

                * Debug/DebugUtilities.m:
                (-[DebugUtilities createDebugMenu]):
                add menu item to test banner
                (-[BrowserDocument toggleBanner:]):
                show or hide banner
                (-[BrowserDocument validate_toggleBanner:]):
                change menu item text to "Show Banner" or "Hide Banner"

                * WebBrowser.pbproj/project.pbxproj:
                updated for new class files

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/Resources/textAreaResizeCorner.tiff [new file with mode: 0644]
WebCore/WebCore.pbproj/project.pbxproj
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQTextArea.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebFormDelegate.h
WebKit/WebView.subproj/WebFormDelegate.m
WebKit/WebView.subproj/WebHTMLView.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewPrivate.h

index 438f4c9d66dc11dce08be2ac0977b8a16259fe1b..3d592eac68fee1f1091d10f7092e7e617728b7c3 100644 (file)
@@ -1,3 +1,96 @@
+2005-05-12  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Kevin.
+        
+        - rolled in changes from experimental-ui-branch to support resizable textareas
+        and find-as-you-type. The files/functions modified are listed just below. After
+        that are the ChangeLog comments from the branch.
+
+        * Resources/textAreaResizeCorner.tiff: Added.
+        * WebCore.pbproj/project.pbxproj:
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::findString):
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea textDidChange:]):
+        (-[KWQTextAreaTextView _resizeCornerImage]):
+        (-[KWQTextAreaTextView _resizeCornerRect]):
+        (-[KWQTextAreaTextView resetCursorRects]):
+        (-[KWQTextAreaTextView drawRect:]):
+        (-[KWQTextAreaTextView mouseDown:]):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):
+
+        2005-05-05  John Sullivan  <sullivan@apple.com>
+
+                Reviewed by Chris.
+
+                * kwq/KWQTextArea.mm:
+                (-[KWQTextAreaTextView _resizeCornerRect]):
+                Get corner rect from enclosing clipView, rather than using visibleRect.
+                VisibleRect would return the wrong result when the textarea was clipped
+                by the bottom of the window, leading to redraw schmutz among other things.
+
+        2005-05-02  John Sullivan  <sullivan@apple.com>
+
+                Reviewed by Chris.
+                
+                Improvements to resizable textarea experiment:
+                - resize image is now drawn in the resize corner
+                - cursor sometimes tracks to arrow when over resize corner (but usually not)
+                - cursor changes to arrow on mouse down in any case
+
+                * Resources/textAreaResizeCorner.tiff: Added.
+                * WebCore.pbproj/project.pbxproj:
+                updated for added image file
+                
+                * kwq/KWQTextArea.mm:
+                (-[KWQTextAreaTextView _resizeCornerImage]):
+                new method, reads resize image once and caches it
+                (-[KWQTextAreaTextView _resizeCornerRect]):
+                new method, computes rect from image
+                (-[KWQTextAreaTextView resetCursorRects]):
+                overridden to attempt to make the cursor change to an arrow when over this
+                corner. Only works sometimes, as explained in comments.
+                (-[KWQTextAreaTextView drawRect:]):
+                overridden to draw resize image
+                (-[KWQTextAreaTextView mouseDown:]):
+                now uses _resizeCornerRect, and sets cursor to arrow when pressed in resize corner
+
+        2005-04-18  John Sullivan  <sullivan@apple.com>
+
+                WebCore support for notifying a form delegate when a
+                textarea's contents have changed (as opposed to a 
+                textfield, which was already handled).
+
+                Reviewed by Maciej.
+
+                * kwq/WebCoreBridge.h:
+                add textDidChange: method
+
+                * kwq/KWQTextArea.mm:
+                (-[KWQTextArea textDidChange:]):
+                call through to bridge
+
+        2005-04-07  John Sullivan  <sullivan@apple.com>
+
+                WebCore support for find-as-you-type; needed an additional parameter
+                to findString and searchFor:...
+
+                Reviewed by Dave Hyatt.
+
+                * kwq/KWQKHTMLPart.h:
+                * kwq/KWQKHTMLPart.mm:
+                (KWQKHTMLPart::findString):
+                new findInSelection parameter; if true, start from the beginning of the selection
+                when searching forward, or the end of the selection when searching backward
+                
+                * kwq/WebCoreBridge.h:
+                * kwq/WebCoreBridge.mm:
+                (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):
+                new findInSelection parameter; passed through to findString
+
 2005-05-12  Darin Adler  <darin@apple.com>
 
         Reviewed by Maciej (except for some parts outside the ECMA directory).
diff --git a/WebCore/Resources/textAreaResizeCorner.tiff b/WebCore/Resources/textAreaResizeCorner.tiff
new file mode 100644 (file)
index 0000000..0831ed2
Binary files /dev/null and b/WebCore/Resources/textAreaResizeCorner.tiff differ
index c427776d9b3e975c470742364c238d47c32283bc..219e21fc708bf63137a815e2b9f256a7590711f3 100644 (file)
                        children = (
                                93F19B1908245E59001E9ABC,
                                84C0FA1E052B9652000440A1,
+                               ED048ABB0833F132006E1E67,
                                F5A1B05302DE8B46018635CA,
                                BC8F62990405F45600A80004,
                        );
                                93F19A0908245E59001E9ABC,
                                93F19A0A08245E59001E9ABC,
                                93F19A0B08245E59001E9ABC,
+                               ED048ABC0833F132006E1E67,
                        );
                        isa = PBXResourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
 //ED2
 //ED3
 //ED4
+               ED048ABB0833F132006E1E67 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = image.tiff;
+                       name = textAreaResizeCorner.tiff;
+                       path = Resources/textAreaResizeCorner.tiff;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               ED048ABC0833F132006E1E67 = {
+                       fileRef = ED048ABB0833F132006E1E67;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                EDA4AC97076FB89100DD23EC = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
index 70dcbf86c311bc99d79e16f6ac5260ab1384db49..72f83e7630d526c3ed1a963c028759790aa25e78 100644 (file)
@@ -295,7 +295,7 @@ public:
     NSString *searchForLabelsBeforeElement(NSArray *labels, DOM::ElementImpl *element);
     NSString *matchLabelsAgainstElement(NSArray *labels, DOM::ElementImpl *element);
 
-    bool findString(NSString *str, bool forward, bool caseFlag, bool wrapFlag);
+    bool findString(NSString *str, bool forward, bool caseFlag, bool wrapFlag, bool findInSelection);
 
     void setSettings(KHTMLSettings *);
 
index be8addf947506d637f0e7de519cce0984e2aaedc..ac7d4db4c85d7f6640ab4e07e116ea5f2a4f4aa5 100644 (file)
@@ -599,9 +599,9 @@ NSString *KWQKHTMLPart::matchLabelsAgainstElement(NSArray *labels, ElementImpl *
     return nil;
 }
 
-// Search from the end of the currently selected location if we are first responder, or from
-// the beginning of the document if nothing is selected or we're not first responder.
-bool KWQKHTMLPart::findString(NSString *string, bool forward, bool caseFlag, bool wrapFlag)
+// Searches from the beginning of the document if nothing is selected. Will search in selection if
+// findInSelection is true, otherwise starts just after (forward) or before (backward) the selection.
+bool KWQKHTMLPart::findString(NSString *string, bool forward, bool caseFlag, bool wrapFlag, bool findInSelection)
 {
     QString target = QString::fromNSString(string);
     if (target.isEmpty()) {
@@ -613,9 +613,9 @@ bool KWQKHTMLPart::findString(NSString *string, bool forward, bool caseFlag, boo
     searchRange.selectNodeContents(xmlDocImpl());
     if (selectionStart()) {
         if (forward) {
-            setStart(searchRange, VisiblePosition(selection().end(), selection().endAffinity()));
+            setStart(searchRange, VisiblePosition(findInSelection ? selection().start() : selection().end(), selection().endAffinity()));
         } else {
-            setEnd(searchRange, VisiblePosition(selection().start(), selection().startAffinity()));
+            setEnd(searchRange, VisiblePosition(findInSelection ? selection().end() : selection().start(), selection().startAffinity()));
         }
     }
 
index f05f61806ece8a09911b980f220ca5379409ebcc..443f64c230202de23c15c1312e7b7d6f24b3fcc6 100644 (file)
@@ -33,7 +33,7 @@
 #import "render_replaced.h"
 #import "WebCoreBridge.h"
 
-// #define ALLOW_RESIZING_TEXTAREAS 1
+#define ALLOW_RESIZING_TEXTAREAS 1
 
 using DOM::EventImpl;
 using DOM::NodeImpl;
@@ -77,6 +77,9 @@ using khtml::RenderWidget;
 @interface KWQTextAreaTextView : NSTextView <KWQWidgetHolder>
 {
     QTextEdit *widget;
+#if ALLOW_RESIZING_TEXTAREAS
+    NSTrackingRectTag resizeCornerTrackingRectTag;
+#endif
     BOOL disabled;
     BOOL editableIfEnabled;
     BOOL inCut;
@@ -177,10 +180,13 @@ const float LargeNumberForText = 1.0e7;
     [super dealloc];
 }
 
-- (void)textDidChange:(NSNotification *)aNotification
+- (void)textDidChange:(NSNotification *)notification
 {
     if (widget)
         widget->textChanged();
+    
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    [bridge textDidChange:notification];
 }
 
 - (void)setWordWrap:(BOOL)f
@@ -775,7 +781,65 @@ const float ResizeCornerHeight = 16;
             NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseUpMask];
     }    
 }
+
+- (NSImage *)_resizeCornerImage
+{
+    NSImage *cornerImage = nil;
+    if (cornerImage == nil) {
+       cornerImage = [[NSImage alloc] initWithContentsOfFile:
+            [[NSBundle bundleForClass:[KWQTextAreaTextView class]]
+            pathForResource:@"textAreaResizeCorner" ofType:@"tiff"]];
+    }
+    ASSERT(cornerImage != nil);
+    return cornerImage;
+}
+
+- (NSRect)_resizeCornerRect
+{
+    NSClipView *clipView = [self superview];
+    NSRect visibleRect = [clipView documentVisibleRect];
+    NSImage *cornerImage = [self _resizeCornerImage];
+    NSSize imageSize = [cornerImage size];
+    // Add one pixel of whitespace at right and bottom of image to match normal resize corner appearance.
+    // This could be built into the image, alternatively.
+    return NSMakeRect(NSMaxX(visibleRect) - imageSize.width - 1, NSMaxY(visibleRect) - imageSize.height - 1, imageSize.width + 1, imageSize.height + 1);
+}
+
+- (void)resetCursorRects {
+    [super resetCursorRects];
+    
+    // FIXME: This is intended to change the cursor to the arrow cursor whenever it is
+    // over the resize corner. However, it currently only works when the cursor had
+    // been inside the textarea, presumably due to interactions with the way NSTextView
+    // sets the cursor via [NSClipView setDocumentCursor:]. Also, it stops working once
+    // the textview has been resized, for reasons not yet understood.
+    NSRect visibleRect = [self visibleRect];
+    if (resizeCornerTrackingRectTag != -1) {
+        [self removeTrackingRect:resizeCornerTrackingRectTag];
+        resizeCornerTrackingRectTag = -1;
+    }
+    if ([self isEnabled] && !NSIsEmptyRect(visibleRect)) {
+        NSRect resizeCornerRect = [self _resizeCornerRect];
+        [self addCursorRect:resizeCornerRect cursor:[NSCursor arrowCursor]];
+        resizeCornerTrackingRectTag = [self addTrackingRect:resizeCornerRect owner:self userData:NULL assumeInside:NO];
+    }
+}
+
+#endif
+
+- (void)drawRect:(NSRect)rect
+{
+    [super drawRect:rect];
+    
+#if ALLOW_RESIZING_TEXTAREAS
+    if ([self isEnabled]) {
+        NSImage *cornerImage = [self _resizeCornerImage];
+        NSPoint imagePoint = [self _resizeCornerRect].origin;
+        imagePoint.y += [cornerImage size].height;
+        [cornerImage compositeToPoint:imagePoint operation:NSCompositeSourceOver];
+    }
 #endif
+}
 
 - (void)mouseDown:(NSEvent *)event
 {
@@ -784,8 +848,6 @@ const float ResizeCornerHeight = 16;
     
 #if ALLOW_RESIZING_TEXTAREAS
     NSPoint localPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-    // FIXME: visibleRect works here as long as there are no views overlapping the NSTextView.
-    // Might be safer to compute the rect of the document that's visible in the scrollview
     // FIXME: At minimum, need a cursor change over the "hot resize corner". Maybe the right design
     // is to only have a resize corner when a scroll bar is present, and put it in the bottom-right
     // corner (below and/or to the right of  the scroll bar?).
@@ -793,9 +855,10 @@ const float ResizeCornerHeight = 16;
     // and a drag-to-resize. This code currently always does the drag-to-resize behavior.
     // FIXME: This behaves very oddly for textareas that are in blocks with right-aligned text; you have
     // to drag the bottom-right corner to make the bottom-left corner move.
-    NSRect visibleRect = [self visibleRect];
-    BOOL inResizeCorner = NSPointInRect(localPoint, NSMakeRect(NSMaxX(visibleRect) - ResizeCornerWidth, NSMaxY(visibleRect) - ResizeCornerHeight, ResizeCornerWidth, ResizeCornerHeight));
+    BOOL inResizeCorner = NSPointInRect(localPoint, [self _resizeCornerRect]);
     if (inResizeCorner) {
+        // FIXME: if the cursor tracking worked perfectly, this next line wouldn't be necessary
+        [[NSCursor arrowCursor] set];
         [self _trackResizeFromMouseDown:event];
         return;
     }
index 2a1fc12be247721e0fa386ff21c4ae4f3dd0fb76..31056e5080703f8286959b611952214b2c355d8c 100644 (file)
@@ -289,7 +289,7 @@ typedef enum
 - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element;
 - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element;
 
-- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
+- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag;
 - (void)jumpToSelection;
 
 - (NSString *)advanceToNextMisspelling;
@@ -577,6 +577,7 @@ typedef enum
 - (void)controlTextDidBeginEditing:(NSNotification *)obj;
 - (void)controlTextDidEndEditing:(NSNotification *)obj;
 - (void)controlTextDidChange:(NSNotification *)obj;
+- (void)textDidChange:(NSNotification *)obj;
 
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
index 04b2245e9d85d381333c8444d020c31b4d3008a8..d44da82bcc0b830d8d6a71b5063da7b67b059d60 100644 (file)
@@ -1135,9 +1135,9 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     return KURL(doc->baseURL(), rel, doc->decoder() ? doc->decoder()->codec() : 0).getNSURL();
 }
 
-- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
+- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag
 {
-    return _part->findString(string, forward, caseFlag, wrapFlag);
+    return _part->findString(string, forward, caseFlag, wrapFlag, inSelectionFlag);
 }
 
 - (void)jumpToSelection
index 433a99ade60afa0aaead89de8294ea6f6e934047..e3341336f3c1a93052a0357eb65f02300686fb58 100644 (file)
@@ -1,3 +1,94 @@
+2005-05-12  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Kevin.
+
+        - rolled in changes from experimental-ui-branch to support resizable textareas
+        and find-as-you-type and confirming unsubmitted form changes. The files/functions 
+        modified are listed just below. After that are the ChangeLog comments from the branch.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge textDidChange:]):
+        * WebView.subproj/WebFormDelegate.h:
+        * WebView.subproj/WebFormDelegate.m:
+        (-[WebFormDelegate textDidChange:inFrame:]):
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView maintainsInactiveSelection]):
+        (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]):
+        (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
+        * WebView.subproj/WebView.m:
+        (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
+        (-[WebView searchFor:direction:caseSensitive:wrap:]):
+        (-[WebView makeTextStandardSize:]):
+        (-[WebView maintainsInactiveSelection]):
+        * WebView.subproj/WebViewPrivate.h:
+        
+        2005-04-18  John Sullivan  <sullivan@apple.com>
+
+                WebKit support for notifying a form delegate when a
+                textarea's contents have changed (as opposed to a 
+                textfield, which was already handled).
+
+                Reviewed by Maciej.
+
+                * WebView.subproj/WebFormDelegate.h:
+                * WebView.subproj/WebFormDelegate.m:
+                (-[WebFormDelegate textDidChange:inFrame:]):
+                new form delegate method
+
+                * WebCoreSupport.subproj/WebBridge.m:
+                (-[WebBridge textDidChange:]):
+                new method, calls through to form delegate
+                
+        2005-04-11  John Sullivan  <sullivan@apple.com>
+
+                Fixed inability to wrap around in Find in Page 
+
+                * WebView.subproj/WebView.m:
+                (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
+                changed wrapFlag from NO to YES on two lines (copy/paste error)
+
+        2005-04-07  John Sullivan  <sullivan@apple.com>
+
+                WebKit support for find-as-you-type. Needed an additional parameter on
+                a method from WebDocumentSearching protocol. Since that's a public protocol, 
+                I couldn't just add the parameter. For now I hacked it with an undeclared
+                internal method that's discovered via respondsToSelector. Probably the right
+                long-term approach is to deprecate the WebDocumentSearching protocol and introduce
+                a replacement that has a more flexible set of parameters for possible future
+                expansion.
+
+                Reviewed by Dave Hyatt.
+
+                * WebView.subproj/WebHTMLView.m:
+                (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]):
+                now calls new one-more-parameter version passing NO for new parameter to match old behavior
+                (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
+                new method, adds findInSelection parameter and passes it through to bridge
+                 
+                * WebView.subproj/WebView.m:
+                (-[WebView searchFor:direction:caseSensitive:wrap:]):
+                now calls new one-more-parameter version passing NO for new parameter to match old behavior
+                (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]):
+                new method, adds findInSelection parameter and passes it through
+
+        2005-04-07  John Sullivan  <sullivan@apple.com>
+
+                WebKit support to allow clients to control whether the selection is still
+                drawn when the first responder is elsewhere. Formerly this was hardwired
+                to be true only when -[WebView isEditable] was true.
+
+                Reviewed by Darin.
+
+                * WebView.subproj/WebHTMLView.m:
+                (-[WebHTMLView maintainsInactiveSelection]):
+                check [WebView maintainsInactiveSelection] rather than just [WebView isEditable]
+                
+                * WebView.subproj/WebViewPrivate.h:
+                * WebView.subproj/WebView.m:
+                (-[WebView maintainsInactiveSelection]):
+                new method for clients to override, returns -[self isEditable]
+        
+
 2005-05-10  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Kevin.
index 65b1cedebb85132b5a5eac5de212c4f3a274ce27..17a6886cf27fa1f022c4c0ba9fdc40512b68e6e9 100644 (file)
@@ -1206,6 +1206,12 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     [formDelegate(self) controlTextDidChange:obj inFrame:_frame];
 }
 
+- (void)textDidChange:(NSNotification *)obj
+{
+    FormDelegateLog([obj object]);
+    [formDelegate(self) textDidChange:obj inFrame:_frame];
+}
+
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
 {
     FormDelegateLog(control);
index f1d5a5f496b231dd5108e051b18ce6bccb7f37f1..cc165063038a497d5e8823ef2ff1613f58057662 100644 (file)
@@ -29,6 +29,7 @@
 - (void)controlTextDidBeginEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
 - (void)controlTextDidEndEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
 - (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame;
+- (void)textDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame;
 
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
index be2d3a21e40cac72decfb8b99fa5b5c6386ef634..c399076feafb17c3ccba10c0e8e3525e513ba8ab 100644 (file)
@@ -27,6 +27,7 @@ static WebFormDelegate *sharedDelegate = nil;
 
 - (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame { }
 
+- (void)textDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame { }
 
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame
 {
index 72c2597e890a2fd3ac66160f9a8a8d05d13d5bcf..93392465be3e6fcf5b05919fa68fc745c2a899cf 100644 (file)
@@ -2035,8 +2035,7 @@ static WebHTMLView *lastHitView = nil;
     if (nextResponder == self)
         return YES;
 
-    // non-editable views lose selection whenever losing first responder status
-    if (![[self _webView] isEditable])
+    if (![[self _webView] maintainsInactiveSelection])
         return NO;
     
     // editable views lose selection when losing first responder status
@@ -2327,9 +2326,18 @@ static WebHTMLView *lastHitView = nil;
 
 // Search from the end of the currently selected location, or from the beginning of the
 // document if nothing is selected.
-- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
+- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
 {
-    return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag];
+    return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:NO];
+}
+
+// Private method that adds a findInSelection parameter; might be public someday
+// FIXME: this is currently discovered using respondsToSelector; no SPI or API yet
+// FIXME: this needs to be done for other WebDocumentSearching implementors also, such as
+// WebPDFView and WebSearchableTextView
+- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag
+{
+    return [[self _bridge] searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:inSelectionFlag];
 }
 
 - (DOMRange *)_documentRange
index 89030d696504d22bbe1995a9399980accdaa2f48..802e60ca97303f7cecf461f6a964add472f0e2f0 100644 (file)
@@ -179,6 +179,11 @@ macro(yankAndSelect) \
 @end
 #endif
 
+@interface NSObject (WebDocumentSearchingHack)
+// FIXME: this should be part of a protocol (new version of <WebDocumentSearching>)
+- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)inSelectionFlag;
+@end
+
 @interface WebView (WebFileInternal)
 - (void)_preflightSpellChecker;
 - (BOOL)_continuousCheckingAllowed;
@@ -2147,7 +2152,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 // Search from the end of the currently selected location, or from the beginning of the
 // document if nothing is selected.  Deals with subframes.
-- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
+- (BOOL)_searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag findInSelection:(BOOL)findInSelection
 {
     // Get the frame holding the selection, or start with the main frame
     WebFrame *startFrame = [self _frameForCurrentSelection];
@@ -2175,7 +2180,12 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
             
             // Note at this point we are assuming the search will be done top-to-bottom,
             // not starting at any selection that exists.  See 3228554.
-            BOOL success = [searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:NO];
+            BOOL success;
+            if ([searchView respondsToSelector:@selector(_searchFor:direction:caseSensitive:wrap:findInSelection:)]) {
+                success = [searchView _searchFor:string direction:forward caseSensitive:caseFlag wrap:NO findInSelection:findInSelection];
+            } else {
+                success = [searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:NO];
+            }
             if (success) {
                 [[self window] makeFirstResponder:searchView];
                 return YES;
@@ -2187,7 +2197,12 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     // Search contents of startFrame, on the other side of the selection that we did earlier.
     // We cheat a bit and just research with wrap on
     if (wrapFlag && startHasSelection && startSearchView) {
-        BOOL success = [startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES];
+        BOOL success;
+        if ([startSearchView respondsToSelector:@selector(_searchFor:direction:caseSensitive:wrap:findInSelection:)]) {
+            success = [startSearchView _searchFor:string direction:forward caseSensitive:caseFlag wrap:YES findInSelection:findInSelection];
+        } else {
+            success = [startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES];
+        }
         if (success) {
             [[self window] makeFirstResponder:startSearchView];
             return YES;
@@ -2196,6 +2211,12 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     return NO;
 }
 
+- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
+{
+    return [self _searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag findInSelection:NO];
+}
+
+
 + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType
 {
     [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType];
@@ -2529,6 +2550,11 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     [self setTextSizeMultiplier:1];
 }
 
+- (BOOL)maintainsInactiveSelection
+{
+    return [self isEditable];
+}
+
 @end
 
 @implementation WebView (WebViewPrintingPrivate)
index 530a9ee97ac22b9deadeec8bd7ff669fed7973e1..09e77387f8392496622f80ad934a4303568b7ff9 100644 (file)
@@ -61,6 +61,11 @@ typedef enum {
 - (BOOL)canMakeTextStandardSize;
 - (IBAction)makeTextStandardSize:(id)sender;
 
+// If true, the selection will be maintained even when the first responder is outside
+// of the webview. Returns true only if self is editable at this level. Subclasses can
+// override to enforce additional criteria.
+- (BOOL)maintainsInactiveSelection;
+
 @end
 
 @interface WebView (WebPrivate)