From 837273571ed084e095c1bdc80139fbdaeaf85f73 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 13 Apr 2000 20:10:06 +0000 Subject: [PATCH] fix anonymous content child location to handle the case where a scroll frame may be in the way. r=hyatt. --- layout/base/nsCSSFrameConstructor.cpp | 8 +++++++- layout/html/style/src/nsCSSFrameConstructor.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index aa04b078f76..91c478d384b 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4958,7 +4958,13 @@ static void LocateAnonymousFrame(nsIPresContext* aPresContext, nsCOMPtr content; aParentFrame->GetContent(getter_AddRefs(content)); if (content.get() == aTargetContent) { - *aResult = aParentFrame; + // We must take into account if the parent is a scrollframe. If it is, we + // need to bypass the scrolling mechanics and get at the true frame. + nsCOMPtr scrollFrame ( do_QueryInterface(aParentFrame) ); + if ( scrollFrame ) + scrollFrame->GetScrolledFrame ( aPresContext, *aResult ); + else + *aResult = aParentFrame; return; } diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index aa04b078f76..91c478d384b 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -4958,7 +4958,13 @@ static void LocateAnonymousFrame(nsIPresContext* aPresContext, nsCOMPtr content; aParentFrame->GetContent(getter_AddRefs(content)); if (content.get() == aTargetContent) { - *aResult = aParentFrame; + // We must take into account if the parent is a scrollframe. If it is, we + // need to bypass the scrolling mechanics and get at the true frame. + nsCOMPtr scrollFrame ( do_QueryInterface(aParentFrame) ); + if ( scrollFrame ) + scrollFrame->GetScrolledFrame ( aPresContext, *aResult ); + else + *aResult = aParentFrame; return; }