Reviewed by Alice.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 09:53:40 +0000 (09:53 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 09:53:40 +0000 (09:53 +0000)
        - moved WebFormState into Loader directory and tweaked to void WebKit dependencies

        * Loader/WebDocumentLoader.h:
        * Loader/WebFormState.h: Added.
        * Loader/WebFormState.m: Added.
        (-[WebFormState initWithForm:values:sourceFrame:]):
        (-[WebFormState dealloc]):
        (-[WebFormState form]):
        (-[WebFormState values]):
        (-[WebFormState sourceFrame]):
        * Loader/WebFrameLoader.h:
        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
        (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]):
        (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebFrame.m:
        * WebView/WebFrameInternal.h:

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

WebKit/ChangeLog
WebKit/Loader/WebDocumentLoader.h
WebKit/Loader/WebFormState.h [new file with mode: 0644]
WebKit/Loader/WebFormState.m [new file with mode: 0644]
WebKit/Loader/WebFrameLoader.h
WebKit/Loader/WebFrameLoader.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.m
WebKit/WebView/WebFrameInternal.h

index b14b659fc34d89cb1579116d278c1cd810ff4f82..207d685bc45813981b802836662efd34adcd9ac3 100644 (file)
@@ -1,3 +1,26 @@
+2006-10-09  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Alice.
+
+        - moved WebFormState into Loader directory and tweaked to void WebKit dependencies
+        
+        * Loader/WebDocumentLoader.h:
+        * Loader/WebFormState.h: Added.
+        * Loader/WebFormState.m: Added.
+        (-[WebFormState initWithForm:values:sourceFrame:]):
+        (-[WebFormState dealloc]):
+        (-[WebFormState form]):
+        (-[WebFormState values]):
+        (-[WebFormState sourceFrame]):
+        * Loader/WebFrameLoader.h:
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
+        (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]):
+        (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebFrame.m:
+        * WebView/WebFrameInternal.h:
+
 2006-10-09  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Oliver.
index 8641702d5126ea27eddd21f568a54f9b5f9c273b..fe1e7dd36b72991d60e627c7a0ef9657e86a5bf1 100644 (file)
@@ -30,7 +30,6 @@
 
 @class WebFrameLoader;
 
-// To be renamed to WebDocumentLoader
 @interface WebDocumentLoader : NSObject
 {
 @public
diff --git a/WebKit/Loader/WebFormState.h b/WebKit/Loader/WebFormState.h
new file mode 100644 (file)
index 0000000..58d6cff
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+@class DOMElement;
+@class WebCoreFrameBridge;
+
+// 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.
+@interface WebFormState : NSObject
+{
+    DOMElement *_form;
+    NSDictionary *_values;
+    WebCoreFrameBridge *_sourceFrame;
+}
+- (id)initWithForm:(DOMElement *)form values:(NSDictionary *)values sourceFrame:(WebCoreFrameBridge *)sourceFrame;
+- (DOMElement *)form;
+- (NSDictionary *)values;
+- (WebCoreFrameBridge *)sourceFrame;
+@end
+
diff --git a/WebKit/Loader/WebFormState.m b/WebKit/Loader/WebFormState.m
new file mode 100644 (file)
index 0000000..9dc652b
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebFormState.h"
+
+@implementation WebFormState : NSObject
+
+- (id)initWithForm:(DOMElement *)form values:(NSDictionary *)values sourceFrame:(WebCoreFrameBridge *)sourceFrame
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _form = [form retain];
+    _values = [values copy];
+    _sourceFrame = [sourceFrame retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [_form release];
+    [_values release];
+    [_sourceFrame release];
+    [super dealloc];
+}
+
+- (DOMElement *)form
+{
+    return _form;
+}
+
+- (NSDictionary *)values
+{
+    return _values;
+}
+
+- (WebCoreFrameBridge *)sourceFrame
+{
+    return _sourceFrame;
+}
+
+@end
+
index 45cb223bf179adca31ac2252ff721840eca24301..b0befc89aa3b119d3ca597e81a7b82915b3f3fad 100644 (file)
 @class WebFrameBridge;
 @class WebLoader;
 @class WebMainResourceLoader;
-@class WebArchive;
 @protocol WebFrameLoaderClient;
 
 @class WebArchive;
 @class WebPolicyDecisionListener;
-@class WebResource;
 
 typedef enum {
     WebFrameStateProvisional,
index a1e0e64007359ea675e40a4244fc002ecc2ae019..155ffb6ed19f1dd94ad3d7bfce4eb24760c642bd 100644 (file)
@@ -31,6 +31,7 @@
 #import "WebDataProtocol.h"
 #import "WebDocumentLoader.h"
 #import "WebFormDataStream.h"
+#import "WebFormState.h"
 #import "WebFrameBridge.h"
 #import "WebFrameLoaderClient.h"
 #import "WebMainResourceLoader.h"
@@ -590,7 +591,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     NSDictionary *action = [self actionInformationForLoadType:_loadType isFormSubmission:isFormSubmission event:event originalURL:URL];
     WebFormState *formState = nil;
     if (form && values)
-        formState = [[WebFormState alloc] initWithForm:form values:values sourceFrame:client];
+        formState = [[WebFormState alloc] initWithForm:form values:values sourceFrame:[client _bridge]];
     
     if (target != nil) {
         WebFrame *targetFrame = [client findFrameNamed:target];
@@ -1498,7 +1499,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         // It's a bit of a hack to reuse the WebPolicyDecisionListener for the continuation
         // mechanism across the willSubmitForm callout.
         listener = [[WebPolicyDecisionListener alloc] _initWithTarget:self action:@selector(continueAfterWillSubmitForm:)];
-        [[[client webView] _formDelegate] frame:client sourceFrame:[formState sourceFrame] willSubmitForm:[formState form] withValues:[formState values] submissionListener:listener];
+        [[[client webView] _formDelegate] frame:client sourceFrame:[(WebFrameBridge *)[formState sourceFrame] webFrame] willSubmitForm:[formState form] withValues:[formState values] submissionListener:listener];
     } 
     else {
         [self continueAfterWillSubmitForm:WebPolicyUse];
@@ -1872,7 +1873,7 @@ exit:
     NSDictionary *action = [self actionInformationForLoadType:FrameLoadTypeStandard isFormSubmission:YES event:event originalURL:URL];
     WebFormState *formState = nil;
     if (form && values)
-        formState = [[WebFormState alloc] initWithForm:form values:values sourceFrame:client];
+        formState = [[WebFormState alloc] initWithForm:form values:values sourceFrame:[client _bridge]];
 
     if (target != nil) {
         WebFrame *targetFrame = [client findFrameNamed:target];
index 55454aad916bef89551257f87429f71d70f9cd3c..52597e05ef4827bc8c7a1a1c2098c272e5be161d 100644 (file)
@@ -56,6 +56,8 @@
                654B3C3C0A82C47200E1AE3D /* WebSubresourceLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 654B3C320A82C47200E1AE3D /* WebSubresourceLoader.m */; };
                6550B7C7099EFAE90090D781 /* WebArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B7C5099EFAE90090D781 /* WebArchiver.h */; };
                6550B7C8099EFAE90090D781 /* WebArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6550B7C6099EFAE90090D781 /* WebArchiver.m */; };
+               656D8B540ADA4EA400B34CBB /* WebFormState.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D8B520ADA4EA400B34CBB /* WebFormState.h */; };
+               656D8B550ADA4EA400B34CBB /* WebFormState.m in Sources */ = {isa = PBXBuildFile; fileRef = 656D8B530ADA4EA400B34CBB /* WebFormState.m */; };
                658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 658A40950A14853B005E6987 /* WebDataSourceInternal.h */; };
                659044280A9D3B4200E89459 /* WebDocumentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 659044260A9D3B4200E89459 /* WebDocumentLoader.h */; };
                659044290A9D3B4200E89459 /* WebDocumentLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 659044270A9D3B4200E89459 /* WebDocumentLoader.m */; };
                654B3C320A82C47200E1AE3D /* WebSubresourceLoader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebSubresourceLoader.m; sourceTree = "<group>"; };
                6550B7C5099EFAE90090D781 /* WebArchiver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebArchiver.h; sourceTree = "<group>"; };
                6550B7C6099EFAE90090D781 /* WebArchiver.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebArchiver.m; sourceTree = "<group>"; };
+               656D8B520ADA4EA400B34CBB /* WebFormState.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebFormState.h; sourceTree = "<group>"; };
+               656D8B530ADA4EA400B34CBB /* WebFormState.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebFormState.m; sourceTree = "<group>"; };
                6578F5DE045F817400000128 /* WebDownload.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownload.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                6578F5DF045F817400000128 /* WebDownload.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDownload.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                659044270A9D3B4200E89459 /* WebDocumentLoader.m */,
                                6538B1C60A90596D00A07522 /* WebFormDataStream.h */,
                                6538B1C70A90596D00A07522 /* WebFormDataStream.m */,
