[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:23:42 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit c1893a87e0392fed98ffbf23337c71b36eb2c338
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 6 04:56:19 2003 +0000
WebCore:
Pass formValues up through the bridge at submit time.
Reviewed by Maciej
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::submit): Tell KWQPart about the form values, instead of
talking to the khtmlview.
* kwq/KWQKHTMLPart.h: New ivar to store formValues.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Init ivar
(KWQKHTMLPart::~KWQKHTMLPart): Free ivar
(KWQKHTMLPart::openURL): Pass nil formValues
(KWQKHTMLPart::openURLRequest): Pass nil formValues
(KWQKHTMLPart::clearRecordedFormValues): Clear saved formValues
(KWQKHTMLPart::recordFormValue): Record a name/value
(KWQKHTMLPart::submitForm): Pass along recorded formValues
(KWQKHTMLPart::urlSelected): Pass nil formValues
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Pass nil formValues
* kwq/WebCoreBridge.h: New params for formValues
WebKit:
WC now tells us the form values being submitted with a get/post.
We forward this info to a new WebFormDelegate method. Most of this
change is just glue passing the formValues through all our layers.
Reviewed by Maciej
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge loadURL:reload:triggeringEvent:formValues:])
Pass along formValues.
(-[WebBridge postWithURL:data:contentType:triggeringEvent:formValues:]):
Pass along formValues.
* WebKit.pbproj/project.pbxproj: Reorder previously added files.
* WebView.subproj/WebControllerPolicyDelegate.m: Fix latent copy/paste error
where two keys had the same underlying string value!
* WebView.subproj/WebFormDelegate.h: Declare new delegate method.
* WebView.subproj/WebFormDelegate.m:
(-[WebFormDelegate frame:willSubmitFormWithValues:]): NOP impl of new method.
* WebView.subproj/WebFrame.m:
(-[WebFrame loadRequest:]): Pass nil formValues.
(-[WebFrame reload]): Pass nil formValues.
* WebView.subproj/WebFramePrivate.h: New ivar to hold form values
while waiting for the policy delegate response.
* WebView.subproj/WebFramePrivate.m:
(-[WebFramePrivate dealloc]): ASSERT new ivar is nil.
(-[WebFrame _loadItem:fromItem:withLoadType:]): Pass nil formValues.
(-[WebFrame _loadRequest:triggeringAction:loadType:formValues:]):
Pass along formValues.
(-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]):
Pass nil formValues to continuation method.
(-[WebFrame _checkNavigationPolicyForRequest:dataSource:formValues:andCall:withSelector:]):
Stash formValues before calling policy delegate.
(-[WebFrame _continueAfterNavigationPolicy:]):
Resurrect formValues after calling policy delegate, pass to continuation method.
(-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formValues:]):
Bail on nil request instead of shouldContinue=NO
(-[WebFrame _loadURL:loadType:triggeringEvent:formValues:]):
Pass formValues along.
(-[WebFrame _loadURL:intoChild:]): Pass nil formValues.
(-[WebFrame _postWithURL:data:contentType:triggeringEvent:formValues:]):
Pass formValues along.
(-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]):
Pass nil formValues.
(-[WebFrame _continueLoadRequestAfterNavigationPolicy:formValues:]):
Bail on nil request instead of shouldContinue=NO. Call new FormDelegate method.
(-[WebFrame _loadDataSource:withLoadType:formValues:]):
Pass formValues along.
(-[WebFrame _downloadRequest:toDirectory:]):
Pass nil formValues.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient continueAfterNavigationPolicy:formValues:]):
Bail on nil request instead of shouldContinue=NO
(-[WebMainResourceClient handle:willSendRequest:]):
Pass nil formValues.
WebBrowser:
Add new FormCompletionController class, mostly unimplemented.
Add implementation of new WebFormDelegate method, which tells us
when a form is submitted.
Reviewed by Maciej
* BrowserWindowController.m:
(-[FormDelegate dealloc]): Free completion controller.
(-[FormDelegate controlTextDidBeginEditing:inFrame:]): Alloc completion controller.
(-[FormDelegate frame:willSubmitFormWithValues:]): New FormDelegate method,
pass on to completion controller.
* FormCompletionController.h: Added.
* FormCompletionController.m: Added. New class, NOP impls.
(-[FormCompletionController initWithSourceField:frame:]):
(+[FormCompletionController _loadCompletionDB]):
(+[FormCompletionController frame:willSubmitFormWithValues:]):
(-[FormCompletionController executeQuery]):
(-[FormCompletionController reflectSelectedRow]):
(-[FormCompletionController reflectFinalSelectedRow]):
* LocationChangeHandler.m:
(-[LocationChangeHandler locationChangeStartedForDataSource:]):
Made some code a little clearer.
* WebBrowser.pbproj/project.pbxproj: New classes.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index adfbf68..dbf55f8 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,26 @@
+2003-02-04 Trey Matteson <trey at apple.com>
+
+ Pass formValues up through the bridge at submit time.
+
+ Reviewed by Maciej
+
+ * khtml/html/html_formimpl.cpp:
+ (HTMLFormElementImpl::submit): Tell KWQPart about the form values, instead of
+ talking to the khtmlview.
+ * kwq/KWQKHTMLPart.h: New ivar to store formValues.
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Init ivar
+ (KWQKHTMLPart::~KWQKHTMLPart): Free ivar
+ (KWQKHTMLPart::openURL): Pass nil formValues
+ (KWQKHTMLPart::openURLRequest): Pass nil formValues
+ (KWQKHTMLPart::clearRecordedFormValues): Clear saved formValues
+ (KWQKHTMLPart::recordFormValue): Record a name/value
+ (KWQKHTMLPart::submitForm): Pass along recorded formValues
+ (KWQKHTMLPart::urlSelected): Pass nil formValues
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ (KHTMLPartBrowserExtension::createNewWindow): Pass nil formValues
+ * kwq/WebCoreBridge.h: New params for formValues
+
2003-02-05 Darin Adler <darin at apple.com>
Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index adfbf68..dbf55f8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2003-02-04 Trey Matteson <trey at apple.com>
+
+ Pass formValues up through the bridge at submit time.
+
+ Reviewed by Maciej
+
+ * khtml/html/html_formimpl.cpp:
+ (HTMLFormElementImpl::submit): Tell KWQPart about the form values, instead of
+ talking to the khtmlview.
+ * kwq/KWQKHTMLPart.h: New ivar to store formValues.
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Init ivar
+ (KWQKHTMLPart::~KWQKHTMLPart): Free ivar
+ (KWQKHTMLPart::openURL): Pass nil formValues
+ (KWQKHTMLPart::openURLRequest): Pass nil formValues
+ (KWQKHTMLPart::clearRecordedFormValues): Clear saved formValues
+ (KWQKHTMLPart::recordFormValue): Record a name/value
+ (KWQKHTMLPart::submitForm): Pass along recorded formValues
+ (KWQKHTMLPart::urlSelected): Pass nil formValues
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ (KHTMLPartBrowserExtension::createNewWindow): Pass nil formValues
+ * kwq/WebCoreBridge.h: New params for formValues
+
2003-02-05 Darin Adler <darin at apple.com>
Reviewed by Dave.
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index dca34bd..3ade820 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -447,6 +447,9 @@ void HTMLFormElementImpl::submit( bool activateSubmitButton )
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
KHTMLView *view = getDocument()->view();
+#if APPLE_CHANGES
+ KWQ(view->part())->clearRecordedFormValues();
+#endif
for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
HTMLGenericFormElementImpl* current = it.current();
if (current->id() == ID_INPUT &&
@@ -454,7 +457,11 @@ void HTMLFormElementImpl::submit( bool activateSubmitButton )
static_cast<HTMLInputElementImpl*>(current)->autoComplete() )
{
HTMLInputElementImpl *input = static_cast<HTMLInputElementImpl *>(current);
+#if APPLE_CHANGES
+ KWQ(view->part())->recordFormValue(input->name().string(), input->value().string());
+#else
view->addFormCompletionItem(input->name().string(), input->value().string());
+#endif
}
if (needButtonActivation) {
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 63ef2ca..f2b40b4 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -50,6 +50,7 @@ namespace KJS {
@class NSView;
@class WebCoreBridge;
@class KWQPageState;
+ at class NSMutableDictionary;
#else
class NSAttributedString;
class NSEvent;
@@ -57,6 +58,7 @@ class NSResponder;
class NSView;
class WebCoreBridge;
class KWQPageState;
+class NSMutableDictionary;
#endif
enum KWQSelectionDirection {
@@ -171,6 +173,9 @@ public:
static const QPtrList<KWQKHTMLPart> &instances() { return mutableInstances(); }
+ void clearRecordedFormValues();
+ void recordFormValue(const QString &name, const QString &value);
+
private:
virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
@@ -214,6 +219,8 @@ private:
bool _formSubmittedFlag;
+ NSMutableDictionary *_formValues;
+
static QPtrList<KWQKHTMLPart> &mutableInstances();
friend class KHTMLPart;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index d2f2e42..fe66065 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -127,6 +127,7 @@ KWQKHTMLPart::KWQKHTMLPart()
, _mouseDownMayStartDrag(false)
, _mouseDownMayStartSelect(false)
, _formSubmittedFlag(false)
+ , _formValues(nil)
{
// Must init the cache before connecting to any signals
Cache::init();
@@ -144,6 +145,7 @@ KWQKHTMLPart::~KWQKHTMLPart()
if (_ownsView) {
delete d->m_view;
}
+ [_formValues release];
}
WebCoreBridge *KWQKHTMLPart::bridgeForFrameName(const QString &frameName)
@@ -173,13 +175,27 @@ 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() reload:NO triggeringEvent:nil isFormSubmission:NO];
+ [_bridge loadURL:url.url().getNSString() reload:NO triggeringEvent:nil formValues:nil];
return true;
}
void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
{
- [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload triggeringEvent:nil isFormSubmission:NO];
+ [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload triggeringEvent:nil formValues:nil];
+}
+
+void KWQKHTMLPart::clearRecordedFormValues()
+{
+ [_formValues release];
+ _formValues = nil;
+}
+
+void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value)
+{
+ if (!_formValues) {
+ _formValues = [[NSMutableDictionary alloc] init];
+ }
+ [_formValues setObject:value.getNSString() forKey:name.getNSString()];
}
void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
@@ -207,17 +223,22 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
}
_formSubmittedFlag = true;
}
-
+
if (!args.doPost()) {
- [target loadURL:url.url().getNSString() reload:args.reload
- triggeringEvent:_currentEvent isFormSubmission:YES];
+ [target loadURL:url.url().getNSString()
+ reload:args.reload
+ triggeringEvent:_currentEvent
+ formValues:_formValues];
} else {
QString contentType = args.contentType();
ASSERT(contentType.startsWith("Content-Type: "));
[target postWithURL:url.url().getNSString()
- data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
- contentType:contentType.mid(14).getNSString() triggeringEvent:_currentEvent];
+ data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
+ contentType:contentType.mid(14).getNSString()
+ triggeringEvent:_currentEvent
+ formValues:_formValues];
}
+ clearRecordedFormValues();
}
void KWQKHTMLPart::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
@@ -240,8 +261,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() reload:args.reload
- triggeringEvent:_currentEvent isFormSubmission:NO];
+ [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload triggeringEvent:_currentEvent formValues:nil];
}
class KWQPluginPart : public ReadOnlyPart
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index d40977e..e113493 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() reload:urlArgs.reload triggeringEvent:nil isFormSubmission:NO];
+ [bridge loadURL:url.url().getNSString() reload:urlArgs.reload triggeringEvent:nil formValues:nil];
}
*partResult = [bridge part];
return;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 234d303..376bc6d 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -200,8 +200,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 reload:(BOOL)reload triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
-- (void)postWithURL:(NSString *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event;
+- (void)loadURL:(NSString *)URL reload:(BOOL)reload triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
+- (void)postWithURL:(NSString *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
- (WebCoreBridge *)createWindowWithURL:(NSString *)URL frameName:(NSString *)name;
- (void)showWindow;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8293f19..c5990df 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,59 @@
+2003-02-04 Trey Matteson <trey at apple.com>
+
+ WC now tells us the form values being submitted with a get/post.
+ We forward this info to a new WebFormDelegate method. Most of this
+ change is just glue passing the formValues through all our layers.
+
+ Reviewed by Maciej
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge loadURL:reload:triggeringEvent:formValues:])
+ Pass along formValues.
+ (-[WebBridge postWithURL:data:contentType:triggeringEvent:formValues:]):
+ Pass along formValues.
+ * WebKit.pbproj/project.pbxproj: Reorder previously added files.
+ * WebView.subproj/WebControllerPolicyDelegate.m: Fix latent copy/paste error
+ where two keys had the same underlying string value!
+ * WebView.subproj/WebFormDelegate.h: Declare new delegate method.
+ * WebView.subproj/WebFormDelegate.m:
+ (-[WebFormDelegate frame:willSubmitFormWithValues:]): NOP impl of new method.
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame loadRequest:]): Pass nil formValues.
+ (-[WebFrame reload]): Pass nil formValues.
+ * WebView.subproj/WebFramePrivate.h: New ivar to hold form values
+ while waiting for the policy delegate response.
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFramePrivate dealloc]): ASSERT new ivar is nil.
+ (-[WebFrame _loadItem:fromItem:withLoadType:]): Pass nil formValues.
+ (-[WebFrame _loadRequest:triggeringAction:loadType:formValues:]):
+ Pass along formValues.
+ (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]):
+ Pass nil formValues to continuation method.
+ (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formValues:andCall:withSelector:]):
+ Stash formValues before calling policy delegate.
+ (-[WebFrame _continueAfterNavigationPolicy:]):
+ Resurrect formValues after calling policy delegate, pass to continuation method.
+ (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formValues:]):
+ Bail on nil request instead of shouldContinue=NO
+ (-[WebFrame _loadURL:loadType:triggeringEvent:formValues:]):
+ Pass formValues along.
+ (-[WebFrame _loadURL:intoChild:]): Pass nil formValues.
+ (-[WebFrame _postWithURL:data:contentType:triggeringEvent:formValues:]):
+ Pass formValues along.
+ (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]):
+ Pass nil formValues.
+ (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formValues:]):
+ Bail on nil request instead of shouldContinue=NO. Call new FormDelegate method.
+ (-[WebFrame _loadDataSource:withLoadType:formValues:]):
+ Pass formValues along.
+ (-[WebFrame _downloadRequest:toDirectory:]):
+ Pass nil formValues.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient continueAfterNavigationPolicy:formValues:]):
+ Bail on nil request instead of shouldContinue=NO
+ (-[WebMainResourceClient handle:willSendRequest:]):
+ Pass nil formValues.
+
2003-02-05 Richard Williamson <rjw at apple.com>
WebHistory* API clenaup.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index b5b8931..4440514 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -281,14 +281,14 @@
[[self dataSource] _setIconURL:[NSURL _web_URLWithString:URL] withType:type];
}
-- (void)loadURL:(NSString *)URL reload:(BOOL)reload triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
+- (void)loadURL:(NSString *)URL reload:(BOOL)reload triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
{
- [frame _loadURL:[NSURL _web_URLWithString:URL] loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) triggeringEvent:event isFormSubmission:isFormSubmission];
+ [frame _loadURL:[NSURL _web_URLWithString:URL] loadType:(reload ? WebFrameLoadTypeReload : WebFrameLoadTypeStandard) triggeringEvent:event formValues:values];
}
-- (void)postWithURL:(NSString *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event
+- (void)postWithURL:(NSString *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
{
- [frame _postWithURL:[NSURL _web_URLWithString:URL] data:data contentType:contentType triggeringEvent:event];
+ [frame _postWithURL:[NSURL _web_URLWithString:URL] data:data contentType:contentType triggeringEvent:event formValues:values];
}
- (NSString *)generateFrameName
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index cff2d75..35a0209 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -2350,6 +2350,8 @@
35081DAE02B6D4F50ACA2ACA,
3944606B020F50ED0ECA1767,
3944606C020F50ED0ECA1767,
+ 2D81DAB203EB0B2D00A80166,
+ 2D81DAB303EB0B2D00A80166,
39446074020F50ED0ECA1767,
F5143A370221DCCE01A80181,
9CF0E249021361B00ECA16EA,
@@ -2367,8 +2369,6 @@
39446077020F50ED0ECA1767,
39446079020F50ED0ECA1767,
511D5553033FD51000CA2ACD,
- 2D81DAB203EB0B2D00A80166,
- 2D81DAB303EB0B2D00A80166,
);
isa = PBXGroup;
name = WebView;
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
index 9f67b99..9121125 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
@@ -7,7 +7,7 @@
#import <WebKit/WebControllerPolicyDelegatePrivate.h>
NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
-NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
+NSString *WebActionElementKey = @"WebActionElementKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey";
diff --git a/WebKit/WebView.subproj/WebFormDelegate.h b/WebKit/WebView.subproj/WebFormDelegate.h
index f273faa..7e5aa38 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
@@ -31,6 +32,8 @@
- (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;
@end
/*!
diff --git a/WebKit/WebView.subproj/WebFormDelegate.m b/WebKit/WebView.subproj/WebFormDelegate.m
index 01811ea..7108018 100644
--- a/WebKit/WebView.subproj/WebFormDelegate.m
+++ b/WebKit/WebView.subproj/WebFormDelegate.m
@@ -43,4 +43,6 @@
return NO;
}
+- (void)frame:(WebFrame *)frame willSubmitFormWithValues:(NSDictionary *)values { }
+
@end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index cea8dd6..74328e8 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -122,7 +122,7 @@
[newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
- [self _loadDataSource:newDataSource withLoadType:loadType];
+ [self _loadDataSource:newDataSource withLoadType:loadType formValues:nil];
[newDataSource release];
}
@@ -159,7 +159,7 @@
[newDataSource _setOverrideEncoding:[dataSource _overrideEncoding]];
- [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload];
+ [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload formValues:nil];
[newDataSource release];
}
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 100e165..a8f2c36 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -67,9 +67,12 @@ typedef enum {
WebHistoryItem *previousItem; // BF item for previous content, see _itemForSavingDocState
WebPolicyDecisionListener *listener;
+ // state we'll need to continue after waiting for the policy delegate's decision
WebResourceRequest *policyRequest;
id policyTarget;
SEL policySelector;
+ NSDictionary *policyFormValues;
+
BOOL justOpenedForTargetedLink;
BOOL quickRedirectComing;
}
@@ -117,14 +120,14 @@ typedef enum {
- (void)_addExtraFieldsToRequest:(WebResourceRequest *)request alwaysFromRequest: (BOOL)f;
-- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector;
+- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource formValues:(NSDictionary *)values andCall:(id)target withSelector:(SEL)selector;
- (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
- (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
-- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
+- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values;
- (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
-- (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event;
+- (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event 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;
+- (void)_loadDataSource:(WebDataSource *)dataSource withLoadType:(WebFrameLoadType)type formValues:(NSDictionary *)values;
- (void)_downloadRequest:(WebResourceRequest *)request toDirectory:(NSString *)directory;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 838def9..cc96f87 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -16,6 +16,7 @@
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDocument.h>
#import <WebKit/WebDynamicScrollBarsView.h>
+#import <WebKit/WebFormDelegate.h>
#import <WebKit/WebHistoryPrivate.h>
#import <WebKit/WebHistoryItemPrivate.h>
#import <WebKit/WebHTMLRepresentation.h>
@@ -90,7 +91,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
*/
@interface WebFrame (ForwardDecls)
-- (void)_loadRequest:(WebResourceRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType;
+- (void)_loadRequest:(WebResourceRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values;
- (NSDictionary *)_actionInformationForLoadType:(WebFrameLoadType)loadType isFormSubmission:(BOOL)isFormSubmission event:(NSEvent *)event originalURL:(NSURL *)URL;
@@ -139,6 +140,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);
[super dealloc];
}
@@ -1025,7 +1027,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
WebDataSource *newDataSource;
if ([item hasPageCache]){
newDataSource = [[item pageCache] objectForKey: @"WebKitDataSource"];
- [self _loadDataSource:newDataSource withLoadType:loadType];
+ [self _loadDataSource:newDataSource withLoadType:loadType formValues:nil];
}
else {
WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:itemURL];
@@ -1080,7 +1082,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
action = [self _actionInformationForLoadType:loadType isFormSubmission:NO event:nil originalURL:itemURL];
}
- [self _loadRequest:request triggeringAction:action loadType:loadType];
+ [self _loadRequest:request triggeringAction:action loadType:loadType formValues:nil];
[request release];
}
}
@@ -1152,14 +1154,14 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[self _recursiveGoToItem:item fromItem:currItem withLoadType:type];
}
-- (void)_loadRequest:(WebResourceRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType
+- (void)_loadRequest:(WebResourceRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values
{
WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
[newDataSource _setTriggeringAction:action];
[newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
- [self _loadDataSource:newDataSource withLoadType:loadType];
+ [self _loadDataSource:newDataSource withLoadType:loadType formValues:values];
[newDataSource release];
}
@@ -1221,7 +1223,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
return [self _actionInformationForNavigationType:navType event:event originalURL:URL];
}
-- (void) _invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call
+- (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call
{
[_private->listener _invalidate];
[_private->listener release];
@@ -1230,20 +1232,23 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
WebResourceRequest *request = _private->policyRequest;
id target = _private->policyTarget;
SEL selector = _private->policySelector;
+ NSDictionary *formValues = _private->policyFormValues;
_private->policyRequest = nil;
_private->policyTarget = nil;
_private->policySelector = nil;
+ _private->policyFormValues = nil;
if (call) {
- [target performSelector:selector withObject:(id)NO withObject:request];
+ [target performSelector:selector withObject:nil withObject:nil];
}
[request release];
[target release];
+ [formValues release];
}
-- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector
+- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource formValues:(NSDictionary *)values andCall:(id)target withSelector:(SEL)selector
{
NSDictionary *action = [dataSource _triggeringAction];
if (action == nil) {
@@ -1253,14 +1258,14 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
// Don't ask more than once for the same request
if ([request isEqual:[dataSource _lastCheckedRequest]]) {
- [target performSelector:selector withObject:(id)YES withObject:request];
+ [target performSelector:selector withObject:request withObject:nil];
return;
}
// If we are loading the empty URL, don't bother to ask - clients
// are likely to get confused.
if ([[[request URL] absoluteString] length] == 0) {
- [target performSelector:selector withObject:(id)YES withObject:request];
+ [target performSelector:selector withObject:request withObject:nil];
return;
}
@@ -1273,6 +1278,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
_private->policyTarget = [target retain];
_private->policySelector = selector;
_private->listener = [listener retain];
+ _private->policyFormValues = [values retain];
[[[self controller] policyDelegate] decideNavigationPolicyForAction:action
andRequest:request
@@ -1287,7 +1293,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
WebResourceRequest *request = [[_private->policyRequest retain] autorelease];
id target = [[_private->policyTarget retain] autorelease];
SEL selector = _private->policySelector;
+ NSDictionary *formValues = [[_private->policyFormValues retain] autorelease];
+ // will release _private->policy* objects, hence the above retains
[self _invalidatePendingPolicyDecisionCallingDefaultAction:NO];
BOOL shouldContinue = NO;
@@ -1342,12 +1350,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
}
- [target performSelector:selector withObject:(id)(unsigned)shouldContinue withObject:request];
+ [target performSelector:selector withObject:(shouldContinue ? request : nil) withObject:formValues];
}
--(void)_continueFragmentScrollAfterNavigationPolicy:(BOOL)shouldContinue request:(WebResourceRequest *)request
+-(void)_continueFragmentScrollAfterNavigationPolicy:(WebResourceRequest *)request formValues:(NSDictionary *)values
{
- if (!shouldContinue) {
+ if (!request) {
return;
}
@@ -1399,11 +1407,12 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
}
// main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
-- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission
+- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event formValues:(NSDictionary *)values
{
+ BOOL isFormSubmission = (values != nil);
WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
[request setReferrer:[_private->bridge referrer]];
- [self _addExtraFieldsToRequest:request alwaysFromRequest: (event != nil || isFormSubmission) ? YES : NO ];
+ [self _addExtraFieldsToRequest:request alwaysFromRequest: (event != nil || isFormSubmission)];
if (loadType == WebFrameLoadTypeReload) {
[request setRequestCachePolicy:WebRequestCachePolicyLoadFromOrigin];
}
@@ -1442,10 +1451,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[oldDataSource _setTriggeringAction:action];
[self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
- [self _checkNavigationPolicyForRequest:request dataSource:oldDataSource
- andCall:self withSelector:@selector(_continueFragmentScrollAfterNavigationPolicy:request:)];
+ [self _checkNavigationPolicyForRequest:request dataSource:oldDataSource formValues:values andCall:self withSelector:@selector(_continueFragmentScrollAfterNavigationPolicy:formValues:)];
} else {
- [self _loadRequest:request triggeringAction:action loadType:loadType];
+ [self _loadRequest:request triggeringAction:action loadType:loadType formValues:values];
if (_private->quickRedirectComing) {
_private->quickRedirectComing = NO;
@@ -1502,10 +1510,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
}
}
- [childFrame _loadURL:URL loadType:childLoadType triggeringEvent:nil isFormSubmission:NO];
+ [childFrame _loadURL:URL loadType:childLoadType triggeringEvent:nil formValues:nil];
}
-- (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event
+- (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event 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
@@ -1520,7 +1528,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
NSDictionary *action = [self _actionInformationForLoadType:WebFrameLoadTypeStandard isFormSubmission:YES event:event originalURL:URL];
- [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard];
+ [self _loadRequest:request triggeringAction:action loadType:WebFrameLoadTypeStandard formValues:values];
[request release];
}
@@ -1608,7 +1616,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[newDataSource _setOverrideEncoding:encoding];
- [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData];
+ [self _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData formValues:nil];
[newDataSource release];
}
@@ -1705,9 +1713,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
return nil;
}
--(void)_continueLoadRequestAfterNavigationPolicy:(BOOL)shouldContinue request:(WebResourceRequest *)request
+-(void)_continueLoadRequestAfterNavigationPolicy:(WebResourceRequest *)request formValues:(NSDictionary *)values
{
- if (!shouldContinue) {
+ if (!request) {
[self _resetBackForwardListToCurrent];
[self _setLoadType: WebFrameLoadTypeStandard];
[_private setProvisionalDataSource:nil];
@@ -1732,12 +1740,15 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
LOG (PageCache, "Restoring page from back/forward cache, %s\n", [[[[_private provisionalItem] URL] absoluteString] cString]);
[_private->provisionalDataSource _startLoading: pageCache];
}
- }
- else
+ } else {
+ if (values) {
+ [[[self controller] _formDelegate] frame:self willSubmitFormWithValues:values];
+ }
[_private->provisionalDataSource startLoading];
+ }
}
-- (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType: (WebFrameLoadType)loadType
+- (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType:(WebFrameLoadType)loadType formValues:(NSDictionary *)values
{
ASSERT([self controller] != nil);
@@ -1763,7 +1774,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
ASSERT([newDataSource webFrame] == self);
- [self _checkNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource andCall:self withSelector:@selector(_continueLoadRequestAfterNavigationPolicy:request:)];
+ [self _checkNavigationPolicyForRequest:[newDataSource request] dataSource:newDataSource formValues:values andCall:self withSelector:@selector(_continueLoadRequestAfterNavigationPolicy:formValues:)];
}
- (void)_downloadRequest:(WebResourceRequest *)request toDirectory:(NSString *)directory
@@ -1775,7 +1786,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[dataSource _setDownloadDirectory:directory];
}
- [self _loadDataSource:dataSource withLoadType:WebFrameLoadTypeStandard];
+ [self _loadDataSource:dataSource withLoadType:WebFrameLoadTypeStandard formValues:nil];
[dataSource release];
}
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index e97f8fe..5d74845 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -131,10 +131,10 @@
[self cancelQuietly];
}
--(void)continueAfterNavigationPolicy:(BOOL)shouldContinue request:(WebResourceRequest *)request
+-(void)continueAfterNavigationPolicy:(WebResourceRequest *)_request formValues:(NSDictionary *)values
{
[[dataSource controller] _setDefersCallbacks:NO];
- if (!shouldContinue) {
+ if (!_request) {
[self stopLoadingForPolicyChange];
}
}
@@ -163,7 +163,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 andCall:self withSelector:@selector(continueAfterNavigationPolicy:request:)];
+ [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formValues:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formValues:)];
return newRequest;
}
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index e97f8fe..5d74845 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -131,10 +131,10 @@
[self cancelQuietly];
}
--(void)continueAfterNavigationPolicy:(BOOL)shouldContinue request:(WebResourceRequest *)request
+-(void)continueAfterNavigationPolicy:(WebResourceRequest *)_request formValues:(NSDictionary *)values
{
[[dataSource controller] _setDefersCallbacks:NO];
- if (!shouldContinue) {
+ if (!_request) {
[self stopLoadingForPolicyChange];
}
}
@@ -163,7 +163,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 andCall:self withSelector:@selector(continueAfterNavigationPolicy:request:)];
+ [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formValues:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formValues:)];
return newRequest;
}
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.m b/WebKit/WebView.subproj/WebPolicyDelegate.m
index 9f67b99..9121125 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.m
@@ -7,7 +7,7 @@
#import <WebKit/WebControllerPolicyDelegatePrivate.h>
NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
-NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
+NSString *WebActionElementKey = @"WebActionElementKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey";
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list