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

This commit is contained in:
dbaron%dbaron.org 2006-05-17 02:37:59 +00:00
parent 35ff46488c
commit 02423381a1
2 changed files with 4 additions and 6 deletions

View File

@ -151,9 +151,8 @@ inFlasher::RepaintElement(nsIDOMElement* aElement)
nsIFrame* parentWithView = nsnull; nsIFrame* parentWithView = nsnull;
frame->GetParentWithView(pcontext, &parentWithView); frame->GetParentWithView(pcontext, &parentWithView);
if (parentWithView) { if (parentWithView) {
nsIView* view = nsnull; nsIView* view = parentWithView->GetViewExternal(pcontext);
nsresult rv= parentWithView->GetView(pcontext, &view); if (view) {
if (NS_SUCCEEDED(rv) && view) {
nsCOMPtr<nsIViewManager> viewManager; nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager)); view->GetViewManager(*getter_AddRefs(viewManager));
if (viewManager) { if (viewManager) {

View File

@ -199,9 +199,8 @@ inLayoutUtils::GetScreenOrigin(nsIDOMElement* aElement)
while (frame) { while (frame) {
// Look for a widget so we can get screen coordinates // Look for a widget so we can get screen coordinates
nsIView* view = nsnull; nsIView* view = frame->GetViewExternal(presContext);
rv = frame->GetView(presContext, &view); if (view) {
if (NS_SUCCEEDED(rv) && view) {
rv = view->GetWidget(*getter_AddRefs(widget)); rv = view->GetWidget(*getter_AddRefs(widget));
if (widget) if (widget)
break; break;