[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:26:42 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 25a34b42b2c6f9602b6a1a64a610a8d8c65c9b22
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Mar 1 03:15:18 2003 +0000

    WebBrowser:
    
    	Large wad of autocomplete-autofill implementation.
    
    	AutoFill makes its first appearance.  Only triggered by debug menu item now,
    	with cmd-A equivalent.
    
    	A new class AutoFillController, maintains per-form state while the user is
    	working with the form, and holds a bunch of autofill behavior (and probably
    	more later when I do some code movement after these changes).  State we save
    	includes what fields have been autofilled, and which fields have matches that
    	came from AB.
    
    	Uses of AB data are saved in the FormsCompletion DB for proper LRU wrt ad-hoc
    	data entries.  To do this we save an "ABMarker" array of info instead of the
    	raw string used for an ad-hoc entry.
    
    	A ProxyABProperty is specified in the ABMappings file in the case where multiple
    	"real" props are specified so that are contatenated.  I needed a single prop
    	name as a reliable key.  (example of this:  "Name" fields get FirstName+LastName)
    
    	FormCompletionController uses a new class AddressBookMatch for elements in the
    	_matches array that come from AB.  The class is basically an open struct around
    	a handful of fields.
    
            Reviewed by Chris.
    
            * BrowserWebController.m:
            (-[BrowserWebController _closeDataSources:]):  Make call to free up
    	autocomplete state when the controller is going away.
            (-[BrowserWebController close]):  Call _closeDataSources.
            * BrowserWindowController.h:
            * BrowserWindowController.m:
            (-[BrowserWindowController updateKeyboardLoop]):  Coding nit - removed
    	internal return in favor of an else clause.
            (-[BrowserWindowController validateUserInterfaceItem:]):
    	Validate autofill: selector.
            (-[BrowserWindowController autoFill:]):  Just call FormCompletionController.
            (-[FormDelegate willSubmitForm:withValues:]):  Pass along new form param.
            * CompletionController.h:  We keep our own _selectedMatchIndex instead of always
    	looking to the tableView's selected row, since the TableView might not exist.
            * CompletionController.m:
            (-[CompletionController initWithSourceField:]):  Init _selectedMatchIndex.
            (-[CompletionController dealloc]):  Make sure stuff is freed, since abortCompletion
    	is no longer freeing these things.
            (-[CompletionController _selectMatchAtIndex:]):  Newly factored code.
            (-[CompletionController _showMatchesWindow:]):  Call factored code.
            (-[CompletionController abortCompletion]):  No longer has distinct behavior
    	from _hideMatchesWindow.  I was getting screwed by this method freeing state
    	that I would now later need (like the underlying matching object instead of
    	just the string in the TextField), so we just free the stuff in dealloc.
            (-[CompletionController selectedMatch]):  Factor some code here.  Use our
    	_selectedMatchIndex instead of the TableView's selected row.
            (-[CompletionController reflectSelectedRow]):  Call factored code.
    	Exposed for subclassing (removed leading _).
            (-[CompletionController reflectFinalSelectedRow]):  Call factored code.
    	Exposed for subclassing (removed leading _).
            (-[CompletionController completeString:]): Set _selectedMatchIndex after a query.
            (-[CompletionController leavingFieldReflectsFinalString]):
    	New hook for diff behavior in forms case.
            (-[CompletionController controlTextDidEndEditing:]):  Conditionally put the
    	final string into the field when we leave the field.  Off for URLs, on for forms.
            (-[CompletionController control:textView:doCommandBySelector:]):
    	Get rid of wrap-around when arrow selecting in dropdown. Call factored code.
    	On CR, only reflect the final string whenever are going to send the action.
            (-[CompletionController goToItemAtRow:]):  Don't perform the TextField's action
    	on double click if we don't perform it when you hit return when the dropdown
    	is showing.
            (-[CompletionController tableViewSelectionDidChange:]):  Name change of reflectSelectedRow.
            * Debug/DebugUtilities.m:
            (-[DebugUtilities createDebugMenu]):  Add menu item.
            * FormCompletionController.h:
            * FormCompletionController.m:
            (-[FormCompletionController _cryptData:encode:]):  Better error msg.
            (+[FormCompletionController frame:willSubmitForm:withValues:]):
    	Accept new form arg, and use it to look up info about how we edited the form.
    	For any values being submitted that came from AB, store a marker array in the
    	CompletionDB instead of the raw string.
    	Make sure timestamp is always updated, even if the LRU was in the right order.
            (+[FormCompletionController autoFillInController:]):  Handoff to AutofillController.
            (+[FormCompletionController clearAutoFillStateForFrame:]):  Handoff to AutofillController.
            (-[FormCompletionController initWithSourceField:frame:]):
    	Use formIsLoginForm: instead of elementIsInLoginForm.  Remember field's form.
            (-[FormCompletionController dealloc:):  Free field's form.
            (-[FormCompletionController controlTextDidChange:]):  Clear any record we might
    	have had that we autofilled this field, since it has now been edited since.
            (-[FormCompletionController _indexOfMarkerInMatches:]):  Utility method.
    	Find an ABMarker we previously saved that matches the current match from
    	AB we are about to submit.
            (+[FormCompletionController _abSingleValue:]):  Now a class method for
    	use during autofill.  Some tighter ASSERT checking.
            (+[FormCompletionController _abValuesForProperty:key:label:]):
    	Now a class method for use during autofill.
    	Build an AddressBookMatch object for each match instead of just returning
    	the literal string.
            (+[FormCompletionController _addABMatchesToArray:forString:fieldName:]):
    	Now a class method for use during autofill, field name is param for same reason.
    	For multi-prop ABMappings, make sure AddressBookMatch ends up with the proxy
    	property.
    	When combining ABMatches with previousData matches, replace any markers of
    	a previous ABMatch with the current one, so as to preserve LRU ordering.  Also
    	replace any previous literal string matches that happen to match current AB match.
            (+[FormCompletionController _addPreviousDataMatchesToArray:forString:frame:fieldName:]):
    	Now a class method for use during autofill, new params for same reason.
    	Allow ABMarkers (which are stored as arrays) to pass from the stored data
    	to our matches array that we build.
            (+[FormCompletionController _matchesForString:frame:fieldName:]):
    	New a class method for use during autofill.  Mostly code factored from
    	queryResultsForString.
    	At the very end of the query, filter out any remaining ABMarkers from the
    	results, since those make no sense to show to a user.
            (stringFromMatch):  Utility to make a string from one of out matches, which can
    	now be a literal string or an AddressBookMatch.
            (matchComparator):  New sort comparator that handles strings and AddressBookMatches.
            (-[FormCompletionController queryResultsForString:startingMatch:]):
    	Much code factored out.  Sort using new comparator.
            (-[FormCompletionController reflectFinalSelectedRow]):
    	Override to possibly record that we filled a field with AB data.
            (-[FormCompletionController intermediateMatchingStringForResult]):
    	Use stringFromMatch to interpret AddressBookMatches.
            (-[FormCompletionController finalMatchingStringForResult]):
    	Use stringFromMatch to interpret AddressBookMatches.
            (-[FormCompletionController leavingFieldReflectsFinalString]):
    	Return YES for different behavior than URL case.
            (+[AutoFillController _markAutoFilledColor]):  Return shares color.
            (+[AutoFillController autoFillInController]):  Do an autofill.
    	Figure out the form to work on, make an autofiller, cut it loose.
            (+[AutoFillController autoFillerForFrame:form:create:]):  Lookup autofiller.
            (+[AutoFillController abMatchInFrame:form:fieldName:]):
    	Return any AB match we've stuck into for a particular field during the
    	current editing session with that form.
            (+[AutoFillController recordABMatch:inFrame:form:fieldName:]):
    	Record any AB match we've stuck into for a particular field during the
    	current editing session with that form.
            (+[AutoFillController clearAutoFillStateForFrame:]):
    	Release any autofillers used for the given frame.
            (+[AutoFillController clearAutoFilledView:inFrame:form:]):  Clear state for
    	a field when it is manually edited.
            (-[AutoFillController dealloc]):  Free our state.
            (-[AutoFillController _autoFillWidget:rep:]):  Do autofill of one widget.
            (-[AutoFillController autoFill]):  Do autofill of our form.
            (-[AutoFillController recordABMatch:fieldName:]):  Record a field that
    	we've set with an ABMatch.
            (-[AutoFillController clearView:]):  Remove a view from the list we've autofilled.
            (-[AddressBookMatch initWithValue:property:key:label:]):  Trivial class' init.
            (-[AddressBookMatch dealloc:]):  Trivial class' dealloc.
            * LocationChangeHandler.m:
            (-[LocationChangeHandler willCloseLocationForDataSource:]):
    	Implement new callout to free the completion state for that frame.
    
    
    
    WebKit:
    
    	Various support for autofill/autocomplete.
    
    	We receive a form along with the formValues from WC on submit, which we
    	just pass along to the FormDelegate.  As part of this we store the values
    	and the form together in a new private WebFormState class.  Lots of glue
    	for passing this around instead of just the values dict.
    
    	Send willCloseLocationForDataSource when we are finally through with a page.
    
            Reviewed by Darin.
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:reload:triggeringEvent:form:formValues:]):
    	Pass along form along with values
            (-[WebBridge postWithURL:data:contentType:triggeringEvent:form:formValues:]):
    	Pass along form along with values
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _commitIfReady:]):  Call frame to send willCloseLocationForDataSource.
            * WebView.subproj/WebFormDelegate.h:
            * WebView.subproj/WebFormDelegate.m:
            (-[WebFormDelegate frame:willSubmitForm:withValues:]):  Pass form along with values
            * WebView.subproj/WebFrame.m:
            (-[WebFrame loadRequest:]):  Pass FormState instead of just values.
            (-[WebFrame reload]):  Pass FormState instead of just values.
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            <<prepare-ChangeLog flailed on this file>>
    	Lots of routines were we pass FormState instead of the form values dict
    	-([WebFrame _closeOldDataSources]):  New, sends willCloseLocation for whole frame tree.
    	New, trivial, WebFormState class.
            * WebView.subproj/WebHTMLRepresentation.h:
            * WebView.subproj/WebHTMLRepresentation.m:
            (-[WebHTMLRepresentation formIsLoginForm:]):  Changed to take form instead of form field.
            (-[WebHTMLRepresentation formForElement:]):  New, just pass through bridge.
            (-[WebHTMLRepresentation controlsInForm:]):    New, just pass through bridge.
            * WebView.subproj/WebLocationChangeDelegate.h:  Add willCloseLocationForDataSource.
            * WebView.subproj/WebLocationChangeDelegate.m:
            (-[WebLocationChangeDelegate willCloseLocationForDataSource:]):  Default impl.
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]):
    	Pass FormState instead of just values.
            (-[WebMainResourceClient resource:willSendRequest:]):
    	Pass FormState instead of just values.
    
    
    WebCore:
    
    	More support for autofill, autocomplete.
    
    	Pass the form element along with the values to WK when submitting.
    
    	isLoginForm looks for a single plain text field along with password fields, so as not to match registration forms.
    
    	Added means to find the "current" form on a page.
    
    	Added means to return the whole set of controls on a form.
    
            Reviewed by Darin.
    
            * khtml/html/html_elementimpl.h:
    	Added isGenericFormElement().
            * khtml/html/html_formimpl.cpp:
            (HTMLFormElementImpl::isLoginForm):  See above.
            (HTMLFormElementImpl::submit):  Also register form when registering values,
    	so it will be sent over bridge.
            * kwq/KWQKHTMLPart.h:  New ivar to save form along with form values to be submitted.
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::KWQKHTMLPart):  Init _formAboutToBeSubmitted ivar.
            (KWQKHTMLPart::~KWQKHTMLPart):  Free _formAboutToBeSubmitted ivar.
            (KWQKHTMLPart::openURL):  Pass form to bridge along with values.
            (KWQKHTMLPart::openURLRequest):   Pass form to bridge along with values.
            (scanForForm):  Helper function to scan forward in the DOM for a form.
            (KWQKHTMLPart::currentForm):  Returns current form.
            (KWQKHTMLPart::clearRecordedFormValues): Clear _formAboutToBeSubmitted.
            (KWQKHTMLPart::recordFormValue): Record _formAboutToBeSubmitted too.
            (KWQKHTMLPart::submitForm): Pass form to bridge along with values.
            (KWQKHTMLPart::urlSelected):  Pass form to bridge along with values.
            * kwq/KWQKHTMLPartBrowserExtension.mm:
            (KHTMLPartBrowserExtension::createNewWindow): Pass form to bridge along with values.
            * kwq/KWQTextField.mm:
            (-[KWQTextField setStringValue:]):
    	Call textChanged so the changes actually make it to khtml.
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (viewForElement):  New helper.
            (formElementFromDOMElement):    New helper.
            (-[WebCoreBridge formIsLoginForm:]):
    	Changed API to operate on a form instead of a field.
            (-[WebCoreBridge currentForm]):  New method, described above.
            (-[WebCoreBridge controlsInForm:]):  New method, described above.
            * kwq/WebCoreDOMNode.mm:
            (-[WebCoreDOMNode isEqual:]):
    	Implement this to == compare the element we contain.
            (-[WebCoreDOMNode hash]):  Implement to hash element ptr we contain.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3721 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ceb8f8a..c58a8ad 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,53 @@
