Closed
Bug 11577
Opened 25 years ago
Closed 25 years ago
[regression] reading from <any frame>.location causes function to exit sliently
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
M9
People
(Reporter: alecf, Assigned: radha)
References
Details
(Whiteboard: Fixed.)
If I have the following code:
function foo() {
dump("Finding frame\n");
var destFrame = window.frames["destframe"];
dump("Looking at location\n");
var loc = destFrame.location;
dump("Location is " + loc);
}
the 4th line of the function (var loc = ...) will cause this function to exit
sliently.
I have verified that destFrame is actually the correct frame (and it is an
[object Window])
I can say destFrame.location="my-url.html" and this will load a new page just
fine. It's just reading from this attribute that is busted.
Reporter | ||
Comment 1•25 years ago
|
||
this is preventing the account manager from being useful.
Reporter | ||
Updated•25 years ago
|
Summary: reading from <any frame>.location causes function to exit sliently → [regression] reading from <any frame>.location causes function to exit sliently
Reporter | ||
Comment 2•25 years ago
|
||
oh yes, and I forgot to add that this used to work. marking as a regression
Comment 3•25 years ago
|
||
slamm and I were looking at this, but it seems to have been fixed in the last
day or so. I never saw this on my build before Tuesday (my DOM idlc-generated
changes were checked in Monday night). Yet it isn't clear what might have fixed
it, from looking at bonsai query results. Alec, is it still happening with a
fresh pull?
/be
Reporter | ||
Comment 4•25 years ago
|
||
I'll try now..
Comment 5•25 years ago
|
||
I repulled and built windows and I see the problem. I also rebuilt linux and I
continue to see the bug there.
Comment 6•25 years ago
|
||
More details on my windows build...
The bug only shows up in viewer. Apprunner executes window.location just fine.
Comment 7•25 years ago
|
||
For Windows apprunner, window.location causes silent death if it is referenced
from one of the sidebar panels. The sidebar panels are currently un-sandboxed
iframes. On windows, window.location does work in the main viewing frame which
is a sandboxed content iframe (i.e. type="content").
Reporter | ||
Comment 8•25 years ago
|
||
yes! My use of .location also was from inside an IFRAME. I guess that's a little
more information..
vidur, we have not heard a word back from you... are you the right person for
this bug or should we reassign?
Comment 9•25 years ago
|
||
vidur is out this week.
Reporter | ||
Comment 10•25 years ago
|
||
damn, I always seem to file bugs on people the week they're on vacation! :)
Comment 11•25 years ago
|
||
Unfortunately, I'm not working with any code that's actually checked in yet but I
reproduced this problem by adding the following to tasksOverlay.js:
function toImport() {
dump( "window.location: " + top.window.location + "\n");
... code to open a dialog window...
}
Selecting "Import Utility" from the tools submenu of the Tasks menu executes the
function. The dump string never appears and no JS code after it is executed.
I have no idea if this adds weight to the iframe info or not!
(Note: I do use window.location in an iframe which is where I first noticed the
problem.)
Updated•25 years ago
|
Target Milestone: M9
Comment 12•25 years ago
|
||
talking with brendan we need to get this for m9 if we can. putting on the radar
Comment 13•25 years ago
|
||
I debugged this with brendan. We found an unched call GetURL in nsLocation.cpp.
Looks like it is related to session history.
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsblame.cgi?file=mozilla/dom/src/base/nsLocation.cpp&rev=1.20&mark=360#351
Did Radha or anyone else make changes to session history lately?
The call to GetHistoryIndex is returning 15 which seems unreasonably high.
Updated•25 years ago
|
Assignee: vidur → radha
Comment 14•25 years ago
|
||
Reassigning to radha. She touched the history code in nsWebShell.cpp on August 8
which is just right for when this bug appear.
Comment 15•25 years ago
|
||
radha came up with a fix. Instead of using session history to get the current
url, it will ask the webshell for its current url. It make sense to do it this
way.
Unfortunately, my code crashes now. Radha and I are looking into the second
crash. The crash only happens when I use the sidebar panels for the marketing
demo.
Assignee | ||
Updated•25 years ago
|
Whiteboard: Need fix in hand. Need code review from brendan
Assignee | ||
Comment 16•25 years ago
|
||
OK. I looked at this with slamm. To get the href for the current page,
LocationImpl::GetHref() seems to go thro the session History which doesn't get
defined for all *non browser* windows example, the sidebar panel. A reasonable
fix to this problem is, to call mWebShell->GetURL(PRUnichar ** aURL) instead of
get the current history index and get the url for the current index which is the
same as GetUrl().
Myself and slamm tried this out in windows and linux and it works. I would like
Brendan's opinion if any on this.
Following are the diffs,
RCS file: /cvsroot/mozilla/dom/src/base/nsLocation.cpp,v
retrieving revision 1.20
diff -r1.20 nsLocation.cpp
360,361c360,361
< mWebShell->GetHistoryIndex(index);
< result = mWebShell->GetURL(index, &href);
---
> //mWebShell->GetHistoryIndex(index);
> result = mWebShell->GetURL(&href);
Slamm is seeing another crash after clearing this problem. I'm looking at it for
him
Comment 17•25 years ago
|
||
Looks good to me. I believe the history mechanism was the only way to do this
when I originally wrote the code. nsIWebShell::GetURL() was a more recent
addition.
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Whiteboard: Need fix in hand. Need code review from brendan → Have fix in hand.
Assignee | ||
Comment 18•25 years ago
|
||
I'm going to put the old session history code back in webshell so that everybody
will be happy.
Assignee | ||
Comment 19•25 years ago
|
||
*** Bug 11877 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 20•25 years ago
|
||
*** Bug 11690 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: Have fix in hand. → Fixed.
Assignee | ||
Comment 21•25 years ago
|
||
Have checked in the fix approved by vidur.
*** Bug 11960 has been marked as a duplicate of this bug. ***
Comment 23•25 years ago
|
||
*** Bug 11941 has been marked as a duplicate of this bug. ***
Comment 24•25 years ago
|
||
Alec, can you help us verify this bug? Please mark it as Verified if you agree
the resolution is correct. Thanks!
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 25•25 years ago
|
||
yes, it works for me now, marking verified.
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•