Contents of /trunk/mozilla-firefox/patches/mozilla-firefox-1.0.7-frameload.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1232 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1232 byte(s)
-import
1 | --- mozilla/embedding/browser/gtk/src/EmbedProgress.cpp.foo 2003-01-08 14:48:03.000000000 -0500 |
2 | +++ mozilla/embedding/browser/gtk/src/EmbedProgress.cpp 2004-04-22 13:42:42.000000000 -0400 |
3 | @@ -23,6 +23,8 @@ |
4 | |
5 | #include <nsXPIDLString.h> |
6 | #include <nsIChannel.h> |
7 | +#include <nsIWebProgress.h> |
8 | +#include <nsIDOMWindow.h> |
9 | |
10 | #include "nsIURI.h" |
11 | #include "nsCRT.h" |
12 | @@ -132,9 +134,29 @@ |
13 | NS_ENSURE_ARG_POINTER(aLocation); |
14 | aLocation->GetSpec(newURI); |
15 | |
16 | - mOwner->SetURI(newURI.get()); |
17 | - gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget), |
18 | - moz_embed_signals[LOCATION]); |
19 | + // Make sure that this is the primary frame change and not |
20 | + // just a subframe. |
21 | + PRBool isSubFrameLoad = PR_FALSE; |
22 | + if (aWebProgress) { |
23 | + nsCOMPtr<nsIDOMWindow> domWindow; |
24 | + nsCOMPtr<nsIDOMWindow> topDomWindow; |
25 | + |
26 | + aWebProgress->GetDOMWindow(getter_AddRefs(domWindow)); |
27 | + |
28 | + // get the root dom window |
29 | + if (domWindow) |
30 | + domWindow->GetTop(getter_AddRefs(topDomWindow)); |
31 | + |
32 | + if (domWindow != topDomWindow) |
33 | + isSubFrameLoad = PR_TRUE; |
34 | + } |
35 | + |
36 | + if (!isSubFrameLoad) { |
37 | + mOwner->SetURI(newURI.get()); |
38 | + gtk_signal_emit(GTK_OBJECT(mOwner->mOwningWidget), |
39 | + moz_embed_signals[LOCATION]); |
40 | + } |
41 | + |
42 | return NS_OK; |
43 | } |
44 |