From b115bc7d044cd0e5358be6d9724c92cd90293688 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Sun, 23 Apr 2000 04:33:23 +0000 Subject: [PATCH] Changed SyncFrameViewAfterReflow() to consider out-of-flow frames as block-level as well. This covers the case where a floated or absolutely positioned frame has its 'display' value set to 'inline' and so we didn't recognise it as block-level --- layout/generic/nsContainerFrame.cpp | 8 ++++++-- layout/html/base/src/nsContainerFrame.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 5042d7ccd4da..74167d95d023 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -517,10 +517,14 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext, // element // - 'overflow-clip' which only applies to block-level elements and replaced // elements that have 'overflow' set to 'hidden'. 'overflow-clip' is relative - // to the content area and applies to content only (not border or background) + // to the content area and applies to content only (not border or background). + // Note that out-of-flow frames like floated or absolutely positioned frames + // are block-level, but we can't rely on the 'display' value being set correctly + // in the style context... PRBool hasClip, hasOverflowClip; + PRBool isBlockLevel = display->IsBlockLevel() || (0 != (kidState & NS_FRAME_OUT_OF_FLOW)); hasClip = position->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT); - hasOverflowClip = display->IsBlockLevel() && (display->mOverflow == NS_STYLE_OVERFLOW_HIDDEN); + hasOverflowClip = isBlockLevel && (display->mOverflow == NS_STYLE_OVERFLOW_HIDDEN); if (hasClip || hasOverflowClip) { nsRect clipRect, overflowClipRect; diff --git a/layout/html/base/src/nsContainerFrame.cpp b/layout/html/base/src/nsContainerFrame.cpp index 5042d7ccd4da..74167d95d023 100644 --- a/layout/html/base/src/nsContainerFrame.cpp +++ b/layout/html/base/src/nsContainerFrame.cpp @@ -517,10 +517,14 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext, // element // - 'overflow-clip' which only applies to block-level elements and replaced // elements that have 'overflow' set to 'hidden'. 'overflow-clip' is relative - // to the content area and applies to content only (not border or background) + // to the content area and applies to content only (not border or background). + // Note that out-of-flow frames like floated or absolutely positioned frames + // are block-level, but we can't rely on the 'display' value being set correctly + // in the style context... PRBool hasClip, hasOverflowClip; + PRBool isBlockLevel = display->IsBlockLevel() || (0 != (kidState & NS_FRAME_OUT_OF_FLOW)); hasClip = position->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT); - hasOverflowClip = display->IsBlockLevel() && (display->mOverflow == NS_STYLE_OVERFLOW_HIDDEN); + hasOverflowClip = isBlockLevel && (display->mOverflow == NS_STYLE_OVERFLOW_HIDDEN); if (hasClip || hasOverflowClip) { nsRect clipRect, overflowClipRect;