| Summary: | [testcase] padding-bottom not respected in div's with overflow: auto | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Florian Ehrenthal <dizzinger> |
| Component: | khtml renderer | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | padding-bottom not respected | ||
|
Description
Florian Ehrenthal
2006-08-31 03:28:59 UTC
Created attachment 17576 [details]
padding-bottom not respected
Margin is also incomplete. 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);
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();
|