+2003-02-28  Trey Matteson  <trey at apple.com>
+
+	More support for autofill, autocomplete.
+
+	Pass the form element along with the values to WK when submitting.
+
+	isLoginForm looks for a single plain text field along with password fields, so as not to match registration forms.
+
+	Added means to find the "current" form on a page.
+
+	Added means to return the whole set of controls on a form.
+
+        Reviewed by Darin.
+
+        * khtml/html/html_elementimpl.h:
+	Added isGenericFormElement().
+        * khtml/html/html_formimpl.cpp:
+        (HTMLFormElementImpl::isLoginForm):  See above.
+        (HTMLFormElementImpl::submit):  Also register form when registering values,
+	so it will be sent over bridge.
+        * kwq/KWQKHTMLPart.h:  New ivar to save form along with form values to be submitted.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::KWQKHTMLPart):  Init _formAboutToBeSubmitted ivar.
+        (KWQKHTMLPart::~KWQKHTMLPart):  Free _formAboutToBeSubmitted ivar.
+        (KWQKHTMLPart::openURL):  Pass form to bridge along with values.
+        (KWQKHTMLPart::openURLRequest):   Pass form to bridge along with values.
+        (scanForForm):  Helper function to scan forward in the DOM for a form.
+        (KWQKHTMLPart::currentForm):  Returns current form.
+        (KWQKHTMLPart::clearRecordedFormValues): Clear _formAboutToBeSubmitted.
+        (KWQKHTMLPart::recordFormValue): Record _formAboutToBeSubmitted too.
+        (KWQKHTMLPart::submitForm): Pass form to bridge along with values.
+        (KWQKHTMLPart::urlSelected):  Pass form to bridge along with values.
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): Pass form to bridge along with values.
+        * kwq/KWQTextField.mm:
+        (-[KWQTextField setStringValue:]):
+	Call textChanged so the changes actually make it to khtml.
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (viewForElement):  New helper.
+        (formElementFromDOMElement):    New helper.
+        (-[WebCoreBridge formIsLoginForm:]):
+	Changed API to operate on a form instead of a field.
+        (-[WebCoreBridge currentForm]):  New method, described above.
+        (-[WebCoreBridge controlsInForm:]):  New method, described above.
+        * kwq/WebCoreDOMNode.mm:
+        (-[WebCoreDOMNode isEqual:]):
+	Implement this to == compare the element we contain.
+        (-[WebCoreDOMNode hash]):  Implement to hash element ptr we contain.
+
 2003-02-28  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Trey.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ceb8f8a..c58a8ad 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,53 @@
