Bug 133310 - [testcase] padding-bottom not respected in div's with overflow: auto
Summary: [testcase] padding-bottom not respected in div's with overflow: auto
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-31 03:28 UTC by Florian Ehrenthal
Modified: 2006-10-01 17:29 UTC (History)
0 users

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


Attachments
padding-bottom not respected (3.62 KB, text/html)
2006-08-31 03:30 UTC, Florian Ehrenthal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Ehrenthal 2006-08-31 03:28:59 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages

padding-bottom is ignored for div's that have overflow: auto and defined width and height.

i created an attachment/testcase which demonstrates the bug...
Comment 1 Florian Ehrenthal 2006-08-31 03:30:04 UTC
Created attachment 17576 [details]
padding-bottom not respected
Comment 2 Tommi Tervo 2006-08-31 10:19:17 UTC
Margin is also incomplete.
Comment 3 Allan Sandfeld 2006-09-20 16:28:03 UTC
SVN commit 586756 by carewolf:

Overflow-height includes padding-bottom when overflow scrolls.
BUG: 133310


 M  +8 -3      render_block.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_block.cpp #586755:586756
@@ -711,8 +711,13 @@
     calcHeight();
     if (oldHeight != m_height) {
         // If the block got expanded in size, then increase our overflowheight to match.
-        if (m_overflowHeight > m_height)
-            m_overflowHeight -= (borderBottom()+paddingBottom());
+        if (m_overflowHeight > m_height) {
+            if (style()->scrollsOverflow())
+                // overflow-height only includes padding-bottom when it scrolls
+                m_overflowHeight -= borderBottom();
+            else
+                m_overflowHeight -= (borderBottom()+paddingBottom());
+        }
         if (m_overflowHeight < m_height)
             m_overflowHeight = m_height;
     }
@@ -1633,7 +1638,7 @@
 
     if (childrenInline())
         paintLines(pI, scrolledX, scrolledY);
-    else {            
+    else {
         for(RenderObject *child = firstChild(); child; child = child->nextSibling())
             if(!child->layer() && !child->isFloating())
                 child->paint(pI, scrolledX, scrolledY);
Comment 4 Germain Garand 2006-10-01 17:29:30 UTC
SVN commit 591050 by ggarand:

some massaging of scrolling overflows calculations to avoid 
regressing on #133310 after the overflowHeight semantic change, 
also fixing it further to only add padding to normal content 
height, not to float bottom's.

CCBUG: 133310


 M  +7 -9      render_block.cpp  
 M  +4 -4      render_flow.cpp  
 M  +4 -4      render_layer.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_block.cpp #591049:591050
@@ -711,20 +711,18 @@
     int toAdd = borderBottom() + paddingBottom();
     if (m_layer && style()->scrollsOverflow() && style()->height().isVariable())
         toAdd += m_layer->horizontalScrollbarHeight();
-    if ( hasOverhangingFloats() && (isFloatingOrPositioned() || flowAroundFloats()) )
+    if ( hasOverhangingFloats() && !style()->scrollsOverflow() && (isFloatingOrPositioned() || flowAroundFloats()) )
         m_overflowHeight = m_height = floatBottom() + toAdd;
 
     int oldHeight = m_height;
     calcHeight();
     if (oldHeight != m_height) {
-        // If the block got expanded in size, then increase our overflowheight to match.
-        if (m_overflowHeight > m_height) {
-            if (style()->scrollsOverflow())
-                // overflow-height only includes padding-bottom when it scrolls
-                m_overflowHeight -= borderBottom();
-            else
-                m_overflowHeight -= (borderBottom()+paddingBottom());
+        m_overflowHeight -= toAdd;
+        if (m_layer && style()->scrollsOverflow()) {
+            // overflow-height only includes padding-bottom when it scrolls
+            m_overflowHeight += paddingBottom();
         }
+        // If the block got expanded in size, then increase our overflowheight to match.
         if (m_overflowHeight < m_height)
             m_overflowHeight = m_height;
     }
@@ -1352,7 +1350,7 @@
 
     int top = borderTop() + paddingTop();
     int bottom = borderBottom() + paddingBottom();
-    if (m_layer && style()->scrollsOverflow())
+    if (m_layer && style()->scrollsOverflow() && style()->height().isVariable())
         bottom += m_layer->horizontalScrollbarHeight();
 
     m_height = m_overflowHeight = top;
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_flow.cpp #591049:591050
@@ -320,7 +320,7 @@
     // a tiny rel div buried somewhere deep in our child tree.  In this case we have to get to
     // the abs div.
     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
-        if (!c->isFloatingOrPositioned() && !c->isText()) {
+        if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
             int lp = c->yPos() + c->lowestPosition(false);
             bottom = kMax(bottom, lp);
         }
@@ -345,7 +345,7 @@
     // a tiny rel div buried somewhere deep in our child tree.  In this case we have to get to
     // the abs div.
     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
-        if (!c->isFloatingOrPositioned() && !c->isText()) {
+        if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
             int rp = c->xPos() + c->rightmostPosition(false);
             right = kMax(right, rp);
         }
@@ -370,7 +370,7 @@
     // a tiny rel div buried somewhere deep in our child tree.  In this case we have to get to
     // the abs div.
     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
-        if (!c->isFloatingOrPositioned() && !c->isText()) {
+        if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
             int lp = c->xPos() + c->leftmostPosition(false);
             left = kMin(left, lp);
         }
@@ -395,7 +395,7 @@
     // a tiny rel div buried somewhere deep in our child tree.  In this case we have to get to
     // the abs div.
     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
-        if (!c->isFloatingOrPositioned() && !c->isText()) {
+        if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
             int hp = c->yPos() + c->highestPosition(false);
             top = kMin(top, hp);
         }
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_layer.cpp #591049:591050
@@ -720,12 +720,12 @@
 
 void RenderLayer::checkScrollbarsAfterLayout()
 {
-    int rightPos = m_object->rightmostPosition(true, false);
-    int bottomPos = m_object->lowestPosition(true, false);
+    int rightPos = m_object->rightmostPosition(true);
+    int bottomPos = m_object->lowestPosition(true);
     
 /*  TODO
-    m_scrollLeft = m_object->leftmostPosition(true, false);
-    m_scrollTop = m_object->highestPosition(true, false);
+    m_scrollLeft = m_object->leftmostPosition(true);
+    m_scrollTop = m_object->highestPosition(true);
 */
 
     int clientWidth = m_object->clientWidth();