Fix for bug #10176: changed ConstructFrameByDisplayType() to be smarter

when handling relatively positioned elements
This commit is contained in:
troy%netscape.com 1999-07-20 04:16:56 +00:00
parent 6916443bd0
commit 8ee82be61f
2 changed files with 12 additions and 4 deletions

View File

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

View File

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