Reviewed by Darin.
authorkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 00:49:16 +0000 (00:49 +0000)
committerkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 00:49:16 +0000 (00:49 +0000)
        - removed the guards for the "multiple forms submission" issue, which may not be
          an issue anymore and the guards prevent perfectly legitimate websites from
          working correctly.

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::setView):
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject accessibilityPerformAction:]):
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::keyPress):
        * config.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::submitForm):
        * loader/FrameLoader.h:
        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::receivedMainResourceError):
        * loader/qt/FrameLoaderQt.cpp:
        (WebCore::FrameLoader::submitForm):
        * page/Frame.cpp:
        (WebCore::Frame::setView):
        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::keyEvent):
        (WebCore::EventHandler::mouseDown):
        * platform/qt/FrameQt.cpp:
        (WebCore::FrameQt::keyEvent):

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

WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/win/FrameWin.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/mac/FrameLoaderMac.mm
WebCore/loader/qt/FrameLoaderQt.cpp
WebCore/page/Frame.cpp
WebCore/page/mac/EventHandlerMac.mm
WebCore/platform/qt/FrameQt.cpp

index 10e85390985435dbbb8c22379c47749a9915c8a7..c36b2b2c31b80c76be15b19b399e55447b140206 100644 (file)
@@ -1,3 +1,33 @@
+2006-12-04  Kevin McCullough  <KMcCullough@apple.com>
+
+        Reviewed by Darin.
+
+        - removed the guards for the "multiple forms submission" issue, which may not be
+          an issue anymore and the guards prevent perfectly legitimate websites from
+          working correctly.
+
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::setView):
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject accessibilityPerformAction:]):
+        * bridge/win/FrameWin.cpp:
+        (WebCore::FrameWin::keyPress):
+        * config.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::submitForm):
+        * loader/FrameLoader.h:
+        * loader/mac/FrameLoaderMac.mm:
+        (WebCore::FrameLoader::receivedMainResourceError):
+        * loader/qt/FrameLoaderQt.cpp:
+        (WebCore::FrameLoader::submitForm):
+        * page/Frame.cpp:
+        (WebCore::Frame::setView):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::keyEvent):
+        (WebCore::EventHandler::mouseDown):
+        * platform/qt/FrameQt.cpp:
+        (WebCore::FrameQt::keyEvent):
+
 2006-12-02  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Darin Adler.
index 00ddbf9eeecb95dda99a40f5151a29eaee423f21..8ffa5c9355cade9a8a25a9d1ef7b9979a6785737 100644 (file)
@@ -355,10 +355,12 @@ void FrameMac::setView(FrameView *view)
 {
     Frame::setView(view);
     
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     // Only one form submission is allowed per view of a part.
     // Since this part may be getting reused as a result of being
     // pulled from the back/forward cache, reset this flag.
     loader()->resetMultipleFormSubmissionProtection();
+#endif
 }
 
 void FrameMac::setStatusBarText(const String& status)
index 7006a5983e74c1b263ca3ac748d9aa67ff791360..e952a542dca3d4065f974f5c72c7a7050d6bed3a 100644 (file)
@@ -885,10 +885,10 @@ static IntRect boundingBoxRect(RenderObject* obj)
         Element* actionElement = [self actionElement];
         if (!actionElement)
             return;
-
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
         if (Frame* f = actionElement->document()->frame())
             f->loader()->resetMultipleFormSubmissionProtection();
-
+#endif
         actionElement->accessKeyAction(true);
     }
 }
index 9ef90506403e51a79e18478881dd658c1dd7bd67..e11e4ab77b781afbed45fe51ab604b0b78f8ef45 100644 (file)
@@ -103,8 +103,10 @@ bool FrameWin::keyPress(const PlatformKeyboardEvent& keyEvent)
             return false;
     }
 
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     if (!keyEvent.isKeyUp())
         loader()->resetMultipleFormSubmissionProtection();
+#endif
 
     result = !EventTargetNodeCast(node)->dispatchKeyEvent(keyEvent);
 