+2003-02-28  Trey Matteson  <trey at apple.com>
+
+	More support for autofill, autocomplete.
+
+	Pass the form element along with the values to WK when submitting.
+
+	isLoginForm looks for a single plain text field along with password fields, so as not to match registration forms.
+
+	Added means to find the "current" form on a page.
+
+	Added means to return the whole set of controls on a form.
+
+        Reviewed by Darin.
+
+        * khtml/html/html_elementimpl.h:
+	Added isGenericFormElement().
+        * khtml/html/html_formimpl.cpp:
+        (HTMLFormElementImpl::isLoginForm):  See above.
+        (HTMLFormElementImpl::submit):  Also register form when registering values,
+	so it will be sent over bridge.
+        * kwq/KWQKHTMLPart.h:  New ivar to save form along with form values to be submitted.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::KWQKHTMLPart):  Init _formAboutToBeSubmitted ivar.
+        (KWQKHTMLPart::~KWQKHTMLPart):  Free _formAboutToBeSubmitted ivar.
+        (KWQKHTMLPart::openURL):  Pass form to bridge along with values.
+        (KWQKHTMLPart::openURLRequest):   Pass form to bridge along with values.
+        (scanForForm):  Helper function to scan forward in the DOM for a form.
+        (KWQKHTMLPart::currentForm):  Returns current form.
+        (KWQKHTMLPart::clearRecordedFormValues): Clear _formAboutToBeSubmitted.
+        (KWQKHTMLPart::recordFormValue): Record _formAboutToBeSubmitted too.
+        (KWQKHTMLPart::submitForm): Pass form to bridge along with values.
+        (KWQKHTMLPart::urlSelected):  Pass form to bridge along with values.
+        * kwq/KWQKHTMLPartBrowserExtension.mm:
+        (KHTMLPartBrowserExtension::createNewWindow): Pass form to bridge along with values.
+        * kwq/KWQTextField.mm:
+        (-[KWQTextField setStringValue:]):
+	Call textChanged so the changes actually make it to khtml.
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (viewForElement):  New helper.
+        (formElementFromDOMElement):    New helper.
+        (-[WebCoreBridge formIsLoginForm:]):
+	Changed API to operate on a form instead of a field.
+        (-[WebCoreBridge currentForm]):  New method, described above.
+        (-[WebCoreBridge controlsInForm:]):  New method, described above.
+        * kwq/WebCoreDOMNode.mm:
+        (-[WebCoreDOMNode isEqual:]):
+	Implement this to == compare the element we contain.
+        (-[WebCoreDOMNode hash]):  Implement to hash element ptr we contain.
+
 2003-02-28  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Trey.
diff --git a/WebCore/khtml/html/html_elementimpl.h b/WebCore/khtml/html/html_elementimpl.h
index 482648f..0d90cc7 100644
--- a/WebCore/khtml/html/html_elementimpl.h
+++ b/WebCore/khtml/html/html_elementimpl.h
@@ -61,6 +61,10 @@ public:
 
     virtual DOMString namespaceURI() const;
 
+#if APPLE_CHANGES
+    virtual bool isGenericFormElement() const { return false; }
+#endif
+
 protected:
     // for IMG, OBJECT and APPLET
     void addHTMLAlignment( DOMString alignment );
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index cf5ea72..e84b3d8 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -93,18 +93,20 @@ NodeImpl::Id HTMLFormElementImpl::id() const
 #if APPLE_CHANGES
 bool HTMLFormElementImpl::isLoginForm()
 {
-    // For now, we just look for a password field.  Perhaps we will want to also
-    // check for a small number of input fields as well?
+    int numPasswordFields = 0;
+    int numTextFields = 0;
     QPtrListIterator<HTMLGenericFormElementImpl> it(formElements);
     for (; it.current(); ++it) {
         if (it.current()->id() == ID_INPUT) {
             HTMLInputElementImpl *inputElt = static_cast<HTMLInputElementImpl*>(it.current());
             if (inputElt->inputType() == HTMLInputElementImpl::PASSWORD) {
-                return true;
+                numPasswordFields++;
+            } else if (inputElt->inputType() == HTMLInputElementImpl::TEXT) {
+                numTextFields++;
             }
         }
     }
-    return false;
+    return (numPasswordFields > 0) && (numTextFields == 1);
 }
 
 bool HTMLFormElementImpl::formWouldHaveSecureSubmission(DOMString url)
