Closed Bug 35986 Opened 25 years ago Closed 24 years ago

document==NULL for FRAMEs created without SRC

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: vladnc, Assigned: pollmann)

References

()

Details

(Whiteboard: [nsbeta3+]fix in hand)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) BuildID: 2000041508 If a FRAME doesn't use the SRC option the window.frame_name.document property will be NULL. Reproducible: Always Steps to Reproduce: 1. Open http://www.edecon.ro/Test.html (Make sure you use the capital 'T', the site is powered by a case sensitive Unix/Apache server). Actual Results: The left frame, defined with a SRC="about:blank" option works, the right frame, defined without the SRC option, doesn't work (doesn't display anything). Expected Results: The left and right frames should work, not just the left frame. <html> <head> <script> function init () { alert (domains . document); alert (collections . document); domains . document . write ('<html><body>Test left!</body></html>'); collections . document . write ('<html><body>Test right!</body></html>'); alert ('Program works!'); } </script> </head> <frameset cols = "50%, *" onLoad = "init ()"> <frame name = "domains" src = "about:blank"> <frame name = "collections"> </frameset> </html>
Couldn't find anything in the spec about FRAME without SRC, so I suppose this should be handled intelligently.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Sounds like you have the right idea, but just to clarify, your test case as it is shouldn't work because "domains" is not defined in the default namespace for the javascript (it does work in IE because IE throws any ID's or name's into the default namespace, but this is not per the spec): alert (domains . document); alert (collections . document); domains . document . write ('<html><body>Test left!</body></html>'); collections . document . write ('<html><body>Test right!</body></html>'); This however should work: alert (window.frames.domains . document); alert (window.frames.collections . document); window.frames.domains . document . write ('<html><body>Test left!</body></html>'); window.frames.collections . document . write ('<html><body>Test right!</body></html>'); Will look into this when my build completes!
Three quotes from the "Client-Side JavaScript Guide v1.3": (http://developer.netscape.com/docs/manuals/js/client/jsguide/ClientGuideJS13.zi p) a) 'Omit the window name: Because the existence of the current window is assumed, you do not have to refer to the name of the window when you call its methods and assign its properties.' b) 'Example 3: refer to a frame in another window. The following statement refers to a frame named frame2 that is in a window named window2. The statement changes the background color of frame2 to violet. The frame name, frame2, must be specified in the FRAMESET tag that creates the frameset. window2.frame2.document.bgColor="violet"' c) 'JavaScript 1.3 is fully compatible with ECMA-262.' My conclusion: if window2 is the current window, it's legal to use frame2.document.bgColor="violet" So my test case was correct after all.
I stand corrected!
This problem actually seems more serious than not, so I'll try to get it in earlier rather than later. Thanks for following up!
Severity: minor → normal
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
Target Milestone: --- → M17
Also, if the frame has no src attribute mozilla does not keep it blank. Open two mozilla windows, one a regular one, the other with a frame with no src, then switch between them. The regular page bleeds onto the frame and gets "stuck" on it. Switching to a completely differnt app seems to blank it out again.
asmozilla, the behaviour you are seeing is bug 5569. We don't load a url into the frame if there is no src, so it doesn't paint and is left with garbage.
I have a one-line fix in hand that will set the src to about:blank if no src is specified. This may break DOM compliance, haven't looked into it. Adam, have you seen bug 5569? I think this may be a side-effect of that one.
Whiteboard: about:blank hack fix in hand
Well it turns out this is what both Nav and IE have done in the past, removing "hack" annotation above. This doesn't fix bug 5569 per se, but it does fix the test case that caused bug 5569 to be reported in the first place.
Whiteboard: about:blank hack fix in hand → fix in hand
It sort of makes sense to put *something* in there when no SRC is specified, but I defer to others what that should be. I have no problem with about:blank as long as it doesn't break standards. Who would know about this sort of thing?
Attached file enhanced test case (deleted) —
Gecko and Moz both report the location of the document in the frame with no src as "about:blank". To summarize my understanding, the standard doesn't really say anything about this case. The attribute SRC of the frame will return "" even though about:blank is being shown. The HTML spec mentions that once a frameset is loaded, the SRC attribute of the frame should not change, but the location of the document should always represent the documetn currently being displayed. So since the standard doesn't say things one way or the other, and Nav does something irrational (collections undefined javascript error) and IE does something rational, I think it makes the most sense to do what IE does here, and load "about:blank".
Er, I meant *IE* and Moz both report the location of the document in the frame with no src as "about:blank".
(updating mutiple bugs) Nominating this bug for beta3 because it is either a crasher or a correctness bug and I have a straightforward fix in hand. This bug fix is small, low risk, and can easily be reverted with no side effects.
Keywords: nsbeta3
*** Bug 46142 has been marked as a duplicate of this bug. ***
Marking nsbeta3+
Whiteboard: fix in hand → [nsbeta3+]fix in hand
This fix has been checked in. Coming up with a test case to assist in verification...
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Build ID: 2000080322 OS: Red Hat Linux 6.2, Kernel 2.2.15 While the today's patch does indeed fix the bug for me when viewing the http://www.edecon.ro/Test.html URL and a document containing *only* <frameset><frame></frameset> I still got garbage from the URL mentioned in Bug 46142 (http://www.ccdisco.co.uk/redirect.htm). This likely occurs because that page's <frame> does indeed have the SRC option, but it utilizes javascript in some broken manner: <frame name="slideshow" src="javascript:parent.blank">
Marking verified in the Sept 5th build.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
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.

Attachment

General

Creator:
Created:
Updated:
Size: