$OpenBSD: patch-khtml_khtml_part_cpp,v 1.4 2005/02/27 07:42:03 brad Exp $
--- khtml/khtml_part.cpp.orig	Sun Feb 27 02:32:27 2005
+++ khtml/khtml_part.cpp	Sun Feb 27 02:33:45 2005
@@ -4758,13 +4758,16 @@ KHTMLPart *
 KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame )
 {
 #ifdef DEBUG_FINDFRAME
-  kdDebug(6050) << "KHTMLPart::findFrameParent: this = " << this << " URL = " << m_url << " findFrameParent( " << f << " )" << endl;
+  kdDebug(6050) << "KHTMLPart::findFrameParent: this = " << this << " URL = " << m_url << " name = " << name() << " findFrameParent( " << f << " )" << endl;
 #endif
   // Check access
   KHTMLPart* const callingHtmlPart = dynamic_cast<KHTMLPart *>(callingPart);
 
   if (!checkFrameAccess(callingHtmlPart))
      return 0;
+
+  if (!childFrame && !parentPart() && (name() == f))
+     return this;
 
   FrameIt it = d->m_frames.find( f );
   const FrameIt end = d->m_frames.end();
