Jacek Caban : mshtml: Call FireBeforeNavigate2 for navigation in frames and iframes.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 11 10:28:10 CST 2015


Module: wine
Branch: master
Commit: 9e2a446fad0b2cd78c4efacb3ee77a3fd925c0b2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9e2a446fad0b2cd78c4efacb3ee77a3fd925c0b2

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Feb 11 13:06:04 2015 +0100

mshtml: Call FireBeforeNavigate2 for navigation in frames and iframes.

---

 dlls/mshtml/navigate.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 878e582..c2d4603 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -2245,23 +2245,32 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
 
     TRACE("%s\n", debugstr_w(display_uri));
 
-    if(window->doc_obj && window->doc_obj->webbrowser && window == window->doc_obj->basedoc.window) {
+    if(window->doc_obj && window->doc_obj->webbrowser) {
         DWORD post_data_len = request_data ? request_data->post_data_len : 0;
         void *post_data = post_data_len ? request_data->post_data : NULL;
         const WCHAR *headers = request_data ? request_data->headers : NULL;
 
         if(!(flags & BINDING_REFRESH)) {
+            BSTR frame_name = NULL;
             BOOL cancel = FALSE;
 
+            if(window != window->doc_obj->basedoc.window) {
+                hres = IHTMLWindow2_get_name(&window->base.IHTMLWindow2_iface, &frame_name);
+                if(FAILED(hres))
+                    return hres;
+            }
+
             hres = IDocObjectService_FireBeforeNavigate2(window->doc_obj->doc_object_service, NULL, display_uri, 0x40,
-                    NULL, post_data, post_data_len ? post_data_len+1 : 0, headers, TRUE, &cancel);
+                    frame_name, post_data, post_data_len ? post_data_len+1 : 0, headers, TRUE, &cancel);
+            SysFreeString(frame_name);
             if(SUCCEEDED(hres) && cancel) {
                 TRACE("Navigation canceled\n");
                 return S_OK;
             }
         }
 
-        return super_navigate(window, uri, flags, headers, post_data, post_data_len);
+        if(window == window->doc_obj->basedoc.window)
+            return super_navigate(window, uri, flags, headers, post_data, post_data_len);
     }
 
     if(window->doc_obj && window == window->doc_obj->basedoc.window) {




More information about the wine-cvs mailing list