Bug 67665 - CSS "overflow: hidden" on body hides relative box nested in absolute box
Summary: CSS "overflow: hidden" on body hides relative box nested in absolute box
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-09 16:13 UTC by Jan de Groot
Modified: 2004-07-10 16:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
testcase (419 bytes, text/html)
2003-11-29 02:27 UTC, Germain Garand
Details
more general testcase (just for having a ref number for the regression framework) (472 bytes, text/html)
2004-07-10 16:56 UTC, Germain Garand
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan de Groot 2003-11-09 16:13:41 UTC
Version:            (using KDE KDE 3.1.93)
Installed from:    Compiled From Sources
Compiler:          GCC 3.3.2 
OS:          Linux

I few months ago, I made a website for a company: http://www.gossewijnsma.nl
AFAIK, it's 100% HTML 4.01 transitional and CSS2 compatible.
Konqueror 3.1.4, opera, mozilla and IE render the website good, while the Konqueror I build from KDE 3.2 beta1 sources today doesn't render it OK anymore.
I also tried to compile the latest CVS versions of kdelibs and kdebase, but the rendering is still not good.
Comment 1 Germain Garand 2003-11-09 19:25:13 UTC
Subject: Re:  New: [REGRESSION] HTML/CSS2 render bug

The front page problem (which is a resurrection of #34634) is fixed by the 
following patch. 
Dunno if it's correct - I thought the root element was a canvas ?!
*sigh* DESIGN.html is so old now...

Index: rendering/render_box.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_box.cpp,v
retrieving revision 1.218
diff -u -3 -b -B -p -r1.218 render_box.cpp
--- rendering/render_box.cpp    4 Nov 2003 21:26:21 -0000       1.218
+++ rendering/render_box.cpp    9 Nov 2003 18:11:53 -0000
@@ -1046,7 +1046,7 @@ void RenderBox::calcAbsoluteVertical()
     if (hl.isFixed())
         ch = hl.value() + cb->paddingTop() + cb->paddingBottom()
             + cb->borderTop() + cb->borderBottom();
-    else if (cb->isCanvas())
+    else if (cb->isCanvas() || cb->isRoot())
         ch = cb->availableHeight();
     else
         ch = cb->height();

The menu-not-being-displayed problem in the inner page remains.


Comment 2 Stephan Kulow 2003-11-28 22:29:34 UTC
such a patch is meanwhile in CVS afaik
Comment 3 Germain Garand 2003-11-29 01:37:02 UTC
Yes, I saw that Zack eventually commited it.
I didn't close the report though because of the big problems with "overflow: hidden" on <body> that ruin the inner page.

See: http://www.gossewijnsma.nl/index2.php
I'll try to make a testcase.
Comment 4 Germain Garand 2003-11-29 02:27:10 UTC
Created attachment 3465 [details]
testcase

-body { overflow: hidden }
-relative box inside absolute box
=> not rendered
renders OK in Mozilla 1.5 / Opera 7
Comment 5 Jan de Groot 2004-06-09 19:02:38 UTC
The bug is still in KDE 3.2.3. I tried to load the page on Mac OS X 10.3.3 with Safari, which shows fine. I think KHTML should get the fix from apple for this one, I'm sure this is not the only HTML 4.01 transitional/CSS2 compliant page that doesn't render OK.
Comment 6 Germain Garand 2004-07-10 16:36:47 UTC
CVS commit by ggarand: 

rendering/render_layer.cpp (calculateClipRects):
   absolutely positioned objects must update the overflowClipRect
   passed to relatively positioned child layers to match the
   posClipRect in effect.

regression tested. 

CCMAIL: 67665-done@bugs.kde.org, 72994-done@bugs.kde.org


  M +8 -0      ChangeLog   1.267
  M +15 -7     rendering/render_layer.cpp   1.42


--- kdelibs/khtml/ChangeLog  #1.266:1.267
@@ -1,2 +1,10 @@
+
+2004-07-10 Germain Garand <germain@ebooksfrance.org>
+
+        * rendering/render_layer.cpp (calculateClipRects): 
+        absolutely positioned objects must update the overflowClipRect 
+        passed to relatively positioned child layers to match the
+        posClipRect in effect (#67665/#72994).
+
 2004-06-30  Tobias Anton  <anton@stud.fbi.fh-darmstadt.de>
         * khtmlview.{cpp,h}:

--- kdelibs/khtml/rendering/render_layer.cpp  #1.41:1.42
@@ -883,12 +883,20 @@ void RenderLayer::calculateClipRects(con
                            // to our parent layer.
 
+    switch (m_object->style()->position()) {
     // A fixed object is essentially the root of its containing block hierarchy, so when
     // we encounter such an object, we reset our clip rects to the fixedClipRect.
-    if (m_object->style()->position() == FIXED) {
+      case FIXED:
         posClipRect = fixedClipRect;
         overflowClipRect = fixedClipRect;
-    }
-    else if (m_object->style()->position() == RELATIVE)
+        break;
+      case ABSOLUTE:
+        overflowClipRect = posClipRect;
+        break;
+      case RELATIVE:
         posClipRect = overflowClipRect;
+        break;
+      default:
+        break;
+    }
 
     // Update the clip rects that will be passed to child layers.


Comment 7 Germain Garand 2004-07-10 16:56:15 UTC
Created attachment 6606 [details]
more general testcase (just for having a ref number for the regression framework)