<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>66958</bug_id>
          
          <creation_ts>2003-10-31 10:23:32 +0000</creation_ts>
          <short_desc>Reload does not reload the current page in web sites with frames, it reloads the home page</short_desc>
          <delta_ts>2008-11-04 09:34:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konqueror</product>
          <component>khtml</component>
          <version>unspecified</version>
          <rep_platform>Debian testing</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pablo de Vicente">p.devicente</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>aiacovitti</cc>
    
    <cc>jgarza</cc>
    
    <cc>oded</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>40</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>170776</commentid>
    <comment_count>0</comment_count>
    <who name="Pablo de Vicente">p.devicente</who>
    <bug_when>2003-10-31 10:23:32 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.1.92)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 3.3.1 
OS:          Linux

When logging into a web site with frames if one is viewing a page which is not the home page, and then reloads that page the home page is rendered. This does not happen with mozilla, for example.

Try this web please: http://www.oan.es

and then select any page from any link in the main page or the left side buttons, for example browse using the blue button &quot;Informaci</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170816</commentid>
    <comment_count>1</comment_count>
    <who name="Stephan Kulow">coolo</who>
    <bug_when>2003-10-31 13:12:41 +0000</bug_when>
    <thetext>there are reasons why frames are deprecated :)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>329573</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Friedrichsmeier">thomas.friedrichsmeier</who>
    <bug_when>2005-03-29 19:02:37 +0000</bug_when>
    <thetext>Still present in 3.3.2 and can&apos;t find a mention in the changelog for 3.4 (I don&apos;t have 3.4 installed, yet).
Of course there are reasons why frames are deprecated. There are also reasons why it would still be nicer 99% of the time, if reload would reload the frameset with the _current_ pages instead of the initial pages.
This thing has bitten me time and again, when I simply wasn&apos;t consciously aware, that I was visiting a website with frames, and that this website - in konqueror - would behave entirely different when pressing reload than what you&apos;d normally expect.
So while frames are evil indeed, they are an evil which is still widely used. It&apos;s an evil which _can_ be alleviated in this particular regard. So is there a reason not to pursue this bug / wishlist item? Are there any relevant cases when the current behavior is preferable to the behavior requested?

