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
This commit is contained in:
troy%netscape.com 2000-04-23 04:33:23 +00:00
Родитель 6a458548a3
Коммит b115bc7d04
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;