Summary: | CSS relative height in % wrong (testcase) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Moritz Moeller-Herrmann <moritz-kdebugs> |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | NOR | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | The pasted example as file for earsier access... |
Description
Moritz Moeller-Herrmann
2003-02-02 14:20:00 UTC
Created attachment 1748 [details]
The pasted example as file for earsier access...
The bug still appears in khtml-2003-06-03.
Subject: kdelibs/khtml CVS commit by zrusin: correctly compue the height for relatively positioned objects with percentage based dimensions - pretty much a merge from safari CCMAIL: 53902-done@bugs.kde.org M +5 -0 ChangeLog 1.93 M +22 -5 rendering/render_box.cpp 1.221 --- kdelibs/khtml/rendering/render_box.cpp #1.220:1.221 @@ -782,6 +782,24 @@ void RenderBox::calcHeight() fh = h.value() + borderTop() + paddingTop() + borderBottom() + paddingBottom(); else if (h.isPercent()) { + // Handle a common case: nested 100% height <div>s. + // This is kind of a one-off hack rather than doing it right. + // Makes dbaron's z-index root bg testcases work. Bad dave. - dwh + RenderBlock* cb = containingBlock(); Length ch = containingBlock()->style()->height(); - if (ch.isFixed()) + while (cb && !cb->isTableCell() && ch.isPercent() && ch.value() == 100) { + cb = cb->containingBlock(); + ch = cb->style()->height(); + } + + if (cb->isCanvas()) { + // Don't allow this to affect the canvas' m_height member variable, since this + // can get called while the canvas is still laying out its kids. + // e.g., <html style="height:100%">etc. -dwh + int oldHeight = cb->height(); + static_cast<RenderCanvas*>(cb)->calcHeight(); + fh = h.width(cb->height()) + borderTop() + paddingTop() + borderBottom() + paddingBottom(); + cb->setHeight(oldHeight); + } + else if (ch.isFixed()) fh = h.width(ch.value()) + borderTop() + paddingTop() + borderBottom() + paddingBottom(); } @@ -1189,6 +1207,5 @@ void RenderBox::calcAbsoluteVertical() m_y = t + mt; - //qDebug("v: h=%d, t=%d, b=%d, mt=%d, mb=%d, m_y=%d",h,t,b,mt,mb,m_y); - + //qDebug("v: m_height = %d, h=%d, t=%d, b=%d, mt=%d, mb=%d, m_y=%d",m_height,h,t,b,mt,mb,m_y); } --- kdelibs/khtml/ChangeLog #1.92:1.93 @@ -1,2 +1,7 @@ +2003-11-15 Zack Rusin <zack@kde.org> + + * rendering/render_box.cpp (calcHeight): correctly compute the + height for relatively positioned object with percentage based + dimensions - pretty much a merge from safari (#53902) 2003-11-14 Germain Garand <germain@ebooksfrance.org> |