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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:13:25 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 5694c4dd762e1a80a6f32aacf224110cebb8f657
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 11 06:18:55 2002 +0000

    	- fixed fix for 3124081 -- REGRESSION: partial progress is left in address field after download
    
            Reviewed by Chris.
    
    	Need to move it down one line so the data source is clear before callback.
    
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]):
    	Do the _clearProvisionalDataSource before the locationChangeDone: callback.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2996 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/khtml/ecma/kjs_window.lut.h b/WebCore/khtml/ecma/kjs_window.lut.h
index a2801fb..b8f163b 100644
--- a/WebCore/khtml/ecma/kjs_window.lut.h
+++ b/WebCore/khtml/ecma/kjs_window.lut.h
@@ -22,122 +22,132 @@ const struct HashTable ScreenTable = { 2, 10, ScreenTableEntries, 7 };
 namespace KJS {
 
 const struct HashEntry WindowTableEntries[] = {
+   { "close", Window::Close, DontDelete|Function, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "alert", Window::Alert, DontDelete|Function, 1, 0 },
+   { "outerHeight", Window::OuterHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[92] },
+   { "ondragdrop", Window::Ondragdrop, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "Option", Window::Option, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
-   { "closed", Window::Closed, DontDelete|ReadOnly, 0, &WindowTableEntries[87] },
+   { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 },
+   { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "DOMException", Window::DOMException, DontDelete, 0, &WindowTableEntries[103] },
+   { "closed", Window::Closed, DontDelete|ReadOnly, 0, &WindowTableEntries[96] },
+   { "event", Window::Event, DontDelete|ReadOnly, 0, &WindowTableEntries[108] },
+   { 0, 0, 0, 0, 0 },
    { "onload", Window::Onload, DontDelete, 0, 0 },
    { "frames", Window::Frames, DontDelete|ReadOnly, 0, 0 },
-   { 0, 0, 0, 0, 0 },
-   { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[90] },
-   { "CSSRule", Window::CSSRule, DontDelete, 0, &WindowTableEntries[91] },
-   { "length", Window::Length, DontDelete|ReadOnly, 0, &WindowTableEntries[81] },
-   { "pageYOffset", Window::PageYOffset, DontDelete|ReadOnly, 0, 0 },
-   { "onmouseout", Window::Onmouseout, DontDelete, 0, &WindowTableEntries[111] },
+   { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, &WindowTableEntries[105] },
+   { "clientInformation", Window::ClientInformation, DontDelete|ReadOnly, 0, &WindowTableEntries[94] },
+   { "CSSRule", Window::CSSRule, DontDelete, 0, 0 },
+   { "length", Window::Length, DontDelete|ReadOnly, 0, &WindowTableEntries[91] },
+   { "personalbar", Window::Personalbar, DontDelete|ReadOnly, 0, 0 },
    { "clearInterval", Window::ClearInterval, DontDelete|Function, 1, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
+   { "NodeFilter", Window::NodeFilter, DontDelete, 0, 0 },
+   { "opener", Window::Opener, DontDelete|ReadOnly, 0, 0 },
+   { "parent", Window::Parent, DontDelete|ReadOnly, 0, &WindowTableEntries[113] },
    { 0, 0, 0, 0, 0 },
-   { "opener", Window::Opener, DontDelete|ReadOnly, 0, &WindowTableEntries[82] },
-   { "parent", Window::Parent, DontDelete|ReadOnly, 0, &WindowTableEntries[83] },
-   { "Range", Window::Range, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "name", Window::Name, DontDelete, 0, 0 },
-   { "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, &WindowTableEntries[84] },
+   { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
+   { "scroll", Window::Scroll, DontDelete|Function, 2, &WindowTableEntries[98] },
    { 0, 0, 0, 0, 0 },
-   { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, 0 },
+   { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[112] },
    { "onblur", Window::Onblur, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "onclick", Window::Onclick, DontDelete, 0, &WindowTableEntries[105] },
-   { "onmousedown", Window::Onmousedown, DontDelete, 0, 0 },
+   { "onmove", Window::Onmove, DontDelete, 0, 0 },
+   { "Image", Window::Image, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
+   { "onkeypress", Window::Onkeypress, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "self", Window::Self, DontDelete|ReadOnly, 0, &WindowTableEntries[99] },
-   { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[88] },
-   { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, &WindowTableEntries[106] },
+   { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, &WindowTableEntries[101] },
    { 0, 0, 0, 0, 0 },
-   { "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, 0 },
+   { "onabort", Window::Onabort, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, 0 },
+   { "Range", Window::Range, DontDelete, 0, &WindowTableEntries[93] },
+   { "pageYOffset", Window::PageYOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[97] },
+   { "crypto", Window::Crypto, DontDelete|ReadOnly, 0, &WindowTableEntries[89] },
+   { "prompt", Window::Prompt, DontDelete|Function, 2, 0 },
+   { "resizeTo", Window::ResizeTo, DontDelete|Function, 2, 0 },
+   { "status", Window::Status, DontDelete, 0, &WindowTableEntries[114] },
    { 0, 0, 0, 0, 0 },
-   { "confirm", Window::Confirm, DontDelete|Function, 1, &WindowTableEntries[93] },
-   { "Event", Window::EventCtor, DontDelete, 0, 0 },
-   { "crypto", Window::Crypto, DontDelete|ReadOnly, 0, 0 },
-   { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[92] },
    { 0, 0, 0, 0, 0 },
-   { "status", Window::Status, DontDelete, 0, &WindowTableEntries[80] },
-   { "onchange", Window::Onchange, DontDelete, 0, &WindowTableEntries[101] },
-   { "onabort", Window::Onabort, DontDelete, 0, 0 },
+   { "location", Window::_Location, DontDelete, 0, &WindowTableEntries[95] },
+   { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, &WindowTableEntries[116] },
    { 0, 0, 0, 0, 0 },
-   { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
    { 0, 0, 0, 0, 0 },
-   { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, 0 },
+   { "onselect", Window::Onselect, DontDelete, 0, 0 },
+   { "name", Window::Name, DontDelete, 0, &WindowTableEntries[119] },
+   { "document", Window::Document, DontDelete|ReadOnly, 0, 0 },
+   { "onerror", Window::Onerror, DontDelete, 0, &WindowTableEntries[122] },
    { 0, 0, 0, 0, 0 },
-   { "scrollbars", Window::Scrollbars, DontDelete|ReadOnly, 0, &WindowTableEntries[85] },
    { 0, 0, 0, 0, 0 },
-   { "outerHeight", Window::OuterHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[102] },
-   { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, &WindowTableEntries[107] },
-   { "NodeFilter", Window::NodeFilter, DontDelete, 0, 0 },
-   { "onreset", Window::Onreset, DontDelete, 0, 0 },
-   { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 },
-   { "clientInformation", Window::ClientInformation, DontDelete|ReadOnly, 0, 0 },
-   { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, &WindowTableEntries[95] },
-   { "DOMException", Window::DOMException, DontDelete, 0, 0 },
-   { "alert", Window::Alert, DontDelete|Function, 1, 0 },
-   { "resizeTo", Window::ResizeTo, DontDelete|Function, 2, &WindowTableEntries[96] },
-   { "onerror", Window::Onerror, DontDelete, 0, 0 },
+   { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
+   { "onkeyup", Window::Onkeyup, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "Event", Window::EventCtor, DontDelete, 0, 0 },
+   { "self", Window::Self, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "location", Window::_Location, DontDelete, 0, 0 },
-   { "onkeyup", Window::Onkeyup, DontDelete, 0, 0 },
-   { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, 0 },
-   { "focus", Window::Focus, DontDelete|Function, 0, 0 },
-   { "personalbar", Window::Personalbar, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
-   { "event", Window::Event, DontDelete|ReadOnly, 0, 0 },
-   { "document", Window::Document, DontDelete|ReadOnly, 0, &WindowTableEntries[86] },
-   { "defaultstatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[79] },
+   { "top", Window::Top, DontDelete|ReadOnly, 0, 0 },
+   { "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[90] },
    { "history", Window::_History, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, 0 },
-   { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, 0 },
-   { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[112] },
-   { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, 0 },
-   { "pageXOffset", Window::PageXOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[109] },
-   { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, 0 },
-   { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
-   { "scroll", Window::Scroll, DontDelete|Function, 2, &WindowTableEntries[89] },
-   { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "open", Window::Open, DontDelete|Function, 3, &WindowTableEntries[121] },
+   { 0, 0, 0, 0, 0 },
+   { "onsubmit", Window::Onsubmit, DontDelete, 0, 0 },
+   { "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, &WindowTableEntries[107] },
+   { "defaultstatus", Window::DefaultStatus, DontDelete, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[109] },
+   { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, 0 },
+   { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, 0 },
+   { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[99] },
+   { "pageXOffset", Window::PageXOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[111] },
+   { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[102] },
+   { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[117] },
+   { "scrollbars", Window::Scrollbars, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
+   { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, 0 },
+   { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, 0 },
    { "moveBy", Window::MoveBy, DontDelete|Function, 2, 0 },
-   { "moveTo", Window::MoveTo, DontDelete|Function, 2, 0 },
+   { "moveTo", Window::MoveTo, DontDelete|Function, 2, &WindowTableEntries[115] },
    { "window", Window::_Window, DontDelete|ReadOnly, 0, 0 },
-   { "top", Window::Top, DontDelete|ReadOnly, 0, &WindowTableEntries[98] },
    { "screen", Window::_Screen, DontDelete|ReadOnly, 0, 0 },
-   { "Image", Window::Image, DontDelete|ReadOnly, 0, 0 },
-   { "prompt", Window::Prompt, DontDelete|Function, 2, &WindowTableEntries[94] },
-   { "open", Window::Open, DontDelete|Function, 3, 0 },
-   { "blur", Window::Blur, DontDelete|Function, 0, &WindowTableEntries[97] },
-   { "close", Window::Close, DontDelete|Function, 0, 0 },
+   { "Option", Window::Option, DontDelete|ReadOnly, 0, &WindowTableEntries[106] },
+   { "confirm", Window::Confirm, DontDelete|Function, 1, 0 },
+   { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, 0 },
+   { "focus", Window::Focus, DontDelete|Function, 0, 0 },
+   { "blur", Window::Blur, DontDelete|Function, 0, 0 },
    { "setInterval", Window::SetInterval, DontDelete|Function, 2, 0 },
-   { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[103] },
+   { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[118] },
    { "releaseEvents", Window::ReleaseEvents, DontDelete|Function, 0, 0 },
    { "removeEventListener", Window::RemoveEventListener, DontDelete|Function, 3, 0 },
-   { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
-   { "ondragdrop", Window::Ondragdrop, DontDelete, 0, 0 },
+   { "onchange", Window::Onchange, DontDelete, 0, 0 },
+   { "onclick", Window::Onclick, DontDelete, 0, 0 },
    { "onfocus", Window::Onfocus, DontDelete, 0, 0 },
    { "onkeydown", Window::Onkeydown, DontDelete, 0, 0 },
-   { "onkeypress", Window::Onkeypress, DontDelete, 0, 0 },
-   { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[108] },
+   { "onmousedown", Window::Onmousedown, DontDelete, 0, 0 },
+   { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[120] },
+   { "onmouseout", Window::Onmouseout, DontDelete, 0, 0 },
    { "onmouseover", Window::Onmouseover, DontDelete, 0, 0 },
-   { "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
-   { "onmove", Window::Onmove, DontDelete, 0, 0 },
+   { "onreset", Window::Onreset, DontDelete, 0, 0 },
    { "onresize", Window::Onresize, DontDelete, 0, 0 },
-   { "onselect", Window::Onselect, DontDelete, 0, 0 },
-   { "onsubmit", Window::Onsubmit, DontDelete, 0, 0 },
    { "onunload", Window::Onunload, DontDelete, 0, 0 }
 };
 
-const struct HashTable WindowTable = { 2, 113, WindowTableEntries, 79 };
+const struct HashTable WindowTable = { 2, 123, WindowTableEntries, 89 };
 
 }; // namespace
 
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index c200ab3..13f0a84 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -296,14 +296,6 @@ static bool isTransitional(const QString &spec, int start)
     return false;
 }
 
-#ifdef APPLE_CHANGES
-void HTMLDocumentImpl::clearTimers()
-{
-    view()->unscheduleRelayout();
-    view()->unscheduleRepaint();
-}
-#endif
-
 void HTMLDocumentImpl::close()
 {
     // First fire the onload.
diff --git a/WebCore/khtml/html/html_documentimpl.h b/WebCore/khtml/html/html_documentimpl.h
index 578f1fb..3d0a485 100644
--- a/WebCore/khtml/html/html_documentimpl.h
+++ b/WebCore/khtml/html/html_documentimpl.h
@@ -64,7 +64,6 @@ public:
 #if APPLE_CHANGES
     DOMString policyBaseURL() const { return m_policyBaseURL; }
     void setPolicyBaseURL(const DOMString &s) { m_policyBaseURL = s; }
-    void clearTimers();
 #endif
 
     HTMLElementImpl *body();
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 9c5f014..87feea7 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -951,9 +951,7 @@ void KHTMLPart::clear()
   d->m_redirectLockHistory = true;
   d->m_bHTTPRefresh = false;
   d->m_bClearing = false;
-#if !APPLE_CHANGES
   d->m_frameNameId = 1;
-#endif
   d->m_bFirstData = true;
 
   d->m_bMousePressed = false;
diff --git a/WebCore/khtml/khtmlpart_p.h b/WebCore/khtml/khtmlpart_p.h
index f7b66d5..8d7f949 100644
--- a/WebCore/khtml/khtmlpart_p.h
+++ b/WebCore/khtml/khtmlpart_p.h
@@ -126,9 +126,7 @@ public:
     m_javaContext = 0;
 #endif
     m_cacheId = 0;
-#if !APPLE_CHANGES
     m_frameNameId = 1;
-#endif
 
     m_restored = false;
 
@@ -221,15 +219,7 @@ public:
   bool m_metaRefreshEnabled :1;
   bool m_bPluginsOverride :1;
   bool m_restored :1;
-#if APPLE_CHANGES
-  // Made this static so frame names are globally unique and unsigned
-  // so overflow is handled more gracefully.
-  static unsigned m_frameNameId;
-  bool m_savingPageState:1;
-  bool m_restoringPageState:1;
-#else
   int m_frameNameId;
-#endif
   int m_dcop_counter;
   DCOPObject *m_dcopobject;
 
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index b165c3c..61b273d 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -147,6 +147,11 @@ public:
     
     static void widgetWillReleaseView(NSView *);
     
+    static void setCurrentEvent(NSEvent *event) { _currentEvent = event; }
+    static NSEvent *currentEvent() { return _currentEvent; }
+    
+    void clearTimers();
+    
 private:
     virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
     virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
@@ -173,6 +178,8 @@ private:
     bool _ownsView;
     
     NSView *_mouseDownView;
+    
+    static NSEvent *_currentEvent;
 
     static QPtrList<KWQKHTMLPart> &mutableInstances();
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 8c53db7..b2ac087 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -33,7 +33,6 @@
 #import "khtmlpart_p.h"
 #import "khtmlview.h"
 #import "kjs_window.h"
-#import <kjs/property_map.h>
 
 #import "WebCoreBridge.h"
 #import "WebCoreBridgePrivate.h"
@@ -45,6 +44,8 @@
 
 #import "xml/dom2_eventsimpl.h"
 
+#import <JavaScriptCore/property_map.h>
+
 #undef _KWQ_TIMING
 
 using DOM::DocumentImpl;
@@ -71,7 +72,7 @@ using KJS::Window;
 using KParts::ReadOnlyPart;
 using KParts::URLArgs;
 
-unsigned KHTMLPartPrivate::m_frameNameId = 0;
+NSEvent *KWQKHTMLPart::_currentEvent = nil;
 
 void KHTMLPart::completed()
 {
@@ -178,13 +179,13 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
 {
     if (!args.doPost()) {
         [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload
-            triggeringEvent:[NSApp currentEvent] isFormSubmission:YES];
+            triggeringEvent:_currentEvent isFormSubmission:YES];
     } else {
         QString contentType = args.contentType();
         ASSERT(contentType.startsWith("Content-Type: "));
         [bridgeForFrameName(args.frameName) postWithURL:url.url().getNSString()
             data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
-            contentType:contentType.mid(14).getNSString() triggeringEvent:[NSApp currentEvent]];
+            contentType:contentType.mid(14).getNSString() triggeringEvent:_currentEvent];
     }
 }
 
@@ -209,7 +210,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:[NSApp currentEvent] isFormSubmission:NO];
+        triggeringEvent:_currentEvent isFormSubmission:NO];
 }
 
 class KWQPluginPart : public ReadOnlyPart
@@ -311,8 +312,13 @@ void KWQKHTMLPart::redirectionTimerStartedOrStopped()
 void KWQKHTMLPart::paint(QPainter *p, const QRect &rect)
 {
 #ifndef NDEBUG
-    [[NSColor redColor] set];
-    [NSBezierPath fillRect:[view()->getView() visibleRect]];
+    NSView *v = view()->getView();
+    if (v) {
+        [v lockFocus];
+        [[NSColor redColor] set];
+        NSRectFill(rect);
+        [v unlockFocus];
+    }
 #endif
 
     if (renderer()) {
@@ -661,17 +667,7 @@ void KWQKHTMLPart::addMetaData(const QString &key, const QString &value)
 bool KWQKHTMLPart::keyEvent(NSEvent *event)
 {
     ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
-
-    const char *characters = [[event characters] lossyCString];
-    int ascii = (characters != nil && strlen(characters) == 1) ? characters[0] : 0;
-
-
-    QKeyEvent qEvent([event type] == NSKeyDown ? QEvent::KeyPress : QEvent::KeyRelease,
-		     [event keyCode],
-		     ascii,
-		     [_bridge stateForEvent:event],
-		     QString::fromNSString([event characters]),
-		     [event isARepeat]);
+    ASSERT(!_currentEvent);
 
     // Check for cases where we are too early for events -- possible unmatched key up
     // from pressing return in the location bar.
@@ -683,6 +679,18 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
     if (!node) {
 	return false;
     }
+    
+    _currentEvent = event;
+
+    const char *characters = [[event characters] lossyCString];
+    int ascii = (characters != nil && strlen(characters) == 1) ? characters[0] : 0;
+
+    QKeyEvent qEvent([event type] == NSKeyDown ? QEvent::KeyPress : QEvent::KeyRelease,
+		     [event keyCode],
+		     ascii,
+		     [_bridge stateForEvent:event],
+		     QString::fromNSString([event characters]),
+		     [event isARepeat]);
 
     bool result = node->dispatchKeyEvent(&qEvent);
 
@@ -698,6 +706,8 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 	result = result && node->dispatchKeyEvent(&qEvent);
     }
 
+    _currentEvent = nil;
+
     return result;
 }
 
@@ -743,24 +753,24 @@ bool KWQKHTMLPart::handleMouseDownEventForWidget(khtml::MouseEvent *event)
     
     // Figure out which view to send the event to.
     RenderObject *target = event->innerNode().handle()->renderer();
-    if (!target->isWidget()) {
+    if (!target || !target->isWidget()) {
         return false;
     }
-    NSView *outerView = static_cast<RenderWidget *>(target)->widget()->getOuterView();
-    ASSERT(outerView);
-    ASSERT([outerView superview]);
-    NSView *topView = outerView;
+    NSView *nodeView = static_cast<RenderWidget *>(target)->widget()->getView();
+    ASSERT(nodeView);
+    ASSERT([nodeView superview]);
+    NSView *topView = nodeView;
     NSView *superview;
     while ((superview = [topView superview])) {
         topView = superview;
     }
-    NSView *view = [outerView hitTest:[[outerView superview] convertPoint:[[NSApp currentEvent] locationInWindow] fromView:topView]];
+    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[_currentEvent locationInWindow] fromView:topView]];
     if (view == nil) {
         ERROR("KHTML says we hit a RenderWidget, but AppKit doesn't agree we hit the corresponding NSView");
         return false;
     }
     
-    [view mouseDown:[NSApp currentEvent]];
+    [view mouseDown:_currentEvent];
     
     // Remember which view we sent the event to, so we can direct the release event properly.
     _mouseDownView = view;
@@ -775,7 +785,7 @@ void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
         return;
     }
     
-    [_mouseDownView mouseUp:[NSApp currentEvent]];
+    [_mouseDownView mouseUp:_currentEvent];
     _mouseDownView = nil;
 }
 
@@ -790,3 +800,11 @@ void KWQKHTMLPart::widgetWillReleaseView(NSView *view)
         }
     }
 }
+
+void KWQKHTMLPart::clearTimers()
+{
+    if (view()) {
+        view()->unscheduleRelayout();
+        view()->unscheduleRepaint();
+    }
+}
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 1706d7e..f389267 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -72,7 +72,7 @@ QWidget::QWidget(NSView *view)
 
 QWidget::~QWidget() 
 {
-    KWQKHTMLPart::widgetWillReleaseView(getOuterView());
+    KWQKHTMLPart::widgetWillReleaseView(data->view);
     [data->view release];
     delete data;
 }
@@ -164,7 +164,7 @@ int QWidget::baselinePosition() const
 QWidget *QWidget::topLevelWidget() const 
 {
     NSWindow *window = nil;
-    NSView *view = getView();
+    NSView *view = data->view;
 
     window = [view window];
     while (window == nil && view != nil) { 
@@ -197,7 +197,7 @@ void QWidget::setFocus()
         renderWidget->view()->addChild(this, x, y);
     }
     
-    [[getView() window] makeFirstResponder:getView()];
+    [[data->view window] makeFirstResponder:data->view];
 }
 
 void QWidget::clearFocus()
@@ -210,7 +210,7 @@ QWidget::FocusPolicy QWidget::focusPolicy() const
     // This is the AppKit rule for what can be tabbed to.
     // An NSControl that accepts first responder, and has an editable, enabled cell.
     
-    NSView *view = getView();
+    NSView *view = data->view;
     if (![view acceptsFirstResponder] || ![view isKindOfClass:[NSControl class]]) {
         return NoFocus;
     }
@@ -370,22 +370,22 @@ NSView *QWidget::getOuterView() const
 
 void QWidget::lockDrawingFocus()
 {
-    [getView() lockFocus];
+    [data->view lockFocus];
 }
 
 void QWidget::unlockDrawingFocus()
 {
-    [getView() unlockFocus];
+    [data->view unlockFocus];
 }
 
 void QWidget::disableFlushDrawing()
 {
-    [[getView() window] disableFlushWindow];
+    [[data->view window] disableFlushWindow];
 }
 
 void QWidget::enableFlushDrawing()
 {
-    NSWindow *window = [getView() window];
+    NSWindow *window = [data->view window];
     [window enableFlushWindow];
     [window flushWindow];
 }
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 0eebc1b..90cf466 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -52,16 +52,19 @@
 
 #import "WebCoreDOMPrivate.h"
 
-#import <kjs/property_map.h>
+#import <JavaScriptCore/property_map.h>
 
 using KParts::URLArgs;
 
 using DOM::DocumentImpl;
+using DOM::Node;
+using DOM::NodeImpl;
 
 using khtml::parseURL;
 using khtml::RenderImage;
 using khtml::RenderObject;
 using khtml::RenderPart;
+using khtml::RenderStyle;
 
 using KJS::SavedProperties;
 
@@ -79,18 +82,18 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
 
 @interface KWQPageState : NSObject
 {
-    DOM::DocumentImpl *document;
+    DocumentImpl *document;
     KURL *URL;
-    KJS::SavedProperties *windowProperties;
-    KJS::SavedProperties *locationProperties;
-    khtml::RenderObject *docRenderer; 
+    SavedProperties *windowProperties;
+    SavedProperties *locationProperties;
+    RenderObject *docRenderer; 
 }
-- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp;
-- (DOM::DocumentImpl *)document;
+- initWithDocument: (DocumentImpl *)doc URL: (KURL)u windowProperties: (SavedProperties *)wp locationProperties: (SavedProperties *)lp;
+- (DocumentImpl *)document;
 - (KURL *)URL;
-- (KJS::SavedProperties *)windowProperties;
-- (KJS::SavedProperties *)locationProperties;
-- (khtml::RenderObject *)renderer;
+- (SavedProperties *)windowProperties;
+- (SavedProperties *)locationProperties;
+- (RenderObject *)renderer;
 @end
 
 @implementation WebCoreBridge
@@ -228,20 +231,23 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
 - (BOOL)saveDocumentToPageCache
 {
     DocumentImpl *doc = _part->xmlDocImpl();
-    if (doc != 0){
-        KJS::SavedProperties *windowProperties = new KJS::SavedProperties();
-        KJS::SavedProperties *locationProperties = new KJS::SavedProperties();
-
-        _part->saveWindowProperties(windowProperties);
-        _part->saveLocationProperties(locationProperties);
-        if (doc->isHTMLDocument()) {
-            DOM::HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>(doc);
-            hdoc->clearTimers();
-        }
-        KWQPageState *pageState = [[[KWQPageState alloc] initWithDocument: doc URL:_part->m_url windowProperties:windowProperties locationProperties:locationProperties] autorelease];
-        return [self saveDocumentToPageCache: pageState];
+    if (!doc) {
+        return NO;
     }
-    return false;
+    
+    _part->clearTimers();
+
+    SavedProperties *windowProperties = new SavedProperties;
+    _part->saveWindowProperties(windowProperties);
+
+    SavedProperties *locationProperties = new SavedProperties;
+    _part->saveLocationProperties(locationProperties);
+    
+    KWQPageState *pageState = [[[KWQPageState alloc] initWithDocument:doc
+                                                                  URL:_part->m_url
+                                                     windowProperties:windowProperties
+                                                   locationProperties:locationProperties] autorelease];
+    return [self saveDocumentToPageCache:pageState];
 }
 
 - (BOOL)canCachePage
@@ -426,10 +432,14 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
 
 - (void)mouseUp:(NSEvent *)event
 {
+    ASSERT(!KWQKHTMLPart::currentEvent());
+
     if (!_part->view()) {
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+
     NSPoint p = [event locationInWindow];
 
     int button, state;
@@ -459,19 +469,24 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     if (clickCount > 0 && clickCount % 2 == 0) {
         QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, QPoint(p), button, state, clickCount);
         _part->view()->viewportMouseDoubleClickEvent(&doubleClickEvent);
-    }
-    else {
+    } else {
         QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(p), button, state, clickCount);
         _part->view()->viewportMouseReleaseEvent(&releaseEvent);
     }
+    
+    KWQKHTMLPart::setCurrentEvent(nil);
 }
 
 - (void)mouseDown:(NSEvent *)event
 {
+    ASSERT(!KWQKHTMLPart::currentEvent());
+
     if (!_part->view()) {
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+
     NSPoint p = [event locationInWindow];
     
     int button, state;     
@@ -493,30 +508,44 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint(p), button, state, [event clickCount]);
     _part->view()->viewportMousePressEvent(&kEvent);
+    
+    KWQKHTMLPart::setCurrentEvent(nil);
 }
 
 - (void)mouseMoved:(NSEvent *)event
 {
+    ASSERT(!KWQKHTMLPart::currentEvent());
+
     if (!_part->view()) {
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+    
     NSPoint p = [event locationInWindow];
     
     QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), 0, [self stateForEvent:event]);
     _part->view()->viewportMouseMoveEvent(&kEvent);
+    
+    KWQKHTMLPart::setCurrentEvent(nil);
 }
 
 - (void)mouseDragged:(NSEvent *)event
 {
+    ASSERT(!KWQKHTMLPart::currentEvent());
+    
     if (!_part->view()) {
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+
     NSPoint p = [event locationInWindow];
     
     QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), Qt::LeftButton, Qt::LeftButton);
     _part->view()->viewportMouseMoveEvent(&kEvent);
+    
+    KWQKHTMLPart::setCurrentEvent(nil);
 }
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point
@@ -669,22 +698,22 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     _part->xmlDocImpl()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
 }
 
-static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset)
+static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffset, NodeImpl *endNode, int endOffset)
 {
     bool hasNewLine = true;
     bool hasParagraphBreak = true;
-    DOM::Node n = _startNode;
-    khtml::RenderObject *renderer;
+    Node n = _startNode;
+    RenderObject *renderer;
     NSFont *font;
     NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
     NSAttributedString *partialString;
 
     while(!n.isNull()) {
         renderer = n.handle()->renderer();
-        if (n.nodeType() == DOM::Node::TEXT_NODE && renderer) {
+        if (n.nodeType() == Node::TEXT_NODE && renderer) {
             QString text;
             QString str = n.nodeValue().string();
-khtml::RenderStyle *style = 0;
+            RenderStyle *style = 0;
 
             font = nil;
             style = renderer->style();
@@ -772,7 +801,7 @@ khtml::RenderStyle *style = 0;
         if(n == endNode)
             break;
 
-DOM::Node next = n.firstChild();
+        Node next = n.firstChild();
         if(next.isNull())
             next = n.nextSibling();
 
@@ -916,7 +945,7 @@ DOM::Node next = n.firstChild();
 @end
 
 @implementation KWQPageState
-- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp
+- initWithDocument:(DocumentImpl *)doc URL:(KURL)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp
 {
     [super init];
     doc->ref();
@@ -933,10 +962,8 @@ DOM::Node next = n.firstChild();
 {
     KHTMLView *view = document->view();
 
-    if (document->isHTMLDocument()) {
-        DOM::HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>(document);
-        hdoc->clearTimers();
-    }
+    KWQ(view->part())->clearTimers();
+
     document->setInPageCache(NO);
     document->detach();
     document->deref();
@@ -952,7 +979,7 @@ DOM::Node next = n.firstChild();
     [super dealloc];
 }
 
-- (DOM::DocumentImpl *)document
+- (DocumentImpl *)document
 {
     return document;
 }
@@ -962,21 +989,19 @@ DOM::Node next = n.firstChild();
     return URL;
 }
 
-- (KJS::SavedProperties *)windowProperties
+- (SavedProperties *)windowProperties
 {
     return windowProperties;
 }
 
-- (KJS::SavedProperties *)locationProperties
+- (SavedProperties *)locationProperties
 {
     return locationProperties;
 }
 
-- (khtml::RenderObject *)renderer
+- (RenderObject *)renderer
 {
     return docRenderer;
 }
 
-
 @end
-
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3ce88f3..bace13f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2002-12-10  Darin Adler  <darin at apple.com>
+
+	- fixed fix for 3124081 -- REGRESSION: partial progress is left in address field after download
+
+        Reviewed by Chris.
+
+	Need to move it down one line so the data source is clear before callback.
+
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]):
+	Do the _clearProvisionalDataSource before the locationChangeDone: callback.
+
 2002-12-10  John Sullivan  <sullivan at apple.com>
 
 	Fixed more "Alexander"s that were lurking in places I forgot 
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index 83cdeaa..0e83832 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -106,17 +106,18 @@
     // if we remove the data source from the frame, we can't get back to the frame any more.
     [self receivedError:interruptError complete:!keepLoading];
 
+    [[dataSource webFrame] _clearProvisionalDataSource];
+    
     // Deliver the error to the location change delegate.
     // We have to do this explicitly because since we are still loading, WebFrame
-    // won't do it for us. There's probably a better way to do this, but this should
-    // do for now.
+    // won't do it for us. Also, we have to do this after the provisional data source
+    // is cleared so the delegate will get false if they ask the frame if it's loading.
+    // There's probably a better way to do this, but this should do for now.
     if (keepLoading) {
         [[[dataSource controller] locationChangeDelegate]
             locationChangeDone:interruptError forDataSource:dataSource];
     }
 	
-    [[dataSource webFrame] _clearProvisionalDataSource];
-    
     [self notifyDelegatesOfInterruptionByPolicyChange];
 }
 
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index 83cdeaa..0e83832 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -106,17 +106,18 @@
     // if we remove the data source from the frame, we can't get back to the frame any more.
     [self receivedError:interruptError complete:!keepLoading];
 
+    [[dataSource webFrame] _clearProvisionalDataSource];
+    
     // Deliver the error to the location change delegate.
     // We have to do this explicitly because since we are still loading, WebFrame
-    // won't do it for us. There's probably a better way to do this, but this should
-    // do for now.
+    // won't do it for us. Also, we have to do this after the provisional data source
+    // is cleared so the delegate will get false if they ask the frame if it's loading.
+    // There's probably a better way to do this, but this should do for now.
     if (keepLoading) {
         [[[dataSource controller] locationChangeDelegate]
             locationChangeDone:interruptError forDataSource:dataSource];
     }
 	
-    [[dataSource webFrame] _clearProvisionalDataSource];
-    
     [self notifyDelegatesOfInterruptionByPolicyChange];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list