From 07edd7823389f7dd94be9fff10b382f910795034 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Tue, 20 Jul 1999 04:16:56 +0000 Subject: [PATCH] Fix for bug #10176: changed ConstructFrameByDisplayType() to be smarter when handling relatively positioned elements git-svn-id: svn://10.0.0.236/trunk@40232 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 8 ++++++-- mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 85bb5cdf098..2470c84b700 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -3425,9 +3425,13 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre } } // See if it's relatively positioned - else if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { + else if ((NS_STYLE_POSITION_RELATIVE == position->mPosition) && + ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) || + (NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay) || + (NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) { // Is it block-level or inline-level? - if (NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) { + if ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) && + (NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay)) { // Create a wrapper frame. No space manager, though NS_NewRelativeItemWrapperFrame(&newFrame); } else { diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 85bb5cdf098..2470c84b700 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3425,9 +3425,13 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre } } // See if it's relatively positioned - else if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { + else if ((NS_STYLE_POSITION_RELATIVE == position->mPosition) && + ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) || + (NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay) || + (NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) { // Is it block-level or inline-level? - if (NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) { + if ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) && + (NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay)) { // Create a wrapper frame. No space manager, though NS_NewRelativeItemWrapperFrame(&newFrame); } else {