[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-06 15:56:52
[Download RAW message or body]

> Thanks, applied.
> However, 2 seconds after applying I had a thought: doesn't this patch 
> mean that people who use the "smart" policy will simply see their form NOT
> submitted, with no explanation why, if it would pop up another window? I
> wonder if this is the best choice - I mean, although I don't like popups, if
> I have to send some information, I have to do it, even if it will pop up a
> window.... Maybe we could post the form to the current window (clearing
> "target"), but this hack might break some sites of course....      

You're right, "smart" might break some sites this way. Actually, 
isWindowOpenAllowed() which is used for the window.open() checks works great 
for form submits as well. I added a call to it,  if the policy is "smart". I 
tried this on a testcase and it seems to work nicely.

Some kind of feedback that a window has been blocked, like the status bar icon 
in Mozilla Firebird, might be a nice feature.

The new patch is attached.

regards,

Ralf



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

--- /home/ralf/kjs_html.cpp	2003-06-06 17:35:12.000000000 +0200
+++ ecma/kjs_html.cpp	2003-06-06 14:10:21.000000000 +0200
@@ -2147,11 +2147,16 @@ Value KJS::HTMLElementFunction::tryCall(
                    i18n( "Confirmation: JavaScript Popup" ) ) == KMessageBox::Yes ) 
               block = false;
 	    
+          } else if ( block && policy == KHTMLSettings::KJSWindowOpenSmart ) {
+            if( static_cast<KJS::ScriptInterpreter *>(exec->interpreter())->isWindowOpenAllowed() ) {
+              // This submission has been triggered by the user
+              block = false;
+            }
           }
         }
 
         if( !block ) 
-	  form.submit();
+          form.submit();
 
         return Undefined();
       }


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

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