(Note: being somewhat argumentative here, since comment #1 seems to suggest that this report will be willfully ignored. I know dealing with bugs like this is tedious and timeconsuming, and I don&apos;t &quot;demand&quot; immediate resolution or something. Just trying to make sure this is not being ignored)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>380709</commentid>
    <comment_count>3</comment_count>
    <who name="Tommi Tervo">tommi.tervo</who>
    <bug_when>2005-10-11 15:31:16 +0000</bug_when>
    <thetext>*** Bug 77792 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>382099</commentid>
    <comment_count>4</comment_count>
    <who name="Tommi Tervo">tommi.tervo</who>
    <bug_when>2005-10-17 14:23:31 +0000</bug_when>
    <thetext>*** Bug 60478 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>501574</commentid>
    <comment_count>5</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2007-01-14 20:51:09 +0000</bug_when>
    <thetext>SVN commit 623425 by hasso:

Implement soft frameset reload strategy - reload individual frames only.
Frameset can be still reset via moving cursor into URL bar and pressing
the enter key.

Reviewed by Germain Garand.

BUG:66958



 M  +1 -1      kdebase/konqueror/konq_mainwindow.cc  
 M  +5 -2      kdebase/konqueror/konq_view.cc  
 M  +1 -1      kdebase/konqueror/konq_view.h  
 M  +19 -0     kdelibs/khtml/khtml_part.cpp  
 M  +2 -0      kdelibs/kparts/browserextension.cpp  
 M  +7 -0      kdelibs/kparts/browserextension.h  


--- branches/KDE/3.5/kdebase/konqueror/konq_mainwindow.cc #623424:623425
@@ -1766,7 +1766,7 @@
 
   KonqOpenURLRequest req( reloadView-&gt;typedURL() );
   req.userRequestedReload = true;
-  if ( reloadView-&gt;prepareReload( req.args ) )
+  if ( reloadView-&gt;prepareReload( req.args, true /* softReload */ ) )
   {
       reloadView-&gt;lockHistory();
       // Reuse current servicetype for local files, but not for remote files (it could have changed, e.g. over HTTP)
--- branches/KDE/3.5/kdebase/konqueror/konq_view.cc #623424:623425
@@ -170,7 +170,7 @@
   // Typing &quot;Enter&quot; again after the URL of an aborted view, triggers a reload.
   if ( m_bAborted &amp;&amp; m_pPart &amp;&amp; m_pPart-&gt;url() == url &amp;&amp; !args.doPost())
   {
-    if ( !prepareReload( args ) )
+    if ( !prepareReload( args, false /* not softReload */ ) )
       return;
     if ( ext )
       ext-&gt;setURLArgs( args );
@@ -1347,9 +1347,12 @@
       KGlobal::_activeInstance = m_pPart-&gt;instance();
 }
 
-bool KonqView::prepareReload( KParts::URLArgs&amp; args )
+bool KonqView::prepareReload( KParts::URLArgs&amp; args, bool softReload )
 {
     args.reload = true;
+    if ( softReload )
+        args.softReload = true;
+
     // Repost form data if this URL is the result of a POST HTML form.
     if ( m_doPost &amp;&amp; !args.redirectedRequest() )
     {
--- branches/KDE/3.5/kdebase/konqueror/konq_view.h #623424:623425
@@ -314,7 +314,7 @@
 
   // Called before reloading this view. Sets args.reload to true, and offers to repost form data.
   // Returns false in case the reload must be cancelled.
-  bool prepareReload( KParts::URLArgs&amp; args );
+  bool prepareReload( KParts::URLArgs&amp; args, bool softReload );
 
   // overload for the QString version
   void setLocationBarURL( const KURL&amp; locationBarURL );
--- branches/KDE/3.5/kdelibs/khtml/khtml_part.cpp #623424:623425
@@ -639,6 +639,25 @@
       isFrameSet = htmlDoc-&gt;body() &amp;&amp; (htmlDoc-&gt;body()-&gt;id() == ID_FRAMESET);
   }
 
+  if (isFrameSet &amp;&amp; urlcmp( url.url(), m_url.url(), true, true ) &amp;&amp; args.softReload)
+  {
+    QValueList&lt;khtml::ChildFrame*&gt;::Iterator it = d-&gt;m_frames.begin();
+    const QValueList&lt;khtml::ChildFrame*&gt;::Iterator end = d-&gt;m_frames.end();
+    for (; it != end; ++it) {
+      KHTMLPart* const part = static_cast&lt;KHTMLPart *&gt;((KParts::ReadOnlyPart *)(*it)-&gt;m_part);
+      if (part-&gt;inherits(&quot;KHTMLPart&quot;))
+      {
+        // We are reloading frames to make them jump into offsets.
+        KParts::URLArgs partargs( part-&gt;d-&gt;m_extension-&gt;urlArgs() );
+        partargs.reload = true;
+        part-&gt;d-&gt;m_extension-&gt;setURLArgs(partargs);
+
+        part-&gt;openURL( part-&gt;url() );
+      }
+    }/*next it*/
+    return true;
+  }
+
   if ( url.hasRef() &amp;&amp; !isFrameSet )
   {
     bool noReloadForced = !args.reload &amp;&amp; !args.redirectedRequest() &amp;&amp; !args.doPost();
--- branches/KDE/3.5/kdelibs/kparts/browserextension.cpp #623424:623425
@@ -87,6 +87,7 @@
 URLArgs::URLArgs()
 {
   reload = false;
+  softReload = false;
   xOffset = 0;
   yOffset = 0;
   trustedSource = false;
@@ -116,6 +117,7 @@
   delete d; d= 0;
 
   reload = args.reload;
+  softReload = args.softReload;
   xOffset = args.xOffset;
   yOffset = args.yOffset;
   serviceType = args.serviceType;
--- branches/KDE/3.5/kdelibs/kparts/browserextension.h #623424:623425
@@ -74,6 +74,13 @@
    */
   bool reload;
   /**
+   * @p softReload is set when user just hits reload button. It&apos;s used
+   * currently for two different frameset reload strategies. In case of
+   * soft reload individual frames are reloaded instead of reloading whole
+   * frameset.
+   */
+  bool softReload;
+  /**
    * @p xOffset is the horizontal scrolling of the part&apos;s widget
    * (in case it&apos;s a scrollview). This is saved into the history
    * and restored when going back in the history.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>501915</commentid>
    <comment_count>6</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2007-01-16 09:30:25 +0000</bug_when>
    <thetext>Patch was reverted because it&apos;s BIC. Will try to solve this in binary compatible way in next days.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>537528</commentid>
    <comment_count>7</comment_count>
    <who name="Germain Garand">germain</who>
    <bug_when>2007-07-23 02:58:37 +0000</bug_when>
    <thetext>SVN commit 691143 by ggarand:

reinstating patch by Hasso Tepper that was once reverted for BIC problems,
then forgotten.

(kdelibs part)

CCBUG: 66958



 M  +22 -2     khtml/khtml_part.cpp  
 M  +2 -0      kparts/browserextension.cpp  
 M  +7 -0      kparts/browserextension.h  


--- trunk/KDE/kdelibs/khtml/khtml_part.cpp #691142:691143
@@ -632,6 +632,26 @@
       isFrameSet = htmlDoc-&gt;body() &amp;&amp; (htmlDoc-&gt;body()-&gt;id() == ID_FRAMESET);
   }
 
+  if (isFrameSet &amp;&amp; urlcmp( url.url(), this-&gt;url().url(), KUrl::CompareWithoutTrailingSlash | KUrl::CompareWithoutFragment ) 
+                 &amp;&amp; args.softReload)
+  {
+    QList&lt;khtml::ChildFrame*&gt;::Iterator it = d-&gt;m_frames.begin();
+    const QList&lt;khtml::ChildFrame*&gt;::Iterator end = d-&gt;m_frames.end();
+    for (; it != end; ++it) {
+      KHTMLPart* const part = qobject_cast&lt;KHTMLPart *&gt;( (*it)-&gt;m_part );
+      if (part)
+      {
+        // We are reloading frames to make them jump into offsets.
+        KParts::URLArgs partargs( part-&gt;d-&gt;m_extension-&gt;urlArgs() );
+        partargs.reload = true;
+        part-&gt;d-&gt;m_extension-&gt;setUrlArgs(partargs);
+
+        part-&gt;openUrl( part-&gt;url() );
+      }
+    }/*next it*/
+    return true;
+  }
+
   if ( url.hasRef() &amp;&amp; !isFrameSet )
   {
     bool noReloadForced = !args.reload &amp;&amp; !args.redirectedRequest() &amp;&amp; !args.doPost();
@@ -2594,8 +2614,8 @@
     QList&lt;khtml::ChildFrame*&gt;::Iterator it = m_frames.begin();
     const QList&lt;khtml::ChildFrame*&gt;::Iterator itEnd = m_frames.end();
     for (; it != itEnd; ++it) {
-      KHTMLPart* const part = static_cast&lt;KHTMLPart *&gt;((KParts::ReadOnlyPart *)(*it)-&gt;m_part);
-      if (part-&gt;inherits(&quot;KHTMLPart&quot;))
+      KHTMLPart* const part = qobject_cast&lt;KHTMLPart *&gt;( (*it)-&gt;m_part );
+      if (part)
         part-&gt;d-&gt;setFlagRecursively(flag, value);
     }/*next it*/
   }
--- trunk/KDE/kdelibs/kparts/browserextension.cpp #691142:691143
@@ -118,6 +118,7 @@
 URLArgs::URLArgs()
 {
   reload = false;
+  softReload = false;
   xOffset = 0;
   yOffset = 0;
   trustedSource = false;
@@ -147,6 +148,7 @@
   delete d; d= 0;
 
   reload = args.reload;
+  softReload = args.softReload;
   xOffset = args.xOffset;
   yOffset = args.yOffset;
   serviceType = args.serviceType;
--- trunk/KDE/kdelibs/kparts/browserextension.h #691142:691143
@@ -81,6 +81,13 @@
    */
   bool reload;
   /**
+   * @p softReload is set when user just hits reload button. It&apos;s used
+   * currently for two different frameset reload strategies. In case of
+   * soft reload individual frames are reloaded instead of reloading whole
+   * frameset.
+   */
+  bool softReload;
+  /**
    * @p xOffset is the horizontal scrolling of the part&apos;s widget
    * (in case it&apos;s a scrollview). This is saved into the history
    * and restored when going back in the history.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>537529</commentid>
    <comment_count>8</comment_count>
    <who name="Germain Garand">germain</who>
    <bug_when>2007-07-23 02:59:40 +0000</bug_when>
    <thetext>SVN commit 691145 by ggarand:

reinstating patch by Hasso Tepper that was once reverted for BIC problems,
then forgotten.

(kdebase part)

BUG: 66958



 M  +1 -1      konqmainwindow.cpp  
 M  +5 -2      konqview.cpp  
 M  +1 -1      konqview.h  


--- trunk/KDE/kdebase/apps/konqueror/src/konqmainwindow.cpp #691144:691145
@@ -1773,7 +1773,7 @@
 
   KonqOpenURLRequest req( reloadView-&gt;typedUrl() );
   req.userRequestedReload = true;
-  if ( reloadView-&gt;prepareReload( req.args ) )
+  if ( reloadView-&gt;prepareReload( req.args, true /* softReload */ ) )
   {
       reloadView-&gt;lockHistory();
       // Reuse current servicetype for local files, but not for remote files (it could have changed, e.g. over HTTP)
--- trunk/KDE/kdebase/apps/konqueror/src/konqview.cpp #691144:691145
@@ -171,7 +171,7 @@
   // Typing &quot;Enter&quot; again after the URL of an aborted view, triggers a reload.
   if ( m_bAborted &amp;&amp; m_pPart &amp;&amp; m_pPart-&gt;url() == url &amp;&amp; !args.doPost())
   {
-    if ( !prepareReload( args ) )
+    if ( !prepareReload( args, false /* not softReload */ ) )
       return;
     if ( ext )
       ext-&gt;setUrlArgs( args );
@@ -1327,9 +1327,12 @@
       KGlobal::setActiveComponent( m_pPart-&gt;componentData() );
 }
 
-bool KonqView::prepareReload( KParts::URLArgs&amp; args )
+bool KonqView::prepareReload( KParts::URLArgs&amp; args, bool softReload )
 {
     args.reload = true;
+    if ( softReload )
+        args.softReload = true;
+
     // Repost form data if this URL is the result of a POST HTML form.
     if ( m_doPost &amp;&amp; !args.redirectedRequest() )
     {
--- trunk/KDE/kdebase/apps/konqueror/src/konqview.h #691144:691145
@@ -319,7 +319,7 @@
 
   // Called before reloading this view. Sets args.reload to true, and offers to repost form data.
   // Returns false in case the reload must be canceled.
-  bool prepareReload( KParts::URLArgs&amp; args );
+  bool prepareReload( KParts::URLArgs&amp; args, bool softReload );
 
   // overload for the QString version
   void setLocationBarURL( const KUrl&amp; locationBarURL );
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>660155</commentid>
    <comment_count>9</comment_count>
    <who name="Andrea Iacovitti">aiacovitti</who>
    <bug_when>2008-11-04 09:34:30 +0000</bug_when>
    <thetext>This bug have to be reopen for kde 4.1.2 (tested on debian), i think it&apos;s a regression due to revision 825638, hunk :

@@ -648,8 +666,7 @@
       isFrameSet = htmlDoc-&gt;body() &amp;&amp; (htmlDoc-&gt;body()-&gt;id() == ID_FRAMESET);
   }
 
-  if (isFrameSet &amp;&amp; urlcmp( url.url(), this-&gt;url().url(), KUrl::CompareWithoutTrailingSlash | KUrl::CompareWithoutFragment )
-                 &amp;&amp; browserArgs.softReload)
+  if (isFrameSet &amp;&amp; d-&gt;isLocalAnchorJump(url) &amp;&amp; browserArgs.softReload)
   {
     QList&lt;khtml::ChildFrame*&gt;::Iterator it = d-&gt;m_frames.begin();
     const QList&lt;khtml::ChildFrame*&gt;::Iterator end = d-&gt;m_frames.end();


Hope will help.
cheers,
ANdrea</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>