index 29ad98f4fc99ad86a8b87a7837a22139e69cf33e..c3cbae5f06c22f158607ed4b5c3fbb07bd0c49e3 100644 (file)
@@ -1418,6 +1418,7 @@ bool FrameLoader::userGestureHint()
     return true; // If JavaScript is disabled, a user gesture must have initiated the navigation
 }
 
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
 void FrameLoader::didNotOpenURL(const KURL& URL)
 {
     if (m_submittedFormURL == URL)
@@ -1428,6 +1429,7 @@ void FrameLoader::resetMultipleFormSubmissionProtection()
 {
     m_submittedFormURL = KURL();
 }
+#endif
 
 void FrameLoader::setEncoding(const String& name, bool userChosen)
 {
@@ -2171,6 +2173,7 @@ FrameLoaderClient* FrameLoader::client() const
 #if PLATFORM(MAC)
 void FrameLoader::submitForm(const FrameLoadRequest& request, Event* event)
 {
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     // FIXME: We'd like to remove this altogether and fix the multiple form submission issue another way.
     // We do not want to submit more than one form from the same page,
     // nor do we want to submit a single form more than once.
@@ -2187,6 +2190,7 @@ void FrameLoader::submitForm(const FrameLoadRequest& request, Event* event)
             return;
         m_submittedFormURL = request.resourceRequest().url();
     }
+#endif
 
     // FIXME: Why do we always pass true for userGesture?
     load(request, true, event, m_formAboutToBeSubmitted.get(), m_formValuesAboutToBeSubmitted);
index 301d7e29191603e91e05dcfe04ce8c7c0885aad8..4dfabeef21af1c03ab1a6c47c37daf617171c014 100644 (file)
@@ -419,8 +419,10 @@ namespace WebCore {
 
         bool userGestureHint();
 
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
         void resetMultipleFormSubmissionProtection();
         void didNotOpenURL(const KURL&);
+#endif
 
         void addData(const char* bytes, int length);
 
@@ -636,7 +638,9 @@ namespace WebCore {
 
         RefPtr<HTMLFormElement> m_formAboutToBeSubmitted;
         HashMap<String, String> m_formValuesAboutToBeSubmitted;
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
         KURL m_submittedFormURL;
+#endif
     
         Timer<FrameLoader> m_redirectionTimer;
 
index 1b21d904e516a1c2491e65250740c8f1f8489ddc..6ff568d9db583726f92f5bbd4d3b219f28aebb53 100644 (file)
@@ -402,9 +402,10 @@ void FrameLoader::receivedMainResourceError(NSError *error, bool isComplete)
     }
     
     if (m_state == FrameStateProvisional) {
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
         NSURL *failedURL = [m_provisionalDocumentLoader->originalRequestCopy() URL];
         didNotOpenURL(failedURL);
-
+#endif
         // We might have made a page cache item, but now we're bailing out due to an error before we ever
         // transitioned to the new page (before WebFrameState == commit).  The goal here is to restore any state
         // so that the existing view (that wenever got far enough to replace) can continue being used.
index ca85a712a663ddb6e6ef9e263d6143e78e55b38a..f809f36987b16feb070f338357331da894650284 100644 (file)
@@ -76,6 +76,7 @@ namespace WebCore {
 
 void FrameLoader::submitForm(const FrameLoadRequest& frameLoadRequest, Event*)
 {
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     // FIXME: We'd like to remove this altogether and fix the multiple form submission issue another way.
     // We do not want to submit more than one form from the same page,
     // nor do we want to submit a single form more than once.
@@ -92,6 +93,7 @@ void FrameLoader::submitForm(const FrameLoadRequest& frameLoadRequest, Event*)
             return;
         m_submittedFormURL = frameLoadRequest.resourceRequest().url();
     }
+#endif
 
     RefPtr<FormData> formData = frameLoadRequest.resourceRequest().httpBody();
     if (formData && !formData->isEmpty() && QtFrame(m_frame)->client())
index 6983f31a5c112ea14e396a8e3fb1abf6ea788202..a63b54346e20204bde1de6c2e68f23c0fc481feb 100644 (file)
@@ -241,6 +241,13 @@ void Frame::setView(FrameView* view)
         d->m_doc->detach();
 
     d->m_view = view;
+
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
+    // Only one form submission is allowed per view of a part.
+    // Since this part may be getting reused as a result of being
+    // pulled from the back/forward cache, reset this flag.
+    loader()->resetMultipleFormSubmissionProtection();
+#endif
 }
 
 bool Frame::javaScriptEnabled() const
index 16abc901f2ce51f1554d100ffa571754e885d067..d713bfc9b1be3752099791ccc21481a0153004ba 100644 (file)
@@ -306,9 +306,10 @@ bool EventHandler::keyEvent(NSEvent *event)
         if (!node)
             return false;
     }
-
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     if ([event type] == NSKeyDown)
         m_frame->loader()->resetMultipleFormSubmissionProtection();
+#endif
 
     NSEvent *oldCurrentEvent = currentEvent;
     currentEvent = HardRetain(event);
@@ -798,9 +799,9 @@ void EventHandler::mouseDown(NSEvent *event)
         return;
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     m_frame->loader()->resetMultipleFormSubmissionProtection();
-
+#endif
     m_mouseDownView = nil;
     dragState().m_dragSrc = 0;
     
index 24ed2561c81626baf32854de32004ae6fb4041c4..b2be819138b25e6db0f61fef7dc56d15d00046a3 100644 (file)
@@ -434,8 +434,10 @@ bool FrameQt::keyEvent(const PlatformKeyboardEvent& keyEvent)
             return false;
     }
 
+#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
     if (!keyEvent.isKeyUp())
         loader()->resetMultipleFormSubmissionProtection();
+#endif
 
     result = !EventTargetNodeCast(node)->dispatchKeyEvent(keyEvent);