Bug 136441. Don't let floating views get clipped by non-floating parents. r=kmcclusk,sr=attinasi

This commit is contained in:
roc+%cs.cmu.edu 2002-05-30 01:42:41 +00:00
parent 4b7fb0a1f7
commit d455318206
2 changed files with 6 additions and 2 deletions

View File

@ -1022,10 +1022,12 @@ NS_IMETHODIMP nsView::GetClippedRect(nsRect& aClippedRect, PRBool& aIsClipped, P
GetBounds(aClippedRect);
nsView* parentView = GetParent();
PRBool lastViewIsFloating = GetFloating();
// Walk all of the way up the views to see if any
// ancestor sets the NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN
while (parentView) {
// ancestor sets the NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN.
// don't consider non-floating ancestors of a floating view.
while (parentView && (!lastViewIsFloating || parentView->GetFloating())) {
if ((parentView->GetViewFlags() & NS_VIEW_FLAG_CLIPCHILDREN) != 0) {
aIsClipped = PR_TRUE;
// Adjust for clip specified by ancestor
@ -1049,6 +1051,7 @@ NS_IMETHODIMP nsView::GetClippedRect(nsRect& aClippedRect, PRBool& aIsClipped, P
parentView->ConvertFromParentCoords(&ancestorX, &ancestorY);
lastViewIsFloating = parentView->GetFloating();
parentView = parentView->GetParent();
}

View File

@ -299,6 +299,7 @@ public: // NOT in nsIView, so only available in view module
nsViewManager* GetViewManager() const { return mViewManager; }
nsViewVisibility GetVisibility() const { return mVis; }
void* GetClientData() const { return mClientData; }
PRBool GetFloating() const { return (mVFlags & NS_VIEW_FLAG_FLOATING) != 0; }
PRInt32 GetChildCount() const { return mNumKids; }
nsView* GetChild(PRInt32 aIndex) const;