@@ -524,7 +526,7 @@ void HTMLFormElementImpl::submit( bool activateSubmitButton )
         {
             HTMLInputElementImpl *input = static_cast<HTMLInputElementImpl *>(current);
 #if APPLE_CHANGES
-            KWQ(view->part())->recordFormValue(input->name().string(), input->value().string());
+            KWQ(view->part())->recordFormValue(input->name().string(), input->value().string(), this);
 #else
             view->addFormCompletionItem(input->name().string(), input->value().string());
 #endif
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 3cc0adf..5466f6d 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -29,6 +29,7 @@
 #include "khtml_part.h"
 
 #include "dom_nodeimpl.h"
+#include "html_formimpl.h"
 
 #include <CoreFoundation/CoreFoundation.h>
 
@@ -51,6 +52,7 @@ namespace KJS {
 @class WebCoreBridge;
 @class KWQPageState;
 @class NSMutableDictionary;
+ at class WebCoreDOMElement;
 #else
 class NSAttributedString;
 class NSEvent;
@@ -59,6 +61,7 @@ class NSView;
 class WebCoreBridge;
 class KWQPageState;
 class NSMutableDictionary;
+class WebCoreDOMElement;
 #endif
 
 enum KWQSelectionDirection {
@@ -176,8 +179,9 @@ public:
     static const QPtrList<KWQKHTMLPart> &instances() { return mutableInstances(); }
 
     void clearRecordedFormValues();
-    void recordFormValue(const QString &name, const QString &value);
-
+    void recordFormValue(const QString &name, const QString &value, DOM::HTMLFormElementImpl *element);
+    DOM::HTMLFormElementImpl *currentForm() const;
+    
     void setSettings (KHTMLSettings *s);
     
 private:
@@ -223,7 +227,8 @@ private:
 
     QString _submittedFormURL;
 
-    NSMutableDictionary *_formValues;
+    NSMutableDictionary *_formValuesAboutToBeSubmitted;
+    WebCoreDOMElement *_formAboutToBeSubmitted;
 
     static QPtrList<KWQKHTMLPart> &mutableInstances();
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 91fa12a..b64d5e1 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -36,11 +36,13 @@
 
 #import "WebCoreBridge.h"
 #import "WebCoreViewFactory.h"
+#import "WebCoreDOMPrivate.h"
 
 #import "KWQDummyView.h"
 #import "KWQKJobClasses.h"
 #import "KWQLogging.h"
 #import "KWQPageState.h"
+#import "KWQDOMNode.h"
 
 #import "xml/dom2_eventsimpl.h"
 
@@ -126,7 +128,8 @@ KWQKHTMLPart::KWQKHTMLPart()
     , _sendingEventToSubview(false)
     , _mouseDownMayStartDrag(false)
     , _mouseDownMayStartSelect(false)
-    , _formValues(nil)
+    , _formValuesAboutToBeSubmitted(nil)
+    , _formAboutToBeSubmitted(nil)
 {
     // Must init the cache before connecting to any signals
     Cache::init();
@@ -144,7 +147,8 @@ KWQKHTMLPart::~KWQKHTMLPart()
     if (_ownsView) {
         delete d->m_view;
     }
-    [_formValues release];
+    [_formValuesAboutToBeSubmitted release];
+    [_formAboutToBeSubmitted release];
 }
 
 void KWQKHTMLPart::setSettings (KHTMLSettings *settings)
@@ -179,13 +183,13 @@ bool KWQKHTMLPart::openURL(const KURL &url)
     // FIXME: The lack of args here to get the reload flag from
     // indicates a problem in how we use KHTMLPart::processObjectRequest,
     // where we are opening the URL before the args are set up.
-    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:NO triggeringEvent:nil formValues:nil];
+    [_bridge loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:NO triggeringEvent:nil form:nil formValues:nil];
     return true;
 }
 
 void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
 {
-    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:nil formValues:nil];
+    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:nil form:nil formValues:nil];
 }
 
 void KWQKHTMLPart::didNotOpenURL(const QString &URL)
@@ -195,18 +199,73 @@ void KWQKHTMLPart::didNotOpenURL(const QString &URL)
     }
 }
 
+// Scans logically forward from "start", including any child frames
+static HTMLFormElementImpl *scanForForm(NodeImpl *start)
+{
+    NodeImpl *n;
+    for (n = start; n; n = n->traverseNextNode()) {
+        NodeImpl::Id nodeID = idFromNode(n);
+        if (idFromNode(n) == ID_FORM) {
+            return static_cast<HTMLFormElementImpl *>(n);
+        } else if (n->isHTMLElement()
+                   && static_cast<HTMLElementImpl *>(n)->isGenericFormElement()) {
+            return static_cast<HTMLGenericFormElementImpl *>(n)->form();
+        } else if (nodeID == ID_FRAME || nodeID == ID_IFRAME) {
+            NodeImpl *childDoc = static_cast<HTMLFrameElementImpl *>(n)->contentDocument();
+            HTMLFormElementImpl *frameResult = scanForForm(childDoc);
+            if (frameResult) {
+                return frameResult;
+            }
+        }
+    }
+    return 0;
+}
+
+// We look for either the form containing the current focus, or for one immediately after it
+HTMLFormElementImpl *KWQKHTMLPart::currentForm() const
+{
+    // start looking either at the active (first responder) node, or where the selection is
+    NodeImpl *start = activeNode().handle();
+    if (!start) {
+        start = selectionStart();
+    }
+
+    // try walking up the node tree to find a form element
+    NodeImpl *n;
+    for (n = start; n; n = n->parentNode()) {
+        if (idFromNode(n) == ID_FORM) {
+            return static_cast<HTMLFormElementImpl *>(n);
+        } else if (n->isHTMLElement()
+                   && static_cast<HTMLElementImpl *>(n)->isGenericFormElement()) {
+            return static_cast<HTMLGenericFormElementImpl *>(n)->form();
+        }
+    }
+
+    // try walking forward in the node tree to find a form element
+    if (!start) {
+        start = xmlDocImpl();
+    }
+    return scanForForm(start);
+}
+
 void KWQKHTMLPart::clearRecordedFormValues()
 {
-    [_formValues release];
-    _formValues = nil;
+    [_formValuesAboutToBeSubmitted release];
+    _formValuesAboutToBeSubmitted = nil;
+    [_formAboutToBeSubmitted release];
+    _formAboutToBeSubmitted = nil;
 }
 
-void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value)
+void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, HTMLFormElementImpl *element)
 {
-    if (!_formValues) {
-        _formValues = [[NSMutableDictionary alloc] init];
+    if (!_formValuesAboutToBeSubmitted) {
+        _formValuesAboutToBeSubmitted = [[NSMutableDictionary alloc] init];
+        ASSERT(!_formAboutToBeSubmitted);
+        _formAboutToBeSubmitted = [[WebCoreDOMElement elementWithImpl:element] retain];
+    } else {
+        ASSERT([_formAboutToBeSubmitted elementImpl] == element);
     }
-    [_formValues setObject:value.getNSString() forKey:name.getNSString()];
+    [_formValuesAboutToBeSubmitted setObject:value.getNSString() forKey:name.getNSString()];
 }
 
 void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
@@ -241,7 +300,8 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
 	       referrer:[_bridge referrer] 
                  reload:args.reload
         triggeringEvent:_currentEvent
-            formValues:_formValues];
+                   form:_formAboutToBeSubmitted
+             formValues:_formValuesAboutToBeSubmitted];
     } else {
         QString contentType = args.contentType();
         ASSERT(contentType.startsWith("Content-Type: "));
@@ -250,7 +310,8 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
                        data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
                 contentType:contentType.mid(14).getNSString()
             triggeringEvent:_currentEvent
-                 formValues:_formValues];
+                       form:_formAboutToBeSubmitted
+                 formValues:_formValuesAboutToBeSubmitted];
     }
     clearRecordedFormValues();
 }
