Bug 74123

Summary: KHTML has problems with nested frames (desktop showing through, looking wierd after resize)
Product: [Applications] konqueror Reporter: Ernst Persson <ernstp>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: samuel.edlmeier
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Simple frameset that exhibits this problem
Left frame in frameset
Right frame in frameset

Description Ernst Persson 2004-02-04 12:48:31 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
Compiler:          gcc-3.3.2 
OS:          Linux

This code from helgon.net doesnt really work in konqueror.
Sometimes my desktop shows through in a thin border around the center frame, or on the right.
If you resize the window a few times you also get strange results, with frames overlapping etc.

You dont need the contents to see the frame errors.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<LINK REL="stylesheet" TYPE="text/css" HREF="/CSS/1.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<html>
<head>
<title>Helgon.net - Inga helgon direkt</title>
</head>
 <frameset border=0 frameborder=0 framespacing=0 cols="*,800,*">
	<frame src=frameset/stripes.asp marginheight=0 marginwidth=0 scrolling=no noresize name="stripestop">
		<frameset border=0 frameborder=0 framespacing=0 rows="83,*,5" class="frameborder">
			<frame marginheight=0 marginwidth=0 name=helgonlogo scrolling=no src=frameset/top.asp noresize>
			<frameset border=0 frameborder=0 framespacing=0 cols="111,*,45">
				<frame marginheight=0 marginwidth=0 name=helgonmeny src=frameset/meny.asp scrolling=no noresize>
				<frame marginheight=0 marginwidth=0 name="helgonmain" scrolling=yes src=start/start.asp noresize class="frameborder">
				<frame marginheight=0 marginwidth=0 name=newmess scrolling=no src=frameset/new.asp noresize>
			</frameset>
			<frame marginheight=0 marginwidth=0 name=helgonbottom scrolling=no src=frameset/bottom.asp noresize class="bgframe">
		</frameset>
	<frame src=frameset/stripes.asp marginheight=0 marginwidth=0 scrolling=no noresize name=stripesright>
	<noframes>
	<body topmargin=0 leftmargin=0>
	</body>
	</noframes>
</frameset>
</html>
Comment 1 Paul Hoepfner-Homme 2004-02-09 22:30:48 UTC
I am seeing this same bug with the website http://open-eyes.org/ - but I have provided a clear testcase for it. As far as I can tell, since KDE 3.2, Konqueror can no longer properly render column-based framesets where the frameborder attribute is set to 0. http://open-eyes.org/ is a site I visit regularly (it's my site) and Konqueror had always rendered it correctly - until I upgraded to KDE 3.2 a few days ago.

Now when I resize the browser horizontally, it seems that the rightmost frame (the navigation bar) is not being repainted properly. It's not shifting over as it should be.  It actually *is* getting repainted, but it's always repainted in the same place relative to the left side of the browser window, whereas it should be shifting from side to side according to the right side of the browser window.

I'll attach a test case (it's in three files, since it's a frameset). Specifically, the bug appears when you have a frameset of the form:

<frameset cols="*,N" frameborder="0">
	<frame src="...">
	<frame src="...">
</frameset>

where N is some integer.
Comment 2 Paul Hoepfner-Homme 2004-02-09 22:32:12 UTC
Created attachment 4606 [details]
Simple frameset that exhibits this problem

Make sure to download all three HTML files into the same directory before
trying this out. Then point your browser to frameset.html.
Comment 3 Paul Hoepfner-Homme 2004-02-09 22:33:19 UTC
Created attachment 4607 [details]
Left frame in frameset
Comment 4 Paul Hoepfner-Homme 2004-02-09 22:33:46 UTC
Created attachment 4608 [details]
Right frame in frameset
Comment 5 Dirk Mueller 2004-02-16 00:38:00 UTC
*** Bug 70241 has been marked as a duplicate of this bug. ***
Comment 6 Dirk Mueller 2004-02-16 03:16:19 UTC
CVS commit by mueller: 

yeah, sometimes one optimisation is just one too much. 
CCMAIL:74123-done@bugs.kde.org


  M +6 -10     khtmlview.cpp   1.619


--- kdelibs/khtml/khtmlview.cpp  #1.618:1.619
@@ -469,10 +469,9 @@ void KHTMLView::drawContents( QPainter *
 #endif
 
-//     kdDebug( 6000 ) << "drawContents this="<< this <<" x=" << ex << ",y=" << ey << ",w=" << ew << ",h=" << eh << endl;
+    //kdDebug( 6000 ) << "drawContents this="<< this <<" x=" << ex << ",y=" << ey << ",w=" << ew << ",h=" << eh << endl;
     if(!m_part || !m_part->xmlDocImpl() || !m_part->xmlDocImpl()->renderer()) {
         p->fillRect(ex, ey, ew, eh, palette().active().brush(QColorGroup::Base));
         return;
     }
-//    QRect dbg_paint_rect(ex,ey,ew,eh);
 
     QPoint pt = contentsToViewport(QPoint(ex, ey));
@@ -491,6 +490,11 @@ void KHTMLView::drawContents( QPainter *
         }
     }
+
+#if 0
+    // this is commonly the case with framesets. we still do
+    // want to paint them, otherwise the widgets don't get placed.
     if (cr.isEmpty())
         return;
+#endif
 
 #ifndef DEBUG_NO_PAINT_BUFFER
@@ -518,11 +522,4 @@ void KHTMLView::drawContents( QPainter *
             d->tp->fillRect(ex, ey+py, ew, ph, palette().active().brush(QColorGroup::Base));
             m_part->xmlDocImpl()->renderer()->layer()->paint(d->tp, QRect(ex, ey+py, ew, ph));
-#ifdef BOX_DEBUG
-            if (m_part->xmlDocImpl()->focusNode())
-            {
-                d->tp->setBrush(Qt::NoBrush);
-                d->tp->drawRect(m_part->xmlDocImpl()->focusNode()->getRect());
-            }
-#endif
             d->tp->end();
 
@@ -1824,5 +1821,4 @@ void KHTMLView::paint(QPainter *p, const
 void KHTMLView::useSlowRepaints()
 {
-    kdDebug(0) << "slow repaints requested" << endl;
     d->useSlowRepaints = true;
     setStaticBackground(true);


Comment 7 Ernst Persson 2004-02-16 19:08:39 UTC
Will this be backported to the 3.2 branch?
Comment 8 Stephan Kulow 2004-02-17 11:01:30 UTC
it already is
Comment 9 Niels 2004-02-18 02:03:38 UTC
I've also seen this behavior with some form elements - like textarea and selectboxes (I think). I can't tell if your patch also applies to those.

This only began in 3.2, it wasn't there in the first beta (I'm not sure about the second). And Konqueror actually seems to be a bit slower now as well. Complex CSS with lots of form elements can drag the speed down, as well as give the mentioned 'desktop showing through'.