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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:26:04 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 339ec9b4bee2c5e65184fc46f3d579e4f85f20d4
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 22 01:59:16 2002 +0000

    WebCore:
    
    	Fix a recent regression that made JavaScript window closing
    	crash. Window closing was counting on delayed dealloc/destruction
    	of things associated with the window, but now that we have made
    	deallocs more synchronous, we need to add an explicit delay in
    	this case.
    
    	Also, change some fprintf diagnostics of things that should never
    	happen into assertions, since I actually ran into one.
    
            * kwq/KWQKHTMLPartImpl.h:
            * kwq/KWQKHTMLPartImpl.mm:
            (KWQKHTMLPartImpl::slotData): Change fprintf diagnostic to assertion,
    	remove comment that the diagnostic should be removed.
            (KWQKHTMLPartImpl::end): Change fprintf diagnostic to assertion,
    	remove comment that the diagnostic should be removed.
            (KWQKHTMLPartImpl::scheduleClose): Renamed from close, changed to schedule
    	window closing from the run loop rather than doing it immediately.
            * khtml/ecma/kjs_window.cpp:
            (Window::scheduleClose): Adjusted for above rename.
    
    WebKit:
    
            Fix a regression in my recent refactoring that broke JavaScript
    	window opening, by doing some trickery to make a frame's initial
    	dummy data source committed.
    
            * WebView.subproj/WebFrame.m:
            (-[WebFrame initWithName:webView:provisionalDataSource:controller:]):
    	Create dummy data source as committed, not provisional.
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _transitionToCommitted]): Allow the documentView to be nil
    	if there is no webView either; this is temporarily needed to handle
    	the special initial dummy data source, which will be going away soon.
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _receivedData:]): Add temporary special case to
    	avoid sending empty NSData to the representation, to avoid
    	triggering WebCore assertions.
    	* WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge openNewWindowWithURL:]): Get the committed data
    	source, not the provisional one.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 894f06e..b1a7d4a 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,25 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+	Fix a recent regression that made JavaScript window closing
+	crash. Window closing was counting on delayed dealloc/destruction
+	of things associated with the window, but now that we have made
+	deallocs more synchronous, we need to add an explicit delay in
+	this case.
+
+	Also, change some fprintf diagnostics of things that should never
+	happen into assertions, since I actually ran into one.
+	
+        * kwq/KWQKHTMLPartImpl.h:
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::slotData): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::end): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::scheduleClose): Renamed from close, changed to schedule
+	window closing from the run loop rather than doing it immediately.
+        * khtml/ecma/kjs_window.cpp:
+        (Window::scheduleClose): Adjusted for above rename.
+
 2002-07-21  David Hyatt  <hyatt at apple.com>
 
         * khtml/html/html_headimpl.cpp:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 894f06e..b1a7d4a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,25 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+	Fix a recent regression that made JavaScript window closing
+	crash. Window closing was counting on delayed dealloc/destruction
+	of things associated with the window, but now that we have made
+	deallocs more synchronous, we need to add an explicit delay in
+	this case.
+
+	Also, change some fprintf diagnostics of things that should never
+	happen into assertions, since I actually ran into one.
+	
+        * kwq/KWQKHTMLPartImpl.h:
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::slotData): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::end): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::scheduleClose): Renamed from close, changed to schedule
+	window closing from the run loop rather than doing it immediately.
+        * khtml/ecma/kjs_window.cpp:
+        (Window::scheduleClose): Adjusted for above rename.
+
 2002-07-21  David Hyatt  <hyatt at apple.com>
 
         * khtml/html/html_headimpl.cpp:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 894f06e..b1a7d4a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,25 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+	Fix a recent regression that made JavaScript window closing
+	crash. Window closing was counting on delayed dealloc/destruction
+	of things associated with the window, but now that we have made
+	deallocs more synchronous, we need to add an explicit delay in
+	this case.
+
+	Also, change some fprintf diagnostics of things that should never
+	happen into assertions, since I actually ran into one.
+	
+        * kwq/KWQKHTMLPartImpl.h:
+        * kwq/KWQKHTMLPartImpl.mm:
+        (KWQKHTMLPartImpl::slotData): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::end): Change fprintf diagnostic to assertion,
+	remove comment that the diagnostic should be removed.
+        (KWQKHTMLPartImpl::scheduleClose): Renamed from close, changed to schedule
+	window closing from the run loop rather than doing it immediately.
+        * khtml/ecma/kjs_window.cpp:
+        (Window::scheduleClose): Adjusted for above rename.
+
 2002-07-21  David Hyatt  <hyatt at apple.com>
 
         * khtml/html/html_headimpl.cpp:
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index f4182b3..d0a2a16 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -850,7 +850,7 @@ void Window::scheduleClose()
   kdDebug(6070) << "Window::scheduleClose window.close() " << m_part << endl;
   Q_ASSERT(winq);
 #ifdef APPLE_CHANGES