@@ -275,7 +336,7 @@ void KWQKHTMLPart::slotData(NSString *encoding, bool forceEncoding, const char *
 
 void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URLArgs &args)
 {
-    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:_currentEvent formValues:nil];
+    [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() referrer:[_bridge referrer] reload:args.reload triggeringEvent:_currentEvent form:nil formValues:nil];
 }
 
 class KWQPluginPart : public ReadOnlyPart
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 039afa5..93d5a99 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -86,7 +86,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
 	bridge = [_part->bridge() findFramedNamed:frameName];
 	if (bridge != nil) {
 	    if (!url.isEmpty()) {
-		[bridge loadURL:url.url().getNSString() referrer:[_part->bridge() referrer] reload:urlArgs.reload triggeringEvent:nil formValues:nil];
+		[bridge loadURL:url.url().getNSString() referrer:[_part->bridge() referrer] reload:urlArgs.reload triggeringEvent:nil form:nil formValues:nil];
 	    }
 	    *partResult = [bridge part];
 	    return;
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index ce18042..761cd36 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -256,6 +256,7 @@
 {
     [secureField setStringValue:string];
     [super setStringValue:string];
+    widget->textChanged();
 }
 
 - (void)setFont:(NSFont *)font
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 748564e..d56366c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -158,8 +158,11 @@ enum FrameBorderStyle {
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point;
 - (id <WebDOMElement>)elementForView:(NSView *)view;
-- (BOOL)elementIsInLoginForm:(id <WebDOMElement>)element;
+- (BOOL)formIsLoginForm:(id <WebDOMElement>)element;
 - (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element;
+- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
+- (id <WebDOMElement>)currentForm;
+- (NSArray *)controlsInForm:(id <WebDOMElement>)form;
 
 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag;
 - (void)jumpToSelection;
@@ -210,8 +213,8 @@ enum FrameBorderStyle {
 /* Creates a name for an frame unnamed in the HTML.  It should produce repeatable results for loads of the same frameset. */
 - (NSString *)generateFrameName;
 
-- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
-- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
+- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
+- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
 
 - (WebCoreBridge *)createWindowWithURL:(NSString *)URL frameName:(NSString *)name;
 - (void)showWindow;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index b5a0412..ea3520b 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -459,6 +459,18 @@ static bool initializedObjectCacheSize = FALSE;
     }
 }
 
+static NSView *viewForElement(DOM::ElementImpl *elementImpl)
+{
+    RenderObject *renderer = elementImpl->renderer();
+    if (renderer && renderer->isWidget()) {
+        QWidget *widget = static_cast<const RenderWidget *>(renderer)->widget();
+        if (widget) {
+            return widget->getView();
+        }
+    }
+    return nil;
+}
+
 static HTMLInputElementImpl *inputElementFromDOMElement(id <WebDOMElement>element)
 {
     ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
@@ -468,11 +480,21 @@ static HTMLInputElementImpl *inputElementFromDOMElement(id <WebDOMElement>elemen
     }
     return nil;
 }
-    
-- (BOOL)elementIsInLoginForm:(id <WebDOMElement>)element
+
+static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
 {
-    HTMLInputElementImpl *inputElement = inputElementFromDOMElement(element);
-    return inputElement->form()->isLoginForm();
+    ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
+    DOM::ElementImpl *domElement = [(WebCoreDOMElement *)element elementImpl];
+    if (idFromNode(domElement) == ID_FORM) {
+        return static_cast<HTMLFormElementImpl *>(domElement);
+    }
+    return nil;
+}
+
+- (BOOL)formIsLoginForm:(id <WebDOMElement>)element
+{
+    HTMLFormElementImpl *formElement = formElementFromDOMElement(element);
+    return formElement->isLoginForm();
 }
 
 - (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element
@@ -483,6 +505,41 @@ static HTMLInputElementImpl *inputElementFromDOMElement(id <WebDOMElement>elemen
         && inputElement->autoComplete();
 }
 
+- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
+{
+    HTMLInputElementImpl *inputElement = inputElementFromDOMElement(element);
+    return inputElement ? [WebCoreDOMElement elementWithImpl:inputElement->form()] : nil;
+}
+
+- (id <WebDOMElement>)currentForm
+{
+    HTMLFormElementImpl *formElement = _part->currentForm();
+    return formElement ? [WebCoreDOMElement elementWithImpl:formElement] : nil;
+}
+
+- (NSArray *)controlsInForm:(id <WebDOMElement>)form
+{
+    NSMutableArray *results = nil;
+    HTMLFormElementImpl *formElement = formElementFromDOMElement(form);
+    if (formElement) {
+        QPtrList<HTMLGenericFormElementImpl> elements = formElement->formElements;
+        unsigned int i;
+        for (i = 0; i < elements.count(); i++) {
+            if (elements.at(i)->isEnumeratable()) {		// Skip option elements, other duds
+                NSView *view = viewForElement(elements.at(i));
+                if (view) {
+                    if (!results) {
+                        results = [NSMutableArray arrayWithObject:view];
+                    } else {
+                        [results addObject:view];
+                    }
+                }
+            }
+        }
+    }
+    return results;
+}
+
 - (NSDictionary *)elementAtPoint:(NSPoint)point
 {
     RenderObject *renderer = _part->renderer();
diff --git a/WebCore/kwq/WebCoreDOMNode.mm b/WebCore/kwq/WebCoreDOMNode.mm
index 346808b..00537c7 100644
--- a/WebCore/kwq/WebCoreDOMNode.mm
+++ b/WebCore/kwq/WebCoreDOMNode.mm
@@ -75,6 +75,18 @@ DOM::ProcessingInstruction DOM::ProcessingInstructionImpl::createInstance(Proces
     return self;
 }
 
+- (BOOL)isEqual:(id)other
+{
+    WebCoreDOMNode *otherNode = (WebCoreDOMNode *)other;
+    return self == otherNode
+        || ([otherNode isMemberOfClass:[self class]] && impl == otherNode->impl);
+}
+
+- (unsigned)hash {
+    // cribbed from NSObject, FWIW
+    return ((unsigned)impl) >> 2;
+}
+
 - (DOM::NodeImpl *)impl
 {
     return impl;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9213e76..d9903a5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,49 @@
+7003-02-28  Trey Matteson  <trey at apple.com>
+
+	Various support for autofill/autocomplete.
+
+	We receive a form along with the formValues from WC on submit, which we
+	just pass along to the FormDelegate.  As part of this we store the values
+	and the form together in a new private WebFormState class.  Lots of glue
+	for passing this around instead of just the values dict.
+
+	Send willCloseLocationForDataSource when we are finally through with a page.
+
+        Reviewed by Darin.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:reload:triggeringEvent:form:formValues:]):
+	Pass along form along with values
+        (-[WebBridge postWithURL:data:contentType:triggeringEvent:form:formValues:]):
+	Pass along form along with values
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _commitIfReady:]):  Call frame to send willCloseLocationForDataSource.
+        * WebView.subproj/WebFormDelegate.h:
+        * WebView.subproj/WebFormDelegate.m:
+        (-[WebFormDelegate frame:willSubmitForm:withValues:]):  Pass form along with values
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame loadRequest:]):  Pass FormState instead of just values.
+        (-[WebFrame reload]):  Pass FormState instead of just values.
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        <<prepare-ChangeLog flailed on this file>>
+	Lots of routines were we pass FormState instead of the form values dict
+	-([WebFrame _closeOldDataSources]):  New, sends willCloseLocation for whole frame tree.
+	New, trivial, WebFormState class.
+        * WebView.subproj/WebHTMLRepresentation.h:
+        * WebView.subproj/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation formIsLoginForm:]):  Changed to take form instead of form field.
+        (-[WebHTMLRepresentation formForElement:]):  New, just pass through bridge.
+        (-[WebHTMLRepresentation controlsInForm:]):    New, just pass through bridge.
+        * WebView.subproj/WebLocationChangeDelegate.h:  Add willCloseLocationForDataSource.
+        * WebView.subproj/WebLocationChangeDelegate.m:
+        (-[WebLocationChangeDelegate willCloseLocationForDataSource:]):  Default impl.
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]):
+	Pass FormState instead of just values.
+        (-[WebMainResourceClient resource:willSendRequest:]):
+	Pass FormState instead of just values.
+
 2003-02-28  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Trey.
@@ -26,6 +72,7 @@
 	_postWithURL:referrer:data:contentType:triggeringEvent:formValues:]):
 	Use passed-in referrer.
 
+>>>>>>> 1.1520
 2003-02-28  Darin Adler  <darin at apple.com>
 
         Reviewed by Trey.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index a3782b5..0037a5b 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -282,14 +282,14 @@
     [[self dataSource] _setIconURL:[NSURL _web_URLWithString:URL] withType:type];
 }
 
-- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
+- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
-    [frame _loadURL:[NSURL _web_URLWithString:URL] referrer:referrer loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard)  triggeringEvent:event formValues:values];
+    [frame _loadURL:[NSURL _web_URLWithString:URL] referrer:referrer loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard)  triggeringEvent:event form:form formValues:values];
 }
 
-- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
+- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
-    [frame _postWithURL:[NSURL _web_URLWithString:URL] referrer:(NSString *)referrer data:data contentType:contentType triggeringEvent:event formValues:values];
+    [frame _postWithURL:[NSURL _web_URLWithString:URL] referrer:(NSString *)referrer data:data contentType:contentType triggeringEvent:event form:form formValues:values];
 }
 
 - (NSString *)generateFrameName
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index abbad6a..cb8fb33 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -460,22 +460,25 @@
     return _private->committed;
 }
 
--(void)_commitIfReady: (NSDictionary *)pageCache
+- (void)_commitIfReady: (NSDictionary *)pageCache
 {
     if (_private->loadingFromPageCache || (![self isDownloading] && _private->gotFirstByte && !_private->committed)) {
-        WebFrameLoadType loadType = [[self webFrame] _loadType];
+        WebFrame *frame = [self webFrame];
+        WebFrameLoadType loadType = [frame _loadType];
         bool reload = loadType == WebFrameLoadTypeReload
             || loadType == WebFrameLoadTypeReloadAllowingStaleData;
         
         NSDictionary *headers = [_private->response isKindOfClass:[WebHTTPResponse class]]
             ? [(WebHTTPResponse *)_private->response header] : nil;
 
+        [frame _closeOldDataSources];
+
         LOG(Loading, "committed resource = %@", [[self request] URL]);
 	_private->committed = TRUE;
         if (!pageCache)
             [self _makeRepresentation];
             
-        [[self webFrame] _transitionToCommitted: pageCache];
+        [frame _transitionToCommitted: pageCache];
 
 	NSString *urlString = [[_private->response URL] absoluteString];
 
@@ -491,7 +494,7 @@
                    lastModified:(pageCache ? nil : [_private->response lastModifiedDate])
                       pageCache:pageCache];
 
-        [[self webFrame] _opened];
+        [frame _opened];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebFormDelegate.h b/WebKit/WebView.subproj/WebFormDelegate.h
index 0dbb921..5981d61 100644
--- a/WebKit/WebView.subproj/WebFormDelegate.h
+++ b/WebKit/WebView.subproj/WebFormDelegate.h
@@ -8,6 +8,7 @@
 #import <AppKit/AppKit.h>
 
 @class WebFrame;
+ at protocol WebDOMElement;
 
 /*!
     @protocol  WebFormDelegate
@@ -32,7 +33,7 @@
 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame;
 
 // Sent when a form is just about to be submitted (before the load is started)
-- (void)frame:(WebFrame *)frame willSubmitFormWithValues:(NSDictionary *)values;
+- (void)frame:(WebFrame *)frame willSubmitForm:(id <WebDOMElement>)form withValues:(NSDictionary *)values;
 @end
 
 /*!
diff --git a/WebKit/WebView.subproj/WebFormDelegate.m b/WebKit/WebView.subproj/WebFormDelegate.m
index bf08f1a..9508687 100644
--- a/WebKit/WebView.subproj/WebFormDelegate.m
+++ b/WebKit/WebView.subproj/WebFormDelegate.m
@@ -55,6 +55,6 @@ static WebFormDelegate *sharedDelegate = nil;
     return NO;
 }
 
-- (void)frame:(WebFrame *)frame willSubmitFormWithValues:(NSDictionary *)values  { }
+- (void)frame:(WebFrame *)frame willSubmitForm:(id <WebDOMElement>)form withValues:(NSDictionary *)values  { }
 
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index b86caa6..7630d3d 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -123,7 +123,7 @@
 
     [newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
 
-    [self _loadDataSource:newDataSource withLoadType:loadType formValues:nil];
+    [self _loadDataSource:newDataSource withLoadType:loadType formState:nil];
     [newDataSource release];
 }
 
@@ -160,7 +160,7 @@
 
     [newDataSource _setOverrideEncoding:[dataSource _overrideEncoding]];
     
-    [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload formValues:nil];
+    [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload formState:nil];
 
     [newDataSource release];
 }
diff --git a/WebKit/WebView.subproj/WebFrameLoadDelegate.h b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
index e195bb8..5d62d89 100644
--- a/WebKit/WebView.subproj/WebFrameLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
@@ -67,7 +67,7 @@
 - (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
 
 /*!
-    @method locationChangeDone:forDataSource
+    @method locationChangeDone:forDataSource:
     @abstract Notify that a location change is done (possibly with an error) for a data source
     @param error The error, if one occurred, or nil if none
     @param dataSource The data source that finished changing location
@@ -77,6 +77,15 @@
 - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
 
 /*!
+    @method willCloseLocationForDataSource:
+    @abstract Notify that a location will be closed.
+    @param dataSource The data source that where the location change originally happened
+    @discussion This callback happens right before WebKit is done with the data source
+    and the document representation that it contains.
+ */
+- (void)willCloseLocationForDataSource:(WebDataSource *)dataSource;
+
+/*!
     @method locationChangedWithinPageForDataSource:
     @abstract Notify that a further location change within the page
     has occurred for an already loaded data source
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 742c485..c6ce4be 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -14,6 +14,8 @@
 @class WebHistoryItem;
 @class WebView;
 @class WebRequest;
+ at class WebFormState;
+ at protocol WebDOMElement;
 
 typedef enum {
     WebFrameStateProvisional,
@@ -68,7 +70,7 @@ typedef enum {
     WebRequest *policyRequest;
     id policyTarget;
     SEL policySelector;
-    NSDictionary *policyFormValues;
+    WebFormState *policyFormState;
 
     BOOL justOpenedForTargetedLink;
     BOOL quickRedirectComing;
@@ -100,6 +102,7 @@ typedef enum {
 - (WebFrame *)_descendantFrameNamed:(NSString *)name;
 - (void)_controllerWillBeDeallocated;
 - (void)_detachFromParent;
+- (void)_closeOldDataSources;
 - (void)_setController: (WebController *)controller;
 - (void)_setDataSource: (WebDataSource *)d;
 - (void)_transitionToCommitted: (NSDictionary *)pageCache;
@@ -117,14 +120,14 @@ typedef enum {
 
 - (void)_addExtraFieldsToRequest:(WebRequest *)request alwaysFromRequest: (BOOL)f;
 
-- (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formValues:(NSDictionary *)values andCall:(id)target withSelector:(SEL)selector;
+- (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector;
 
 - (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
 
 - (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
 - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
 
 - (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory;
 - (void)_clientRedirectCancelled;
@@ -145,7 +148,7 @@ typedef enum {
 - (WebHistoryItem *)_itemForRestoringDocState;
 - (void)_handleUnimplementablePolicy:(WebPolicyAction)policy errorCode:(int)code forURL:(NSURL *)URL;
 
-- (void)_loadDataSource:(WebDataSource *)dataSource withLoadType:(WebFrameLoadType)type formValues:(NSDictionary *)values;
+- (void)_loadDataSource:(WebDataSource *)dataSource withLoadType:(WebFrameLoadType)type formState:(WebFormState *)formState;
 
 - (void)_downloadRequest:(WebRequest *)request toDirectory:(NSString *)directory;
 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index fdb179c..4d0a4bd 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -89,8 +89,21 @@ Repeat load of the same URL (by any other means of navigation other than the rel
  Add to back/forward list: NO
 */
 
+// One day we might want to expand the use of this kind of class such that we'd receive one
+// over the bridge, and possibly hand it on through to the FormsDelegate.
+// Today it is just used internally to keep some state as we make our way through a bunch
+// layers while doing a load.
+ at interface WebFormState : NSObject {
+    NSObject <WebDOMElement> *_form;
+    NSDictionary *_values;
+}
+- (id)initWithForm:(NSObject <WebDOMElement> *)form values:(NSDictionary *)values;
+- (id <WebDOMElement>)form;
+- (NSDictionary *)values;
+ at end
+
 @interface WebFrame (ForwardDecls)
-- (void)_loadRequest:(WebRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values;
+- (void)_loadRequest:(WebRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formState:(WebFormState *)formState;
 
 - (NSDictionary *)_actionInformationForLoadType:(WebFrameLoadType)loadType isFormSubmission:(BOOL)isFormSubmission event:(NSEvent *)event originalURL:(NSURL *)URL;
 
@@ -139,7 +152,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     ASSERT(listener == nil);
     ASSERT(policyRequest == nil);
     ASSERT(policyTarget == nil);
-    ASSERT(policyFormValues == nil);
+    ASSERT(policyFormState == nil);
 
     [super dealloc];
 }
@@ -331,6 +344,19 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     }
 }
 
