error.
Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
all inlines when repainting.
Reviewed by rjw
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::layoutBlockChildren):
* khtml/rendering/render_flow.cpp:
(RenderFlow::getAbsoluteRepaintRect):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8177
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-12-09 David Hyatt <hyatt@apple.com>
+
+ Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
+ error.
+
+ Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
+ all inlines when repainting.
+
+ Reviewed by rjw
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::layoutBlockChildren):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::getAbsoluteRepaintRect):
+
2004-12-09 David Hyatt <hyatt@apple.com>
Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
determineHorizontalPosition(child);
// Update our top overflow in case the child spills out the top of the block.
- m_overflowTop = kMin(m_overflowTop, child->yPos() - child->overflowTop(false));
+ m_overflowTop = kMin(m_overflowTop, child->yPos() + child->overflowTop(false));
// Update our height now that the child has been placed in the correct position.
m_height += child->height();
// See if this child has made our overflow need to grow.
int rightChildPos = child->xPos() + kMax(child->overflowWidth(false), child->width());
m_overflowWidth = kMax(rightChildPos, m_overflowWidth);
- m_overflowLeft = kMin(child->xPos() - child->overflowLeft(false), m_overflowLeft);
+ m_overflowLeft = kMin(child->xPos() + child->overflowLeft(false), m_overflowLeft);
// Insert our compact into the block margin if we have one.
insertCompactIfNeeded(child, compactInfo);
int ow = style() ? style()->outlineSize() : 0;
if (isCompact())
left -= m_x;
- if (style()->position() == RELATIVE && m_layer)
- m_layer->relativePositionOffset(left, top);
+
+ // We need to add in the relative position offsets of any inlines (including us) up to our
+ // containing block.
+ RenderBlock* cb = containingBlock();
+ for (RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isInlineFlow() && inlineFlow != cb;
+ inlineFlow = inlineFlow->parent()) {
+ if (inlineFlow->style()->position() == RELATIVE && inlineFlow->layer())
+ inlineFlow->layer()->relativePositionOffset(left, top);
+ }
QRect r(-ow+left, -ow+top, width()+ow*2, height()+ow*2);
- RenderBlock* cb = containingBlock();
if (cb->hasOverflowClip()) {
// cb->height() is inaccurate if we're in the middle of a layout of |cb|, so use the
// layer's size instead. Even if the layer's size is wrong, the layer itself will repaint
QRect repaintRect(x, y, r.width(), r.height());
r = repaintRect.intersect(boxRect);
}
-
cb->computeAbsoluteRepaintRect(r);
if (ow) {