-  m_part->impl->close();
+  m_part->impl->scheduleClose();
 #else
   QTimer::singleShot( 0, winq, SLOT( timeoutClose() ) );
 #endif
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index d87c09b..f7677a4 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -77,7 +77,7 @@ public:
     bool openedByJS();
     void setOpenedByJS(bool _openedByJS);
 
-    void close();
+    void scheduleClose();
 
     void unfocusWindow();
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 25f75c7..4e75302 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -118,12 +118,7 @@ void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int lengt
         part->setEncoding(enc, true);
     }
     
-    // FIXME [rjw]:  Remove this log eventually.  Should never happen.  For debugging
-    // purposes only.
-    if (d->m_doc == 0){
-        fprintf (stderr, "ERROR:  KHTMLPart::slotData m_doc == 0 IGNORING DATA, url = %s\n", part->m_url.url().latin1());
-        return;
-    }
+    KWQ_ASSERT(d->m_doc != NULL);
 
     part->write(bytes, length);
 }
@@ -300,12 +295,7 @@ void KWQKHTMLPartImpl::write( const char *str, int len )
 // FIXME: Need to remerge this with code in khtml_part.cpp?
 void KWQKHTMLPartImpl::end()
 {
-    // FIXME [rjw]:  Remove this log eventually.  Should never happen.  For debugging
-    // purposes only.
-    if (d->m_doc == 0){
-        fprintf (stderr, "ERROR:  KHTMLPart::end  m_doc == 0\n");
-        return;
-    }
+    KWQ_ASSERT(d->m_doc != NULL);
 
     d->m_doc->setParsing(false);
 
@@ -652,9 +642,9 @@ void KWQKHTMLPartImpl::setOpenedByJS(bool _openedByJS)
     [bridge setOpenedByScript:_openedByJS];
 }
 
-void KWQKHTMLPartImpl::close()
+void KWQKHTMLPartImpl::scheduleClose()
 {
-    [[bridge window] close];
+    [[bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
 }
 
 void KWQKHTMLPartImpl::unfocusWindow()
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index d87c09b..f7677a4 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -77,7 +77,7 @@ public:
     bool openedByJS();
     void setOpenedByJS(bool _openedByJS);
 
-    void close();
+    void scheduleClose();
 
     void unfocusWindow();
 
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 25f75c7..4e75302 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -118,12 +118,7 @@ void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int lengt
         part->setEncoding(enc, true);
     }
     
-    // FIXME [rjw]:  Remove this log eventually.  Should never happen.  For debugging
-    // purposes only.
-    if (d->m_doc == 0){
-        fprintf (stderr, "ERROR:  KHTMLPart::slotData m_doc == 0 IGNORING DATA, url = %s\n", part->m_url.url().latin1());
-        return;
-    }
+    KWQ_ASSERT(d->m_doc != NULL);
 
     part->write(bytes, length);
 }
@@ -300,12 +295,7 @@ void KWQKHTMLPartImpl::write( const char *str, int len )
 // FIXME: Need to remerge this with code in khtml_part.cpp?
 void KWQKHTMLPartImpl::end()
 {
-    // FIXME [rjw]:  Remove this log eventually.  Should never happen.  For debugging
-    // purposes only.
-    if (d->m_doc == 0){
-        fprintf (stderr, "ERROR:  KHTMLPart::end  m_doc == 0\n");
-        return;
-    }
+    KWQ_ASSERT(d->m_doc != NULL);
 
     d->m_doc->setParsing(false);
 
@@ -652,9 +642,9 @@ void KWQKHTMLPartImpl::setOpenedByJS(bool _openedByJS)
     [bridge setOpenedByScript:_openedByJS];
 }
 