+- (void)_closeOldDataSources
+{
+    if (_private->children) {
+        int i;
+        for (i = [_private->children count]-1; i >=0; i--) {
+            [[_private->children objectAtIndex:i] _closeOldDataSources];
+        }
+    }
+    if (_private->dataSource) {
+        [[[self controller] locationChangeDelegate] willCloseLocationForDataSource:_private->dataSource];
+    }
+}
+
 - (void)_detachFromParent
 {
     WebBridge *bridge = _private->bridge;
@@ -1020,7 +1046,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         WebDataSource *newDataSource;
         if ([item hasPageCache]){
             newDataSource = [[item pageCache] objectForKey: @"WebKitDataSource"];
-            [self _loadDataSource:newDataSource withLoadType:loadType formValues:nil];            
+            [self _loadDataSource:newDataSource withLoadType:loadType formState:nil];            
         }
         else {
             WebRequest *request = [[WebRequest alloc] initWithURL:itemURL];
@@ -1075,7 +1101,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
                 action = [self _actionInformationForLoadType:loadType isFormSubmission:NO event:nil originalURL:itemURL];
             }
 
-            [self _loadRequest:request triggeringAction:action loadType:loadType formValues:nil];
+            [self _loadRequest:request triggeringAction:action loadType:loadType formState:nil];
             [request release];
         }
     }
@@ -1147,14 +1173,14 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self _recursiveGoToItem:item fromItem:currItem withLoadType:type];
 }
 
