Fix FindPrimaryFrameFor regression: when previous sibling is out-of-flow, start search from previous sibling's placeholder. b=145224 sr=waterson r=bzbarsky

This commit is contained in:
dbaron%fas.harvard.edu 2002-05-26 17:07:07 +00:00
Родитель 32a2ec0527
Коммит eccd0e0edf
2 изменённых файлов: 28 добавлений и 6 удалений

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

@ -11790,9 +11790,20 @@ nsCSSFrameConstructor::FindFrameWithContent(nsIPresContext* aPresContext,
#ifdef NOISY_FINDFRAME
printf(" hint frame is %p\n", aHint->mPrimaryFrameForPrevSibling);
#endif
kidFrame = aHint->mPrimaryFrameForPrevSibling; // start with the primary frame for aContent's previous sibling
if (kidFrame) { // if we have this
kidFrame->GetNextSibling(&kidFrame); // then use the next sibling frame as our starting point
// start with the primary frame for aContent's previous sibling
kidFrame = aHint->mPrimaryFrameForPrevSibling;
// But if it's out of flow, start from its placeholder.
if (kidFrame) {
nsFrameState kidState;
kidFrame->GetFrameState(&kidState);
if (kidState & NS_FRAME_OUT_OF_FLOW) {
aFrameManager->GetPlaceholderFrameFor(kidFrame, &kidFrame);
}
}
if (kidFrame) {
// then use the next sibling frame as our starting point
kidFrame->GetNextSibling(&kidFrame);
if (!kidFrame)
{ // the hint frame had no next frame. try the next-in-flow fo the parent of the hint frame
// if there is one

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

@ -11790,9 +11790,20 @@ nsCSSFrameConstructor::FindFrameWithContent(nsIPresContext* aPresContext,
#ifdef NOISY_FINDFRAME
printf(" hint frame is %p\n", aHint->mPrimaryFrameForPrevSibling);
#endif
kidFrame = aHint->mPrimaryFrameForPrevSibling; // start with the primary frame for aContent's previous sibling
if (kidFrame) { // if we have this
kidFrame->GetNextSibling(&kidFrame); // then use the next sibling frame as our starting point
// start with the primary frame for aContent's previous sibling
kidFrame = aHint->mPrimaryFrameForPrevSibling;
// But if it's out of flow, start from its placeholder.
if (kidFrame) {
nsFrameState kidState;
kidFrame->GetFrameState(&kidState);
if (kidState & NS_FRAME_OUT_OF_FLOW) {
aFrameManager->GetPlaceholderFrameFor(kidFrame, &kidFrame);
}
}
if (kidFrame) {
// then use the next sibling frame as our starting point
kidFrame->GetNextSibling(&kidFrame);
if (!kidFrame)
{ // the hint frame had no next frame. try the next-in-flow fo the parent of the hint frame
// if there is one