From abe52a17bfce6ddd0f4dd83cfea64129030adbbd Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Sat, 26 Aug 2000 02:52:09 +0000 Subject: [PATCH] Bug #44253 --> if a docshell doesn't have a parent content listener then change the default for IsPreferred to return the value of CanHandle. This makes it easier for content developers to use browser and iframe tags since they don't have to implement nsIURIContentListener explicilty to get correct loading behavior. r=valeski --- docshell/base/nsDSURIContentListener.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index e210db56ae1..06e004243c7 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -119,7 +119,16 @@ NS_IMETHODIMP nsDSURIContentListener::IsPreferred(const char* aContentType, return mParentContentListener->IsPreferred(aContentType, aCommand, aWindowTarget, aDesiredContentType, aCanHandle); else - *aCanHandle = PR_FALSE; + { + // we used to return false here if we didn't have a parent properly registered at the top of + // the docshell hierarchy to dictate what content types this docshell should be a preferred handler for. + // But this really makes it hard for developers using iframe or browser tags because then they need to + // make sure they implement nsIURIContentListener otherwise all link clicks would get sent to another window + // because we said we weren't the preferred handler type. I'm going to change the default now...if we can handle the + // content, and someone didn't EXPLICITLY set a nsIURIContentListener at the top of our docshell chain, then we'll + // now always attempt to process the content ourselves... + return CanHandleContent(aContentType, aCommand, aWindowTarget, aDesiredContentType, aCanHandle); + } return NS_OK; }