DeCOMtaminate nsIFrame::GetView and SetView, and add HasView, GetClosestView, and AreAncestorViewsVisible to consolidate common patterns. b=208004 r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@143960 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2003-06-19 23:44:01 +00:00
parent 10062c06df
commit 519cf3b3d3
102 changed files with 698 additions and 1530 deletions

View File

@@ -2990,30 +2990,29 @@ nsHTMLDocument::GetPixelDimensions(nsIPresShell* aShell,
nsCOMPtr<nsIPresContext> presContext;
aShell->GetPresContext(getter_AddRefs(presContext));
rv = frame->GetView(presContext, &view);
if (NS_SUCCEEDED(rv)) {
// If we have a view check if it's scrollable. If not,
// just use the view size itself
if (view) {
nsIScrollableView* scrollableView = nsnull;
CallQueryInterface(view, &scrollableView);
view = frame->GetView(presContext);
if (scrollableView) {
scrollableView->GetScrolledView(view);
}
// If we have a view check if it's scrollable. If not,
// just use the view size itself
if (view) {
nsIScrollableView* scrollableView = nsnull;
CallQueryInterface(view, &scrollableView);
nsRect r;
rv = view->GetBounds(r);
if (NS_SUCCEEDED(rv)) {
size.height = r.height;
size.width = r.width;
}
if (scrollableView) {
scrollableView->GetScrolledView(view);
}
// If we don't have a view, use the frame size
else {
rv = frame->GetSize(size);
nsRect r;
rv = view->GetBounds(r);
if (NS_SUCCEEDED(rv)) {
size.height = r.height;
size.width = r.width;
}
}
// If we don't have a view, use the frame size
else {
rv = frame->GetSize(size);
}
// Convert from twips to pixels
if (NS_SUCCEEDED(rv)) {