[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: [PATCH] JS Form Popups
From:       Ralf Hoelzer <ralf () well ! com>
Date:       2003-06-14 17:05:58
[Download RAW message or body]

Here's another small patch to improve the popup blocking. Now nested framesets
are also searched for the target frame.

I also wanted to make the special targets (_top, etc.) case-insensitive but it 
doesn't work. Is this case-sensitive on purpose? Mozilla is case-insenstive. 
The code in khtml_part.cpp calls lower() first, but it doesn't seem to work:

<snip>
  QString frameName = args.frameName.lower();
  if ( !frameName.isEmpty() )
  {
    if ( frameName == QString::fromLatin1( "_top" ) )
    {
      emit d->m_extension->openURLRequest( url, args );
      return;
    }
...
</snip>

but <a href="http://cnn.com" target="_TOP">Test</a> creates a new window.

regards,

Ralf


["popup3.patch" (text/x-diff)]

Index: ecma/kjs_html.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/ecma/kjs_html.cpp,v
retrieving revision 1.249
diff -u -p -r1.249 kjs_html.cpp
--- ecma/kjs_html.cpp	12 Jun 2003 23:16:58 -0000	1.249
+++ ecma/kjs_html.cpp	14 Jun 2003 16:52:05 -0000
@@ -2131,9 +2131,13 @@ Value KJS::HTMLElementFunction::tryCall(
             block = false;
 
           // if there is a frame with the target name, don't block
-          if ( (view && view->part() && view->part()->parentPart())   ) {
-            if( view->part()->parentPart()->frameExists( form.target().string() ) ) {
-	      block = false;
+          if ( view && view->part() )  {
+            // search all (possibly nested) framesets
+            KHTMLPart *currentPart = view->part()->parentPart();
+            while( currentPart != 0L ) {
+              if( currentPart->frameExists( form.target().string() ) ) 
+                block = false;
+              currentPart = currentPart->parentPart();
             }
           }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic