[webkit-changes] cvs commit: WebKit/WebView.subproj WebDataSource.m WebFrame.m

Adele adele at opensource.apple.com
Tue Jul 12 17:57:04 PDT 2005


adele       05/07/12 17:57:03

  Modified:    .        Tag: Safari-1-3-branch ChangeLog
               khtml    Tag: Safari-1-3-branch khtml_part.cpp khtml_part.h
               kwq      Tag: Safari-1-3-branch WebCoreBridge.h
                        WebCoreBridge.mm
               .        Tag: Safari-1-3-branch ChangeLog
               WebView.subproj Tag: Safari-1-3-branch WebDataSource.m
                        WebFrame.m
  Log:
  WebCore:
  
          Merged WebCore part of fix from TOT to Safari-1-3-branch
          <rdar://problem/4176173>
  
      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 WebKit part of fix from TOT to Safari-1-3-branch
          <rdar://problem/4176173>
  
      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
  
      2005-06-12  Maciej Stachowiak  <mjs at apple.com>
  
          Reviewed by Chris Blumenberg.
  
  	- fixed <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
  
          * WebView.subproj/WebFrame.m:
          (-[WebFrame _transitionToCommitted:]): Stop loading the non-provisional data
  	source before swapping in the provisional.
          (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Stop only
  	the provisional load here, we would not want to stop loading if this navigation
  	later turns into a download or is cancelled before being committed.
          (-[WebFrame stopLoading]): Factored a bit.
          (-[WebFrame _cancelProvisionalLoad]): New method to stop only provisional load,
  	and cancel any pending policy deicions.
          (-[WebFrame _stopNonProvisionalLoadOnly]): New mthod that stops only the main
  	load.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4108.4.35 +25 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4108.4.34
  retrieving revision 1.4108.4.35
  diff -u -r1.4108.4.34 -r1.4108.4.35
  --- ChangeLog	12 Jul 2005 22:37:47 -0000	1.4108.4.34
  +++ ChangeLog	13 Jul 2005 00:56:50 -0000	1.4108.4.35
  @@ -1,5 +1,30 @@
   2005-07-12  Adele Peterson  <adele at apple.com>
   
  +        Merged WebCore part of fix from TOT to Safari-1-3-branch
  +        <rdar://problem/4176173>
  +
  +    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).
  +
  +
  +2005-07-12  Adele Peterson  <adele at apple.com>
  +
           Merged fix from TOT to Safari-1-3-branch
           <rdar://problem/4164989>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.311.6.4 +33 -16    WebCore/khtml/khtml_part.cpp
  
  Index: khtml_part.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
  retrieving revision 1.311.6.3
  retrieving revision 1.311.6.4
  diff -u -r1.311.6.3 -r1.311.6.4
  --- khtml_part.cpp	12 Jul 2005 22:37:59 -0000	1.311.6.3
  +++ khtml_part.cpp	13 Jul 2005 00:56:57 -0000	1.311.6.4
  @@ -581,7 +581,7 @@
   }
   
   
  -bool KHTMLPart::closeURL()
  +void KHTMLPart::stopLoading(bool sendUnload)
   {    
       if (d->m_doc && d->m_doc->tokenizer()) {
           d->m_doc->tokenizer()->stopParsing();
  @@ -594,20 +594,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
  @@ -636,9 +638,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;
   
  @@ -648,7 +658,6 @@
     // null node activated.
     emit nodeActivated(Node());
   
  -  return true;
   }
   
   DOM::HTMLDocument KHTMLPart::htmlDocument() const
  @@ -711,6 +720,14 @@
   extern "C" { KJSProxy *kjs_html_init(KHTMLPart *khtmlpart); }
   #endif
   
  +
  +bool KHTMLPart::closeURL()
  +{    
  +  stopLoading(true);
  +  
  +  return true;
  +}
  +
   KJSProxy *KHTMLPart::jScript()
   {
     if (!jScriptEnabled()){
  
  
  
  1.127.6.2 +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.6.1
  retrieving revision 1.127.6.2
  diff -u -r1.127.6.1 -r1.127.6.2
  --- khtml_part.h	2 Jun 2005 15:49:16 -0000	1.127.6.1
  +++ khtml_part.h	13 Jul 2005 00:56:57 -0000	1.127.6.2
  @@ -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.6.2 +1 -0      WebCore/kwq/WebCoreBridge.h
  
  Index: WebCoreBridge.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.h,v
  retrieving revision 1.327.6.1
  retrieving revision 1.327.6.2
  diff -u -r1.327.6.1 -r1.327.6.2
  --- WebCoreBridge.h	2 Jun 2005 15:49:16 -0000	1.327.6.1
  +++ WebCoreBridge.h	13 Jul 2005 00:56:58 -0000	1.327.6.2
  @@ -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.383.6.1 +5 -0      WebCore/kwq/WebCoreBridge.mm
  
  Index: WebCoreBridge.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
  retrieving revision 1.383
  retrieving revision 1.383.6.1
  diff -u -r1.383 -r1.383.6.1
  --- WebCoreBridge.mm	28 Mar 2005 01:50:25 -0000	1.383
  +++ WebCoreBridge.mm	13 Jul 2005 00:56:58 -0000	1.383.6.1
  @@ -375,6 +375,11 @@
       _part->closeURL();
   }
   
  +- (void)stopLoading
  +{
  +    _part->stopLoading();
  +}
  +
   - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache
   {
       _part->didNotOpenURL(KURL(URL).url());
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3120.2.8 +41 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3120.2.7
  retrieving revision 1.3120.2.8
  diff -u -r1.3120.2.7 -r1.3120.2.8
  --- ChangeLog	12 Jul 2005 20:11:08 -0000	1.3120.2.7
  +++ ChangeLog	13 Jul 2005 00:56:59 -0000	1.3120.2.8
  @@ -1,5 +1,46 @@
   2005-07-12  Adele Peterson  <adele at apple.com>
   
  +        Merged WebKit part of fix from TOT to Safari-1-3-branch
  +        <rdar://problem/4176173>
  +
  +    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
  +
  +    2005-06-12  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by Chris Blumenberg.
  +
  +	- fixed <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
  +	
  +        * WebView.subproj/WebFrame.m:
  +        (-[WebFrame _transitionToCommitted:]): Stop loading the non-provisional data
  +	source before swapping in the provisional.
  +        (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Stop only
  +	the provisional load here, we would not want to stop loading if this navigation
  +	later turns into a download or is cancelled before being committed.
  +        (-[WebFrame stopLoading]): Factored a bit.
  +        (-[WebFrame _cancelProvisionalLoad]): New method to stop only provisional load,
  +	and cancel any pending policy deicions.
  +        (-[WebFrame _stopNonProvisionalLoadOnly]): New mthod that stops only the main
  +	load.
  +
  +2005-07-12  Adele Peterson  <adele at apple.com>
  +
           Merged fix from TOT to Safari-1-3-branch
           <rdar://problem/4164950> Safari crashes if Esc key is held down during series of authentication sheets
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.198.6.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.6.1
  diff -u -r1.198 -r1.198.6.1
  --- WebDataSource.m	18 Mar 2005 22:56:39 -0000	1.198
  +++ WebDataSource.m	13 Jul 2005 00:57:02 -0000	1.198.6.1
  @@ -454,7 +454,7 @@
       [clients release];
       
       if (_private->committed) {
  -	[[self _bridge] closeURL];        
  +	[[self _bridge] stopLoading];        
       }
   }
   
  
  
  
  1.223.6.1 +2 -0      WebKit/WebView.subproj/WebFrame.m
  
  Index: WebFrame.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrame.m,v
  retrieving revision 1.223
  retrieving revision 1.223.6.1
  diff -u -r1.223 -r1.223.6.1
  --- WebFrame.m	23 Mar 2005 23:55:41 -0000	1.223
  +++ WebFrame.m	13 Jul 2005 00:57:03 -0000	1.223.6.1
  @@ -743,6 +743,8 @@
                   [_private setProvisionalItem:nil];
               }
   
  +            [[self _bridge] closeURL];
  +
               // Set the committed data source on the frame.
               [self _setDataSource:_private->provisionalDataSource];
                   
  
  
  



More information about the webkit-changes mailing list