Closed
Bug 101746
Opened 23 years ago
Closed 23 years ago
frames array has frames in incorrect order - Trunk [@ nsTextFrame::TextStyle::TextStyle]
Categories
(Core :: Layout: Images, Video, and HTML Frames, defect)
Core
Layout: Images, Video, and HTML Frames
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: Mitch, Assigned: hyatt)
References
()
Details
(Keywords: crash, topcrash)
Crash Data
Attachments
(7 files)
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:0.9.4+) Gecko/20010924
BuildID: 2001092422
I keep getting
Error: parent.frames[0].main_head has no properties
when i go to a secure banking site. I assume this means that
the site probably has broken javascript code, but this size
works if i go back to Mozilla 0.9.3. So somewhere in between
the javascript engine has gotten stricter.
I read there is an option to javascript (options.werror=false and
options.strict=false) in other java bugs but everytime i try and
execute these using the javascript console or loading a page with
those specific lines in a <script></script> block, i get
Error: options is not defined
My question is how do i get Mozilla to be more forgiving about
Javascript errors ? What is the incantation to switch off strict
javascript code checking and errors on warn ?
Reproducible: Always
Steps to Reproduce:
This is the code from the site when i click on the error message
in the Javascript console in Mozilla
// calling to include the Cookie.js file in this file
importCookieFile();
//funcion to import the cookie.js file
function importCookieFile()
{
document.write('<script src="/eBanking/mocha/cookie.js">' + '<\/script>');
}
//function to check the cookie and alert if cookie is set, before changing the
main head and body
function checkCreateAndChange(url1,url2) {
if (!(isCookieExists()))
{
createCookie();
parent.frames[0].main_head.location.href = url1;
parent.frames[0].main_body.location.href = url2; // always change the
location of the current window last
}
else
{
userAlert();
}
}
//function to change the main head and body of the page
function change(url1,url2)
{
parent.frames[0].main_head.location.href = url1;
parent.frames[0].main_body.location.href = url2; // always change the location of
the current window last
}
//function to check the cookie and alert if cookie is set, before changing the
main head, body and replacing doument's own url
function checkChangeAndReplace(url1,url2,url3)
{
if (isCookieExists())
{
userAlert();
}
else
{
parent.frames[0].main_head.location.href = url1;
parent.frames[0].main_body.location.href = url2; // always change the location of
the current window last
location.replace(url3);
}
}
Actual Results: Nothin in the browser window, but the following error in the
javascript console
Error: parent.frames[0].main_head has no properties
Expected Results: Refresh the frame in the page with a new URL.
Comment 1•23 years ago
|
||
Over to DOM0. Dave, is there a URL for this site? Just having the JS without
the surrounding frameset (if any) is not really useful...
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → desale
No unfortunately the URL is a secure banking site, so even if i
provided the URL you wouldn't be able to login (unless i gave you
my banking details).
Is there a way i can set Mozilla into a debugging state for Javascript
only to get a better idea of what's going on ? Is there a way for the
engine to save the code it's executing so we can see what's going on
behing the scenes
Comment 3•23 years ago
|
||
Dave, try going into
Edit > Preferences > Debug
turn on the "Enable JavaScript dump() output" and "Show strict JavaScript
warnings" checkboxes.
That might help some.. you could also save the html of the pages in question
(there may well be more than one) and attach to this bug using the
http://bugzilla.mozilla.org/createattachment.cgi?id=101746 link.
Ok, HTML from the www page are attached, but the JS code is not embedded
but read from an external file.
Strange thing thoug, after turning on Debug as you suggested, I now get
in my Javascript console multiple *warnings* of
Warning: reference to undefined property parennt.frames[0].main_head Line: 32
but alas this finally gets a
Error: parennt.frames[0].main_head has no prperties Line: 32
and the link still doesn't work.
So it is as i first thought. JavaScript warnings are being turned into fatal
errors and not being executed. I'm sure there is a user_pref() to do a
options.werror or options.error_on_warn to be false no ?
Which brings me to another RFE. Why isn't there a "Save to File" option
in the JavaScript Console window ? This would be *so* helpful !
Comment 10•23 years ago
|
||
dave: could you attach the source of the frameset itself as well?
Reporter | ||
Comment 11•23 years ago
|
||
How do i save the frameset ? Sorry for being stoopid, but i tried all
File->Save options etcc... ? How do i it ?
Comment 12•23 years ago
|
||
File > Save should save the frameset fine... also try right-clicking on page and
selecting "Save As..." (not "Save Frame As...")
Reporter | ||
Comment 13•23 years ago
|
||
Reporter | ||
Comment 14•23 years ago
|
||
Comment 15•23 years ago
|
||
Dave, thank you. Looks like the problem is that the site references nonexistent
frames. They define name="content" and name="side_nav_bar" and name="bottom".
Then they try to access main_head and main_body, which are not defined.
Over to evangelism. Could you please post the URL in this bug so we know which
site to contact?
Assignee: jst → bclary
Status: UNCONFIRMED → NEW
Component: DOM Level 0 → English: US
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: desale → zach
Version: other → unspecified
Reporter | ||
Comment 16•23 years ago
|
||
https://e-banking.abbeynational.co.uk/eBanking/myaccount/index.html
But, again to my initial question. This should not be considered fatal code
and it wasn't in Mozilla 0.9.3. Sure one should cater for this , or have
an option to ignore just log errors to javascript window and continue
regardless. Also how comes it works just fine in 0.9.3 if it is running the
same code and referencing noexistant frames ?
Comment 17•23 years ago
|
||
-> Europe West
Assignee: bclary → nitot
Component: English: US → Europe: West
QA Contact: zach → caillon
Summary: javascript fails to execute → abbeynational.co.uk - javascript fails to execute
Comment 18•23 years ago
|
||
Hmm.. the fact that it works in 0.9.3 is bothersome.. ccing
pschwartau@netscape.com. Phil? any ideas?
Updated•23 years ago
|
Whiteboard: [BANK]
Reporter | ||
Comment 19•23 years ago
|
||
Some more info..
Checked that the problem is reproduceable on Solaris and Linux builds, so
is not architecture/os dependent.
A good easy way to reproduce is
1. Bring up Mozilla 0.9.4 version
2. Open up javascript console window from Tasks->Tools->JavascriptConsole
3. Open URL https://e-banking.abbeynational.co.uk/eBanking/myaccount/index.html
Reporter | ||
Comment 20•23 years ago
|
||
Clicked Commit by accident on the last update, so carrying on..
after trying steps 1-3 above click on "balances" or "summary statements"
and you will get an error message in the Java console.
Try the same steps with Mozilla 0.9.3 or Netscape 4.7.x and it works
fine (although you don't get to my account balance or statement, clicking
the button takes you to another page and refreshes the frames as they
should).
Comment 21•23 years ago
|
||
Dave, thanks for the URL! We _do_ have a problem on this site....
The site is set up as follows:
<frameset rows="*,27">
<frameset cols="*,175">
<frame src="fr_myaccount.html" name="content">
<frame src="nav_myaccount.html" name="side_nav_bar">
</frameset>
<frame src="bottom_nav.html" name="bottom">
</frameset>
fr_myaccount.html is a frameset itself. It has:
<frameset rows="50,*">
<frame src="blank.html" name="main_head">
<frame src="mn_myaccount_body.html" name="main_body">
</frameset>
Now. evaluating in the top-level frameset (using javascript:alert(foo) in the
location bar) we have:
Mozilla:
frames.length = 3
frames[0].name = "bottom"
frames[1].name = "content"
frames[2].name = "side_nav_bar"
NS 4.x:
frames.length = 3
frames[0].name = "content"
frames[1].name = "side_nav_bar"
frames[2].name = "bottom"
So we have the frames in the wrong order in the frames array. And this is
indeed a regression since 0.9.3
Over to HTMLFrames. Dave, my apologies for all the flailing about up to this point.
Assignee: nitot → pollmann
Component: Europe: West → HTMLFrames
Keywords: regression
OS: Solaris → All
Product: Tech Evangelism → Browser
QA Contact: caillon → amar
Hardware: Sun → All
Summary: abbeynational.co.uk - javascript fails to execute → frames array has frames in incorrect order
Whiteboard: [BANK]
Version: unspecified → other
Comment 22•23 years ago
|
||
This may be causing the "back makes pages load in wrong frame" reports we've
been seeing....
Severity: normal → major
Keywords: nsbranch
Reporter | ||
Comment 23•23 years ago
|
||
No worries Boris about the flailing ;-)
Glad you found the problem.
Keywords: nsbranch,
regression
QA Contact: amar → caillon
Summary: frames array has frames in incorrect order → abbeynational.co.uk - javascript fails to execute
Whiteboard: [BANK]
Comment 24•23 years ago
|
||
Boris: THANKS!
Comment 25•23 years ago
|
||
This is imho a serious regression and we should send it to a real owner (as
opposed to a virtual one ;-)
Radha maybe? Who else does frames?
Updated•23 years ago
|
Summary: abbeynational.co.uk - javascript fails to execute → frames array has frames in incorrect order
Whiteboard: [BANK]
Comment 26•23 years ago
|
||
*** Bug 102458 has been marked as a duplicate of this bug. ***
Comment 27•23 years ago
|
||
reassigning to rods since pollman is no longer with us.
Assignee: pollmann → rods
Comment 29•23 years ago
|
||
I did some investigating... This is working correctly for me in 2001-09-18-08.
It's broken in 2001-09-18-21.
In fact, looks like this broke with hyatt's checkin for bug 49874. I backed
that out and this bug disappeared.
Reassigning to hyatt (yay more reassigning) as he should know what it was he
did.
Assignee: rods → hyatt
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
Comment 30•23 years ago
|
||
The problem is that frames add themselves to window.frames when their Init()
method is called with hyatt's change. Framesets don't call Init() on their
children till they are reflowed, however. So the thing to do is to move calls
to children's Init() methods into the Init() of the frameset... I tried this,
but the code is nsFramesetFrame::Reflow() too entangled for me to move the
Init() calls out easily (and I'm not trusting myself to make major changes here).
Assignee | ||
Comment 31•23 years ago
|
||
Ah, cool. I was wondering what the problem was here.
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.5
Assignee | ||
Comment 32•23 years ago
|
||
Comment on attachment 51660 [details] [diff] [review]
Proposed fix. Move init and creation of frames into frameset's init.
r=dbaron, although it would be good to test printing and you might want to
double-check that every frame only gets one initial reflow (I'm suspicious).
Attachment #51660 -
Flags: review+
Comment 35•23 years ago
|
||
I tested printing on win32 with this patch, and it doesn't do anything harmful
to the current state of printing frames (i.e., it's broken the same way :-(
the frameset is printed, in the right order, although parts of each document
are 'missing'.
I'll punt to hyatt on the question of reflows.
Comment 36•23 years ago
|
||
I'm pretty sure that you'll only get an initial reflow once, but,
+ PRBool firstTime = (eReflowReason_Initial == aReflowState.reason);
it might be better to check
PRBool firstTime = (mState & NS_FRAME_FIRST_REFLOW);
This ought to be set when the frame is created and cleared by the parent frame's
call to DidReflow().
Assignee | ||
Comment 37•23 years ago
|
||
They both seem to work just fine. I don't mind switching if we think it's safer.
Comment 38•23 years ago
|
||
Comment on attachment 51660 [details] [diff] [review]
Proposed fix. Move init and creation of frames into frameset's init.
sr=waterson
Attachment #51660 -
Flags: superreview+
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Assignee | ||
Comment 39•23 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 40•23 years ago
|
||
*** Bug 102778 has been marked as a duplicate of this bug. ***
Comment 41•23 years ago
|
||
updating with topcrash info for future reference, since topcrash bug 102778
was marked a dup of this one.
Updated•13 years ago
|
Crash Signature: [@ nsTextFrame::TextStyle::TextStyle]
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: HTML Frames → Layout: Images
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•