-void KWQKHTMLPartImpl::close()
+void KWQKHTMLPartImpl::scheduleClose()
 {
-    [[bridge window] close];
+    [[bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
 }
 
 void KWQKHTMLPartImpl::unfocusWindow()
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3119d30..bf03da1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+        Fix a regression in my recent refactoring that broke JavaScript
+	window opening, by doing some trickery to make a frame's initial
+	dummy data source committed.
+
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame initWithName:webView:provisionalDataSource:controller:]):
+	Create dummy data source as committed, not provisional.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]): Allow the documentView to be nil
+	if there is no webView either; this is temporarily needed to handle
+	the special initial dummy data source, which will be going away soon.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _receivedData:]): Add temporary special case to
+	avoid sending empty NSData to the representation, to avoid
+	triggering WebCore assertions.
+	* WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge openNewWindowWithURL:]): Get the committed data
+	source, not the provisional one.
+
 2002-07-21  Chris Blumenberg  <cblu at apple.com>
 	Used darin-inspired code factoring to fix 3000801 (alex doesn't accept drag of webloc file) in 3 places where we accept drags.
      
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 3119d30..bf03da1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,24 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+        Fix a regression in my recent refactoring that broke JavaScript
+	window opening, by doing some trickery to make a frame's initial
+	dummy data source committed.
+
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame initWithName:webView:provisionalDataSource:controller:]):
+	Create dummy data source as committed, not provisional.
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted]): Allow the documentView to be nil
+	if there is no webView either; this is temporarily needed to handle
+	the special initial dummy data source, which will be going away soon.
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _receivedData:]): Add temporary special case to
+	avoid sending empty NSData to the representation, to avoid
+	triggering WebCore assertions.
+	* WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge openNewWindowWithURL:]): Get the committed data
+	source, not the provisional one.
+
 2002-07-21  Chris Blumenberg  <cblu at apple.com>
 	Used darin-inspired code factoring to fix 3000801 (alex doesn't accept drag of webloc file) in 3 places where we accept drags.
      
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 6df10ae..be3e347 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -97,7 +97,7 @@
     WebController *newController = [[[[self dataSource] controller] windowContext] openNewWindowWithURL:url];
     WebDataSource *newDataSource;
     
-    newDataSource = [[newController mainFrame] provisionalDataSource];
+    newDataSource = [[newController mainFrame] dataSource];
     if ([newDataSource isDocumentHTML])
         return [(WebHTMLRepresentation *)[newDataSource representation] _bridge];
         
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 3a37974..9f9dbf0 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -478,7 +478,12 @@
     _private->gotFirstByte = YES;
     [self _commitIfReady];
 
-    [[self representation] receivedData:data withDataSource:self];
+    // FIXME: remove the conditional check, which exists to avoid jiggling the part
+    // the wrong way, when we change to the frame owning the bridge, and not needing
+    // a dummy data source to create one.
+    if ([data length] > 0) {
+	[[self representation] receivedData:data withDataSource:self];
+    }
     [[[[self webFrame] webView] documentView] dataSourceUpdated:self];
 }
 
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 9d6a8d7..2721979 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -37,31 +37,37 @@
 
     [self setController: c];
 
-    if (d == nil) {
-        // set a dummy data source so that the main from for a
-        // newly-created empty window has a KHTMLPart. JavaScript
-        // always creates new windows initially empty, and then wants
-        // to use the main frame's part to make the new window load
-        // it's URL, so we need to make sure empty frames have a part.
-        // However, we don't want to do the spinner, so we do this
-        // weird thing:
-
-        // FIXME: HACK ALERT!!!
-        // We need to keep a shadow part for all frames, even in the case
-        // of a non HTML representation.  This is required khtml
-        // can reference the frame (window.frames, targeting, etc.).
+    // set a dummy data source so that the main from for a
+    // newly-created empty window has a KHTMLPart. JavaScript
+    // always creates new windows initially empty, and then wants
+    // to use the main frame's part to make the new window load
+    // it's URL, so we need to make sure empty frames have a part.
+    // However, we don't want to do the spinner, so we do this
+    // weird thing:
     
-        WebDataSource *dummyDataSource = [[WebDataSource alloc] initWithURL:nil];
-        WebHTMLRepresentation *dummyRep = [[WebHTMLRepresentation alloc] init];
-        [[dummyRep _bridge] setDataSource: dummyDataSource];
-        [dummyDataSource _setRepresentation: dummyRep];
-        [dummyRep release];
-
-        [dummyDataSource _setController: [self controller]];
-        [_private setProvisionalDataSource: dummyDataSource];
-        [dummyDataSource release];
+    // FIXME: HACK ALERT!!!
+    // We need to keep a shadow part for all frames, even in the case
+    // of a non HTML representation.  This is required khtml
+    // can reference the frame (window.frames, targeting, etc.).
+    
+    WebDataSource *dummyDataSource = [[WebDataSource alloc] initWithURL:nil];
+    [dummyDataSource _setController: [self controller]];
+    [_private setProvisionalDataSource: dummyDataSource];
+    [self _setState: WebFrameStateProvisional];
+     
+    [dummyDataSource _setContentType:@"text/html"];
+    [dummyDataSource _setContentPolicy:WebContentPolicyShow];
+    [dummyDataSource _receivedData:[NSData data]];
+
+    // We have to do the next two steps manually, because the above
+    // data source won't be hooked up to its frame yet. Fortunately,
+    // this is only needed temporarily...
+
+    [self _transitionToCommitted];
+
+    [dummyDataSource release];
         
-    } else if ([self setProvisionalDataSource: d] == NO){
+    if (d != nil && [self setProvisionalDataSource: d] == NO){
         [self release];
         return nil;
     }
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index a235859..46f1a04 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -225,7 +225,11 @@ static const char * const stateNames[6] = {
     switch ([self _state]) {
     	case WebFrameStateProvisional:
         {
-            WEBKIT_ASSERT (documentView != nil);
+	    // FIXME: allow documentView to be nil for now if webView is,
+	    // to handle the case of the special data source in a just created
+	    // frame. This is temporary, eventually the frame will hang on to
+	    // a bridge without the need for a dummy data source
+            WEBKIT_ASSERT (documentView != nil || [self webView] == nil);
 
             // Set the committed data source on the frame.
             [self _setDataSource: _private->provisionalDataSource];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list