-- (void)_loadRequest:(WebRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values
+- (void)_loadRequest:(WebRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formState:(WebFormState *)formState
 {
     WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
     [newDataSource _setTriggeringAction:action];
 
     [newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
 
-    [self _loadDataSource:newDataSource withLoadType:loadType formValues:values];
+    [self _loadDataSource:newDataSource withLoadType:loadType formState:formState];
 
     [newDataSource release];
 }
@@ -1225,12 +1251,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     WebRequest *request = _private->policyRequest;
     id target = _private->policyTarget;
     SEL selector = _private->policySelector;
-    NSDictionary *formValues = _private->policyFormValues;
+    WebFormState *formState = _private->policyFormState;
 
     _private->policyRequest = nil;
     _private->policyTarget = nil;
     _private->policySelector = nil;
-    _private->policyFormValues = nil;
+    _private->policyFormState = nil;
 
     if (call) {
         [target performSelector:selector withObject:nil withObject:nil];
@@ -1238,10 +1264,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
     [request release];
     [target release];
-    [formValues release];
+    [formState release];
 }
 
-- (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formValues:(NSDictionary *)values andCall:(id)target withSelector:(SEL)selector
+- (void)_checkNavigationPolicyForRequest:(WebRequest *)request dataSource:(WebDataSource *)dataSource formState:(WebFormState *)formState andCall:(id)target withSelector:(SEL)selector
 {
     NSDictionary *action = [dataSource _triggeringAction];
     if (action == nil) {
@@ -1271,7 +1297,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     _private->policyTarget = [target retain];
     _private->policySelector = selector;
     _private->listener = [listener retain];
-    _private->policyFormValues = [values retain];
+    _private->policyFormState = [formState retain];
 
     [[[self controller] policyDelegate] decideNavigationPolicyForAction:action
                                                              andRequest:request
@@ -1286,7 +1312,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     WebRequest *request = [[_private->policyRequest retain] autorelease];
     id target = [[_private->policyTarget retain] autorelease];
     SEL selector = _private->policySelector;
-    NSDictionary *formValues = [[_private->policyFormValues retain] autorelease];
+    WebFormState *formState = [[_private->policyFormState retain] autorelease];
 
     // will release _private->policy* objects, hence the above retains
     [self _invalidatePendingPolicyDecisionCallingDefaultAction:NO];
@@ -1343,10 +1369,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
                     format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
     }
 
-    [target performSelector:selector withObject:(shouldContinue ? request : nil) withObject:formValues];
+    [target performSelector:selector withObject:(shouldContinue ? request : nil) withObject:formState];
 }
 
--(void)_continueFragmentScrollAfterNavigationPolicy:(WebRequest *)request formValues:(NSDictionary *)values
+-(void)_continueFragmentScrollAfterNavigationPolicy:(WebRequest *)request formState:(WebFormState *)formState
 {
     if (!request) {
         return;
@@ -1400,7 +1426,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 }
 
 // main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
     BOOL isFormSubmission = (values != nil);
     WebRequest *request = [[WebRequest alloc] initWithURL:URL];
@@ -1414,6 +1440,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     ASSERT(loadType != WebFrameLoadTypeSame);
 
     NSDictionary *action = [self _actionInformationForLoadType:loadType isFormSubmission:isFormSubmission event:event originalURL:URL];
+    WebFormState *formState = [[WebFormState alloc] initWithForm:form values:values];
 
     WebDataSource *oldDataSource = [[self dataSource] retain];
 
@@ -1444,9 +1471,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
         [oldDataSource _setTriggeringAction:action];
         [self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
-        [self _checkNavigationPolicyForRequest:request dataSource:oldDataSource formValues:values andCall:self withSelector:@selector(_continueFragmentScrollAfterNavigationPolicy:formValues:)];
+        [self _checkNavigationPolicyForRequest:request dataSource:oldDataSource formState:formState andCall:self withSelector:@selector(_continueFragmentScrollAfterNavigationPolicy:formState:)];
     } else {
-        [self _loadRequest:request triggeringAction:action loadType:loadType formValues:values];
+        [self _loadRequest:request triggeringAction:action loadType:loadType formState:formState];
         if (_private->quickRedirectComing) {
             _private->quickRedirectComing = NO;
             
@@ -1464,6 +1491,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     }
 
     [oldDataSource release];
+    [formState release];
 }
 
 - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame
@@ -1504,10 +1532,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     }
 
     // FIXME: is this the right referrer?
-    [childFrame _loadURL:URL referrer:[[self _bridge] referrer] loadType:childLoadType triggeringEvent:nil formValues:nil];
+    [childFrame _loadURL:URL referrer:[[self _bridge] referrer] loadType:childLoadType triggeringEvent:nil form:nil formValues:nil];
 }
 
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values
 {
     // When posting, use the WebResourceHandleFlagLoadFromOrigin load flag.
     // This prevents a potential bug which may cause a page with a form that uses itself
@@ -1521,10 +1549,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [request setReferrer:referrer];
 
     NSDictionary *action = [self _actionInformationForLoadType:WebFrameLoadTypeStandard isFormSubmission:YES event:event originalURL:URL];
+    WebFormState *formState = [[WebFormState alloc] initWithForm:form values:values];
 
-    [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard formValues:values];
+    [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard formState:formState];
 
     [request release];
+    [formState release];
 }
 
 - (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory
@@ -1598,8 +1628,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [request release];
     
     [newDataSource _setOverrideEncoding:encoding];
-    
-    [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData formValues:nil];
+
+    [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData formState:nil];
     
     [newDataSource release];
 }
@@ -1696,7 +1726,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     return nil;
 }
 
--(void)_continueLoadRequestAfterNavigationPolicy:(WebRequest *)request formValues:(NSDictionary *)values
+-(void)_continueLoadRequestAfterNavigationPolicy:(WebRequest *)request formState:(WebFormState *)formState
 {
     if (!request) {
         [self _resetBackForwardListToCurrent];
@@ -1724,14 +1754,14 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
             [_private->provisionalDataSource _startLoading: pageCache];
         }
     } else {
-        if (values) {
-            [[[self controller] _formDelegate] frame:self willSubmitFormWithValues:values];
+        if (formState) {
+            [[[self controller] _formDelegate] frame:self willSubmitForm:[formState form] withValues:[formState values]];
         }
         [_private->provisionalDataSource startLoading];
     }
 }
 
-- (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values
+- (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType:(WebFrameLoadType)loadType formState:(WebFormState *)formState
 {
     ASSERT([self controller] != nil);
 
@@ -1757,7 +1787,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     
     ASSERT([newDataSource webFrame] == self);
 
-    [self _checkNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource formValues:values andCall:self withSelector:@selector(_continueLoadRequestAfterNavigationPolicy:formValues:)];
+    [self _checkNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource formState:formState andCall:self withSelector:@selector(_continueLoadRequestAfterNavigationPolicy:formState:)];
 }
 
 - (void)_downloadRequest:(WebRequest *)request toDirectory:(NSString *)directory
@@ -1769,7 +1799,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         [dataSource _setDownloadDirectory:directory];
     }
 
-    [self _loadDataSource:dataSource withLoadType:WebFrameLoadTypeStandard formValues:nil];
+    [self _loadDataSource:dataSource withLoadType:WebFrameLoadTypeStandard formState:nil];
 
     [dataSource release];
 }
@@ -1797,3 +1827,32 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 }    
 
 @end
+
+ at implementation WebFormState : NSObject
+
+- (id)initWithForm:(NSObject <WebDOMElement> *)form values:(NSDictionary *)values
+{
+    [super init];
+    _form = [form retain];
+    _values = [values copy];
+    return self;
+}
+
+- (void)dealloc
+{
+    [_form release];
+    [_values release];
+    [super dealloc];
+}
+
+- (id <WebDOMElement>)form
+{
+    return _form;
+}
+
+- (NSDictionary *)values
+{
+    return _values;
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.h b/WebKit/WebView.subproj/WebHTMLRepresentation.h
index 41711d1..88e3ba7 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.h
@@ -53,6 +53,9 @@
 
 - (id <WebDOMElement>)elementForView:(NSView *)view;
 - (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element;
-- (BOOL)elementIsInLoginForm:(id <WebDOMElement>)element;
+- (BOOL)formIsLoginForm:(id <WebDOMElement>)element;
+- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
+- (id <WebDOMElement>)currentForm;
+- (NSArray *)controlsInForm:(id <WebDOMElement>)form;
 
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index fc58e43..a3301a7 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -123,9 +123,24 @@
     return [_private->bridge elementDoesAutoComplete:element];
 }
 
-- (BOOL)elementIsInLoginForm:(id <WebDOMElement>)element
+- (BOOL)formIsLoginForm:(id <WebDOMElement>)element
 {
-    return [_private->bridge elementIsInLoginForm:element];
+    return [_private->bridge formIsLoginForm:element];
+}
+
+- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element
+{
+    return [_private->bridge formForElement:element];
+}
+
+- (id <WebDOMElement>)currentForm;
+{
+    return [_private->bridge currentForm];
+}
+
+- (NSArray *)controlsInForm:(id <WebDOMElement>)form
+{
+    return [_private->bridge controlsInForm:form];
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.h b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
index e195bb8..5d62d89 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.h
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
@@ -67,7 +67,7 @@
 - (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
 
 /*!
-    @method locationChangeDone:forDataSource
+    @method locationChangeDone:forDataSource:
     @abstract Notify that a location change is done (possibly with an error) for a data source
     @param error The error, if one occurred, or nil if none
     @param dataSource The data source that finished changing location
@@ -77,6 +77,15 @@
 - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
 
 /*!
+    @method willCloseLocationForDataSource:
+    @abstract Notify that a location will be closed.
+    @param dataSource The data source that where the location change originally happened
+    @discussion This callback happens right before WebKit is done with the data source
+    and the document representation that it contains.
+ */
+- (void)willCloseLocationForDataSource:(WebDataSource *)dataSource;
+
+/*!
     @method locationChangedWithinPageForDataSource:
     @abstract Notify that a further location change within the page
     has occurred for an already loaded data source
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.m b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
index 097e4e4..83b30f7 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.m
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
@@ -18,6 +18,8 @@
 
 - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource { }
 
+- (void)willCloseLocationForDataSource:(WebDataSource *)dataSource { }
+
 - (void)locationChangedWithinPageForDataSource:(WebDataSource *)dataSource { }
 
 - (void)clientWillRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame { }
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 95a4cfa..73cc334 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -127,7 +127,7 @@
     [self cancelQuietly];
 }
 
--(void)continueAfterNavigationPolicy:(WebRequest *)_request formValues:(NSDictionary *)values
+-(void)continueAfterNavigationPolicy:(WebRequest *)_request formState:(WebFormState *)state
 {
     [[dataSource controller] setDefersCallbacks:NO];
     if (!_request) {
@@ -159,7 +159,7 @@
     // Don't set this on the first request.  It is set
     // when the main load was started.
     [dataSource _setRequest:newRequest];
-    [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formValues:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formValues:)];
+    [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formState:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formState:)];
 
     return newRequest;
 }
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 95a4cfa..73cc334 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -127,7 +127,7 @@
     [self cancelQuietly];
 }
 
--(void)continueAfterNavigationPolicy:(WebRequest *)_request formValues:(NSDictionary *)values
+-(void)continueAfterNavigationPolicy:(WebRequest *)_request formState:(WebFormState *)state
 {
     [[dataSource controller] setDefersCallbacks:NO];
     if (!_request) {
@@ -159,7 +159,7 @@
     // Don't set this on the first request.  It is set
     // when the main load was started.
     [dataSource _setRequest:newRequest];
-    [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formValues:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formValues:)];
+    [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formState:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formState:)];
 
     return newRequest;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list