From cd79fa35059c18f1fae2e298896e73f14f8d367c Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Sat, 3 Apr 1999 21:54:32 +0000 Subject: [PATCH] Set link handler so that style resolves properly for links around things like images --- layout/base/nsPresShell.cpp | 8 ++++++++ layout/html/base/src/nsPresShell.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 9102aaa48962..089f2a5df1de 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2112,6 +2112,7 @@ PresShell::ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight) #include "nsIScrollableView.h" #include "nsIDeviceContext.h" #include "nsIURL.h" +#include "nsILinkHandler.h" static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID); static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID); @@ -2119,6 +2120,7 @@ static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID); static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID); static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID); +static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID); static void LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg) @@ -2412,6 +2414,12 @@ PresShell::VerifyIncrementalReflow() if (NS_SUCCEEDED(mPresContext->GetContainer(&container)) && (nsnull != container)) { cx->SetContainer(container); + nsILinkHandler* lh; + if (NS_SUCCEEDED(container->QueryInterface(kILinkHandlerIID, + (void**)&lh))) { + cx->SetLinkHandler(lh); + NS_RELEASE(lh); + } NS_RELEASE(container); } #endif diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 9102aaa48962..089f2a5df1de 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -2112,6 +2112,7 @@ PresShell::ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight) #include "nsIScrollableView.h" #include "nsIDeviceContext.h" #include "nsIURL.h" +#include "nsILinkHandler.h" static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID); static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID); @@ -2119,6 +2120,7 @@ static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID); static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID); static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID); +static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID); static void LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg) @@ -2412,6 +2414,12 @@ PresShell::VerifyIncrementalReflow() if (NS_SUCCEEDED(mPresContext->GetContainer(&container)) && (nsnull != container)) { cx->SetContainer(container); + nsILinkHandler* lh; + if (NS_SUCCEEDED(container->QueryInterface(kILinkHandlerIID, + (void**)&lh))) { + cx->SetLinkHandler(lh); + NS_RELEASE(lh); + } NS_RELEASE(container); } #endif