Changed GetAbsoluteContainingBlock() to return relatively positioned

block-level and inline-level elements as well
This commit is contained in:
troy%netscape.com 1999-04-20 22:08:33 +00:00
Родитель 3ded352521
Коммит f7a4d96d6e
2 изменённых файлов: 14 добавлений и 8 удалений

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

@ -3466,14 +3466,16 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIPresContext* aPresContext,
{
NS_PRECONDITION(nsnull != mInitialContainingBlock, "no initial containing block");
// Starting with aFrame, look for a frame that is absolutely positioned
// Starting with aFrame, look for a frame that is absolutely positioned or
// relatively positioned
nsIFrame* containingBlock = nsnull;
for (nsIFrame* frame = aFrame; frame; frame->GetParent(&frame)) {
const nsStylePosition* position;
// Is it absolutely positioned?
// Is it positioned?
frame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
if (position->mPosition == NS_STYLE_POSITION_ABSOLUTE) {
if ((position->mPosition == NS_STYLE_POSITION_ABSOLUTE) ||
(position->mPosition == NS_STYLE_POSITION_RELATIVE)) {
const nsStyleDisplay* display;
// If it's a table then ignore it, because for the time being tables
@ -3495,7 +3497,8 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIPresContext* aPresContext,
}
}
} else if (nsLayoutAtoms::areaFrame == frameType) {
} else if ((nsLayoutAtoms::areaFrame == frameType) ||
(nsLayoutAtoms::positionedInlineFrame == frameType)) {
containingBlock = frame;
}
NS_RELEASE(frameType);

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

@ -3466,14 +3466,16 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIPresContext* aPresContext,
{
NS_PRECONDITION(nsnull != mInitialContainingBlock, "no initial containing block");
// Starting with aFrame, look for a frame that is absolutely positioned
// Starting with aFrame, look for a frame that is absolutely positioned or
// relatively positioned
nsIFrame* containingBlock = nsnull;
for (nsIFrame* frame = aFrame; frame; frame->GetParent(&frame)) {
const nsStylePosition* position;
// Is it absolutely positioned?
// Is it positioned?
frame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
if (position->mPosition == NS_STYLE_POSITION_ABSOLUTE) {
if ((position->mPosition == NS_STYLE_POSITION_ABSOLUTE) ||
(position->mPosition == NS_STYLE_POSITION_RELATIVE)) {
const nsStyleDisplay* display;
// If it's a table then ignore it, because for the time being tables
@ -3495,7 +3497,8 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIPresContext* aPresContext,
}
}
} else if (nsLayoutAtoms::areaFrame == frameType) {
} else if ((nsLayoutAtoms::areaFrame == frameType) ||
(nsLayoutAtoms::positionedInlineFrame == frameType)) {
containingBlock = frame;
}
NS_RELEASE(frameType);