+                               656D8B520ADA4EA400B34CBB /* WebFormState.h */,
+                               656D8B530ADA4EA400B34CBB /* WebFormState.m */,
                                654B3C290A82C47200E1AE3D /* WebFrameLoader.h */,
                                654B3C2A0A82C47200E1AE3D /* WebFrameLoader.m */,
                                930653930AD6FEF6008E969A /* WebFrameLoaderClient.h */,
                                1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */,
                                65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */,
                                930653940AD6FEF6008E969A /* WebFrameLoaderClient.h in Headers */,
+                               656D8B540ADA4EA400B34CBB /* WebFormState.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                659044290A9D3B4200E89459 /* WebDocumentLoader.m in Sources */,
                                1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
                                65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.m in Sources */,
+                               656D8B550ADA4EA400B34CBB /* WebFormState.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index f35833e672781c72a07a497b727d615b8254987c..06e5a64ee2c5838f568bc30c82b5971e5535bd45 100644 (file)
@@ -1228,45 +1228,6 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
 
 @end
 
-@implementation WebFormState : NSObject
-
-- (id)initWithForm:(DOMElement *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    
-    _form = [form retain];
-    _values = [values copy];
-    _sourceFrame = [sourceFrame retain];
-    return self;
-}
-
-- (void)dealloc
-{
-    [_form release];
-    [_values release];
-    [_sourceFrame release];
-    [super dealloc];
-}
-
-- (DOMElement *)form
-{
-    return _form;
-}
-
-- (NSDictionary *)values
-{
-    return _values;
-}
-
-- (WebFrame *)sourceFrame
-{
-    return _sourceFrame;
-}
-
-@end
-
 @implementation WebFrame
 
 - (id)init
index 2c8f87b826fccc401efe55199afefd31bc01aa5f..708adf6cf6bf61db29f93c9997e41bfd4008f607 100644 (file)
 @class WebFrameBridge;
 @class WebFormState;
 
-// 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.
-@interface WebFormState : NSObject
-{
-    DOMElement *_form;
-    NSDictionary *_values;
-    WebFrame *_sourceFrame;
-}
-- (id)initWithForm:(DOMElement *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame;
-- (DOMElement *)form;
-- (NSDictionary *)values;
-- (WebFrame *)sourceFrame;
-@end
-
 @interface WebFrame (WebInternal)
 
 - (void)_updateBackground;