[webkit-changes] cvs commit: WebCore/kwq WebCoreBridge.h WebCoreBridge.mm

Adele adele at opensource.apple.com
Mon Jun 13 18:27:52 PDT 2005


adele       05/06/13 18:27:52

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               WebView.subproj Tag: Safari-2-0-branch WebDataSource.m
                        WebFrame.m
               .        Tag: Safari-2-0-branch ChangeLog
               khtml    Tag: Safari-2-0-branch khtml_part.cpp khtml_part.h
               kwq      Tag: Safari-2-0-branch WebCoreBridge.h
                        WebCoreBridge.mm
  Log:
  WebCore:
  
          Merged new fix for <rdar://problem/4142247> from TOT to Safari-2-0-branch.
  
      2005-06-13  Maciej Stachowiak  <mjs at apple.com>
  
          Reviewed by Chris Blumenberg and Adele.
  
  	- better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash
  	http://bugzilla.opendarwin.org/show_bug.cgi?id=3445
  
  	With this change and the matching WebKit change we'll still stop loading the moment you click
  	a download link, but the unload event and detaching of event handlers will not happen early any more.
  
          * khtml/khtml_part.cpp:
          (KHTMLPart::stopLoading): Factored out from closeURL, make firing of unload
  	and detaching of event handlers optional.
          (KHTMLPart::closeURL): call stopLoading(true)
          * khtml/khtml_part.h:
          * kwq/WebCoreBridge.h:
          * kwq/WebCoreBridge.mm:
          (-[WebCoreBridge stopLoading]): Call stopLoading(false).
  
  WebKit:
  
          Merged new fix for <rdar://problem/4142247> from TOT to Safari-2-0-branch.
  
      2005-06-13  Maciej Stachowiak  <mjs at apple.com>
  
          Reviewed by Chris Blumenberg and Adele.
  
  	- better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash
  	http://bugzilla.opendarwin.org/show_bug.cgi?id=3445
  
  	With this change and the matching WebKit change we'll still stop loading the moment you click
  	a download link, but the unload event and detaching of event handlers will not happen early any more.
  
          * WebView.subproj/WebDataSource.m:
          (-[WebDataSource _stopLoadingInternal]): call stopLoading on bridge instead of closeURL.
          * WebView.subproj/WebFrame.m:
          (-[WebFrame _transitionToCommitted:]): Revert previous attempt at fix.
          (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): ditto
          (-[WebFrame stopLoading]): ditto
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3118.4.10 +21 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3118.4.9
  retrieving revision 1.3118.4.10
  diff -u -r1.3118.4.9 -r1.3118.4.10
  --- ChangeLog	13 Jun 2005 00:40:35 -0000	1.3118.4.9
  +++ ChangeLog	14 Jun 2005 01:27:40 -0000	1.3118.4.10
  @@ -1,3 +1,24 @@
  +2005-06-13  Adele Peterson  <adele at apple.com>
  +
  +        Merged new fix for <rdar://problem/4142247> from TOT to Safari-2-0-branch.
  +
  +    2005-06-13  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by Chris Blumenberg and Adele.
  +
  +	- better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash
  +	http://bugzilla.opendarwin.org/show_bug.cgi?id=3445
  +
  +	With this change and the matching WebKit change we'll still stop loading the moment you click
  +	a download link, but the unload event and detaching of event handlers will not happen early any more.
  +	
  +        * WebView.subproj/WebDataSource.m:
  +        (-[WebDataSource _stopLoadingInternal]): call stopLoading on bridge instead of closeURL.
  +        * WebView.subproj/WebFrame.m:
  +        (-[WebFrame _transitionToCommitted:]): Revert previous attempt at fix.
  +        (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): ditto
  +        (-[WebFrame stopLoading]): ditto
  +
   === WebKit-412.5 ===
   
   2005-06-12  Adele Peterson  <adele at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.198.8.1 +1 -1      WebKit/WebView.subproj/WebDataSource.m
  
  Index: WebDataSource.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebDataSource.m,v
  retrieving revision 1.198
  retrieving revision 1.198.8.1
  diff -u -r1.198 -r1.198.8.1
  --- WebDataSource.m	18 Mar 2005 22:56:39 -0000	1.198
  +++ WebDataSource.m	14 Jun 2005 01:27:44 -0000	1.198.8.1
  @@ -454,7 +454,7 @@
       [clients release];
       
       if (_private->committed) {
  -	[[self _bridge] closeURL];        
  +	[[self _bridge] stopLoading];        
       }
   }
   
  
  
  
  1.223.8.2 +10 -22    WebKit/WebView.subproj/WebFrame.m
  
  Index: WebFrame.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrame.m,v
  retrieving revision 1.223.8.1
  retrieving revision 1.223.8.2
  diff -u -r1.223.8.1 -r1.223.8.2
  --- WebFrame.m	12 Jun 2005 21:06:21 -0000	1.223.8.1
  +++ WebFrame.m	14 Jun 2005 01:27:44 -0000	1.223.8.2
  @@ -162,8 +162,6 @@
   - (WebHistoryItem *)_createItem: (BOOL)useOriginal;
   - (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip;
   - (WebHistoryItem *)_currentBackForwardListItemToResetTo;
  -- (void)_cancelProvisionalLoad;
  -- (void)_stopNonProvisionalLoadOnly;
   @end
   
   @implementation WebFramePrivate
  @@ -745,8 +743,9 @@
                   [_private setProvisionalItem:nil];
               }
   
  +            [[self _bridge] closeURL];
  +
               // Set the committed data source on the frame.
  -            [self _stopNonProvisionalLoadOnly];
               [self _setDataSource:_private->provisionalDataSource];
                   
               [self _setProvisionalDataSource: nil];
  @@ -2303,7 +2302,7 @@
       WebFrameLoadType loadType = _private->policyLoadType;
       WebDataSource *dataSource = [_private->policyDataSource retain];
       
  -    [self _cancelProvisionalLoad];
  +    [self stopLoading];
       [self _setLoadType:loadType];
       [self _setProvisionalDataSource:dataSource];
       [dataSource release];
  @@ -2786,13 +2785,6 @@
       }
   }
   
  -- (void)_cancelProvisionalLoad
  -{
  -    [self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
  -    [_private->provisionalDataSource _stopLoading];
  -    [self _setProvisionalDataSource:nil];
  -}
  -
   - (void)stopLoading
   {
       // If this method is called from within this method, infinite recursion can occur (3442218). Avoid this.
  @@ -2800,19 +2792,15 @@
           return;
       }
       _private->isStoppingLoad = YES;
  -    [self _cancelProvisionalLoad];
  -    [_private->dataSource _stopLoading];
  -    _private->isStoppingLoad = NO;
  -}
  +    
  +    [self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
   
  -- (void)_stopNonProvisionalLoadOnly
  -{
  -    // If this method is called from within this method, infinite recursion can occur (3442218). Avoid this.
  -    if (_private->isStoppingLoad) {
  -        return;
  -    }
  -    _private->isStoppingLoad = YES;
  +    [_private->provisionalDataSource _stopLoading];
       [_private->dataSource _stopLoading];
  +
  +    // Release the provisional data source because there's no point in keeping it around since it is unused in this case.
  +    [self _setProvisionalDataSource:nil];
  +    
       _private->isStoppingLoad = NO;
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4104.2.34 +24 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4104.2.33
  retrieving revision 1.4104.2.34
  diff -u -r1.4104.2.33 -r1.4104.2.34
  --- ChangeLog	7 Jun 2005 22:51:09 -0000	1.4104.2.33
  +++ ChangeLog	14 Jun 2005 01:27:45 -0000	1.4104.2.34
  @@ -1,3 +1,27 @@
  +2005-06-13  Adele Peterson  <adele at apple.com>
  +
  +        Merged new fix for <rdar://problem/4142247> from TOT to Safari-2-0-branch.
  +
  +    2005-06-13  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by Chris Blumenberg and Adele.
  +
  +	- better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash
  +	http://bugzilla.opendarwin.org/show_bug.cgi?id=3445
  +
  +	With this change and the matching WebKit change we'll still stop loading the moment you click
  +	a download link, but the unload event and detaching of event handlers will not happen early any more.
  +	
  +        * khtml/khtml_part.cpp:
  +        (KHTMLPart::stopLoading): Factored out from closeURL, make firing of unload
  +	and detaching of event handlers optional.
  +        (KHTMLPart::closeURL): call stopLoading(true)
  +        * khtml/khtml_part.h:
  +        * kwq/WebCoreBridge.h:
  +        * kwq/WebCoreBridge.mm:
  +        (-[WebCoreBridge stopLoading]): Call stopLoading(false).
  +
  +
   === WebCore-415.10 ===
   
   2005-06-07  Adele Peterson  <adele at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.311.8.5 +32 -16    WebCore/khtml/khtml_part.cpp
  
  Index: khtml_part.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
  retrieving revision 1.311.8.4
  retrieving revision 1.311.8.5
  diff -u -r1.311.8.4 -r1.311.8.5
  --- khtml_part.cpp	1 Jun 2005 22:34:54 -0000	1.311.8.4
  +++ khtml_part.cpp	14 Jun 2005 01:27:50 -0000	1.311.8.5
  @@ -583,7 +583,7 @@
   }
   
   
  -bool KHTMLPart::closeURL()
  +void KHTMLPart::stopLoading(bool sendUnload)
   {    
       if (d->m_doc && d->m_doc->tokenizer()) {
           d->m_doc->tokenizer()->stopParsing();
  @@ -596,20 +596,22 @@
       d->m_job = 0;
     }
   
  -  if ( d->m_doc && d->m_doc->isHTMLDocument() ) {
  -    HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>( d->m_doc );
  -
  -    if ( hdoc->body() && d->m_bLoadEventEmitted && !d->m_bUnloadEventEmitted ) {
  -      hdoc->body()->dispatchWindowEvent( EventImpl::UNLOAD_EVENT, false, false );
  -      if ( d->m_doc )
  -        d->m_doc->updateRendering();
  -      d->m_bUnloadEventEmitted = true;
  +  if (sendUnload) {
  +    if ( d->m_doc && d->m_doc->isHTMLDocument() ) {
  +      HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>( d->m_doc );
  +      
  +      if ( hdoc->body() && d->m_bLoadEventEmitted && !d->m_bUnloadEventEmitted ) {
  +        hdoc->body()->dispatchWindowEvent( EventImpl::UNLOAD_EVENT, false, false );
  +        if ( d->m_doc )
  +          d->m_doc->updateRendering();
  +        d->m_bUnloadEventEmitted = true;
  +      }
       }
  +    
  +    if (d->m_doc && !d->m_doc->inPageCache())
  +      d->m_doc->removeAllEventListenersFromAllNodes();
     }
   
  -  if (d->m_doc && !d->m_doc->inPageCache())
  -    d->m_doc->removeAllEventListenersFromAllNodes();
  -    
     d->m_bComplete = true; // to avoid emitting completed() in slotFinishedParsing() (David)
     d->m_bLoadingMainResource = false;
     d->m_bLoadEventEmitted = true; // don't want that one either
  @@ -641,9 +643,17 @@
     // tell all subframes to stop as well
     ConstFrameIt it = d->m_frames.begin();
     ConstFrameIt end = d->m_frames.end();
  -  for (; it != end; ++it )
  -    if ( !( *it ).m_part.isNull() )
  -      ( *it ).m_part->closeURL();
  +  for (; it != end; ++it ) {
  +      KParts::ReadOnlyPart *part = (*it).m_part;
  +      if (part) {
  +          KHTMLPart *khtml_part = static_cast<KHTMLPart *>(part);
  +
  +          if (khtml_part->inherits("KHTMLPart"))
  +              khtml_part->stopLoading(sendUnload);
  +          else
  +              part->closeURL();
  +      }
  +  }
   
     d->m_bPendingChildRedirection = false;
   
  @@ -653,7 +663,6 @@
     // null node activated.
     emit nodeActivated(Node());
   
  -  return true;
   }
   
   DOM::HTMLDocument KHTMLPart::htmlDocument() const
  @@ -716,6 +725,13 @@
   extern "C" { KJSProxy *kjs_html_init(KHTMLPart *khtmlpart); }
   #endif
   
  +bool KHTMLPart::closeURL()
  +{    
  +  stopLoading(true);
  +
  +  return true;
  +}
  +
   KJSProxy *KHTMLPart::jScript()
   {
     if (!jScriptEnabled()){
  
  
  
  1.127.8.1 +1 -0      WebCore/khtml/khtml_part.h
  
  Index: khtml_part.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/khtml_part.h,v
  retrieving revision 1.127
  retrieving revision 1.127.8.1
  diff -u -r1.127 -r1.127.8.1
  --- khtml_part.h	20 Mar 2005 21:18:26 -0000	1.127
  +++ khtml_part.h	14 Jun 2005 01:27:50 -0000	1.127.8.1
  @@ -217,6 +217,7 @@
     /**
      * Stops loading the document and kill all data requests (for images, etc.)
      */
  +  void stopLoading(bool sendUnload = false);
     virtual bool closeURL();
   
   #if !APPLE_CHANGES
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.327.8.1 +1 -0      WebCore/kwq/WebCoreBridge.h
  
  Index: WebCoreBridge.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.h,v
  retrieving revision 1.327
  retrieving revision 1.327.8.1
  diff -u -r1.327 -r1.327.8.1
  --- WebCoreBridge.h	23 Mar 2005 19:49:41 -0000	1.327
  +++ WebCoreBridge.h	14 Jun 2005 01:27:51 -0000	1.327.8.1
  @@ -203,6 +203,7 @@
   - (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
   - (void)addData:(NSData *)data;
   - (void)closeURL;
  +- (void)stopLoading;
   
   - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache;
   
  
  
  
  1.382.2.3 +5 -0      WebCore/kwq/WebCoreBridge.mm
  
  Index: WebCoreBridge.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
  retrieving revision 1.382.2.2
  retrieving revision 1.382.2.3
  diff -u -r1.382.2.2 -r1.382.2.3
  --- WebCoreBridge.mm	27 Apr 2005 23:14:05 -0000	1.382.2.2
  +++ WebCoreBridge.mm	14 Jun 2005 01:27:51 -0000	1.382.2.3
  @@ -375,6 +375,11 @@
       _part->closeURL();
   }
   
  +- (void)stopLoading
  +{
  +    _part->stopLoading();
  +}
  +
   - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache
   {
       _part->didNotOpenURL(KURL(URL).url());
  
  
  



More information about the webkit-changes mailing list