Reviewed by John.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Aug 2004 21:47:25 +0000 (21:47 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Aug 2004 21:47:25 +0000 (21:47 +0000)
<rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website

Because we will stop parsing when there is a pending redirection,
avoid setting one if no navigation would actually take place
because the number of steps is out of range.

        * khtml/khtml_part.cpp:
        (KHTMLPart::scheduleHistoryNavigation):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::canGoBackOrForward):
        * kwq/KWQKPartsBrowserInterface.h:
        * kwq/WebCoreBridge.h:

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtml_part.cpp
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQKPartsBrowserInterface.h
WebCore/kwq/WebCoreBridge.h

index e5ed944..b298eae 100644 (file)
@@ -1,5 +1,23 @@
 2004-08-27  Maciej Stachowiak  <mjs@apple.com>
 
+        Reviewed by John.
+
+       <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website
+
+       Because we will stop parsing when there is a pending redirection,
+       avoid setting one if no navigation would actually take place
+       because the number of steps is out of range.
+       
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::scheduleHistoryNavigation):
+        * kwq/KWQKHTMLPart.h:
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::canGoBackOrForward):
+        * kwq/KWQKPartsBrowserInterface.h:
+        * kwq/WebCoreBridge.h:
+
+2004-08-27  Maciej Stachowiak  <mjs@apple.com>
+
         Reviewed by Chris.
 
        - fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
index 6653200..6fa13fa 100644 (file)
@@ -1990,6 +1990,13 @@ bool KHTMLPart::isImmediateRedirectPending() const
 
 void KHTMLPart::scheduleHistoryNavigation( int steps )
 {
+#if APPLE_CHANGES
+    // navigation will always be allowed in the 0 steps case, which is OK because
+    // that's supposed to force a reload.
+    if (!KWQ(this)->canGoBackOrForward(steps))
+        return;
+#endif
+
     d->m_scheduledRedirection = historyNavigationScheduled;
     d->m_delayRedirect = 0;
     d->m_redirectURL = QString::null;
index bc5b5e5..6858bde 100644 (file)
@@ -329,6 +329,8 @@ public:
 
     DOM::Range markedRange() const;
     void setMarkedRange(const DOM::Range &);
+
+    bool canGoBackOrForward(int distance);
 private:
     virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
     virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
index ac538b4..6a31c0e 100644 (file)
@@ -3807,3 +3807,8 @@ void KWQKHTMLPart::setMarkedRange(const DOM::Range &range)
        m_markedRange.startContainer().handle()->renderer()->repaint();
     }
 }
+
+bool KWQKHTMLPart::canGoBackOrForward(int distance)
+{
+    return [_bridge canGoBackOrForward:distance];
+}
index 4b5ed30..1c59056 100644 (file)
@@ -39,6 +39,7 @@ public:
     
     QVariant property(const char *name) const;
     void callMethod(const char *name, const QVariant &argument);
+    
 
 private:
     KWQKHTMLPart *_part;
index a839f84..65743ff 100644 (file)
@@ -457,6 +457,7 @@ typedef enum {
 
 - (int)historyLength;
 - (void)goBackOrForward:(int)distance;
+- (BOOL)canGoBackOrForward:(int)distance;
 
 - (void)controlTextDidBeginEditing:(NSNotification *)obj;
 - (void)controlTextDidEndEditing:(NSNotification *)obj;