Closed Bug 47658 Opened 24 years ago Closed 12 years ago

Transitional NOFRAMES should be displayed when viewed out of the frameset

Categories

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

x86
Windows 2000
enhancement

Tracking

()

RESOLVED INVALID
Future

People

(Reporter: emk, Unassigned)

References

()

Details

(Keywords: html4, Whiteboard: [HTML4-16.4.1])

Reproduceable: always

Steps to reproduce:
1. Launch Mozilla.
2. Navigate to the http://homepage1.nifty.com/emk/moz/frameset.html
3. Navigate to the http://homepage1.nifty.com/emk/moz/noframes.html

Actual result:
NOFRAMES is not displayed in both cases.

Expected result:
NOFRAMES should be displayed in step 3. See the HTML4 spec. 16.4.1.

( http://www.w3.org/TR/html4/present/frames.html#h-16.4.1 )
|NOFRAMES may be used, for example, in a document that is the source of a 
|frame and that uses the transitional DTD. This allows authors to explain 
|the document's purpose in cases when it is viewed out of the frameset or 
|with a user agent that doesn't support frames.

Occurs on:
2000080408 nightly build on Windows 2000.
This sounds like an enhancement request, so I'm marking it Future - CC'ing
Harish, as it may require support from the parser to display the <NOFRAMES>
content.
Severity: normal → enhancement
Target Milestone: --- → Future
I've also created bug 56743 for the future enhancement suggestion of an option to disable frames entirely.
QA Contact update
QA Contact: petersen → amar
Harish, can this change be easily integrated into the other work you are doing
with <noframes>?  :)
Assignee: pollmann → harishd
Target Milestone: Future → ---
Eric: Basically, the sink needs to know when to allow noframes content. And in 
this case the sink should be informed that the noframes document was loaded via 
FRAME src and therefore it's ok to display the noframes content.
Status: NEW → ASSIGNED
Btw, IE doesn't seem to support this.
My mistake!  I just read that section of the spec from top to bottom.  It states
the obvious, which we already do:

  The NOFRAMES element specifies content that should be displayed only by user
  agents that do not support frames or are configured not to display frames.
  User agents that support frames must only display the contents of a NOFRAMES
  declaration when configured not to display frames. User agents that do not
  support frames must display the contents of NOFRAMES in any case.

Then there is the aforementioned section, which is directed towards *web page
authors*, not *user agent designers*:

  NOFRAMES may be used, for example, in a document that is the source of a frame
  and that uses the transitional DTD. This allows authors to explain the
  document's purpose in cases when it is viewed out of the frameset or with a
  user agent that doesn't support frames.

The phrase "in a document that is the source of a frame" should probably be "in
a document that is the source of a frameset" - because if your user agent does
not support or is not configured to support frames, it will not load the source
of frames pages, so there is no point in having <noframes> displayed there!  :)

With that clarification, I think this bug is INVALID.  We should not be
displaying the <NOFRAMES> content unless the end user has "configured" us to do
so (presumably by a pref, which is discussed in bug 56743).  This includes pages
that don't have a <FRAMESET> in them, and pages that are loaded via <FRAME SRC=>
and <IFRAME SRC=>.  We should still *not* display <NOFRAMES> in those cases,
unless the pref (bug 56743) is on!

Also, as a side note, I don't think that is should matter whether the document
was loaded via <I/FRAME SRC=> or not, because a document loaded by <I/FRAME
SRC=> could also be a <FRAMESET> document, in which case we would definitely not
want to display <NOFRAMES> content!  :)

Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
>The phrase "in a document that is the source of a frame" should probably be 
>"in a document that is the source of a frameset" - because if your user agent 
>does not support or is not configured to support frames, it will not load the 
>source of frames pages, so there is no point in having <noframes> displayed 
>there!  :)

That's wrong. For example, a document that is source of a frame (that is,
content.html) will be displayed in the following case when we follow the 
anchor in <noframes>.

frameset.html-------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<frameset rows="*,100">
<frame src="content.html" title="Contents">
<frame src="copyright.html" title="Copyright notice">
<noframes>
<body>
<p><a href="content.html">Contents</a></p>
<p>Copyright (C) 2001 emk.</p>
</body>
</noframes>
</frameset>
</html>
--------------------------------------------------------------
content.html--------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
(omit)
<noframes>
<p>Copyright (C) 2001 emk.</p>
</noframes>
</body>
</html>
--------------------------------------------------------------

I want to insert copyright notice in any document because we can link
the documents in the frame directly, but it will be tedious for users
using user agents that support frames. <Noframes> is a solution.
We can apply this method to the advertising banner (replace the word
"copyright" to "advertising" in above example).

Also, do not ignore the phrase "that uses the transitional DTD". 
A document that is the source of a frameset can't use the transitional DTD.
It must use the frameset DTD.

Reopening bug.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Oooh, Transitional DTD / Frameset DTD.  Apparently I can't read!  :)  Please
ignore my previoius comment as I have since clued myself in and reread things.

I agree that it makes sense to show the copyright notice in the scenario you
described.  Harish is going to have to make a call on the one - don't know where
it fits in our dtd support...  ?

An excerpt from the Transitional DTD (Note that the Frameset DTD just includes
the Transitional DTD but enables the %HTML.frameset entity):

<![ %HTML.Frameset; [
<!ENTITY % noframes.content "(BODY) -(NOFRAMES)"> ]]>

<!ENTITY % noframes.content "(%flow;)*">
<!ELEMENT NOFRAMES - - %noframes.content; -- alternate content container for non
frame-based rendering -->
 <!ATTLIST NOFRAMES
  %attrs; -- %coreattrs, %i18n, %events --
  >

Uhm, Harish?  :)
Summary: Transitional NOFRAMES should be displayed when viewed out of the frameset → Transitional NOFRAMES should be displayed
Okay, another thing I just noticed - in your test case, someone will only be
able to click on the link if frames have been turned off:

frameset.html-------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
 <frameset rows="*,100">
  <frame src="content.html" title="Contents">
  <frame src="copyright.html" title="Copyright notice">
  <noframes>
   <body>
    <p><a href="content.html">Contents</a></p>
    <p>Copyright (C) 2001 emk.</p>
   </body>
  </noframes>
 </frameset>
</html>

This specific case is already somewhat gracefully handled by our fix for bug
69455 - because people won't be able to see the link unless they have disabled
framesets.  When the next page is displayed, presumably framesets will still be
disabled in the user agent and we will again show the <noframes> content.

Trickier to solve will be the general case described by this bug:  Display the
content inside the <noframes> in content.html any time it is viewed outside a
frameset - even if, for example, the URL is manually typed in the URL bar.

Harish, if you can get the docShell, then QI to nsIDocShellTreeItem and check
GetSameTypeParent.  If this returns something non-null, we are inside a frameset
or iframe, otherwise we are not.  I don't know how to distinguish between the
iframe case and the frameset case, but maybe it would be okay to treat them the
same - at least better than what we are currently doing.  :)
Summary: Transitional NOFRAMES should be displayed → Transitional NOFRAMES should be displayed when viewed out of the frameset
Status: REOPENED → ASSIGNED
Target Milestone: --- → mozilla1.0.1
Aint gonna happen in the near future.
Target Milestone: mozilla1.0.1 → Future
Keywords: html4
Whiteboard: [HTML4-16.4.1]
Can you be more specific, Harish?
*** Bug 160500 has been marked as a duplicate of this bug. ***
Assignee: harishd → nobody
Status: ASSIGNED → NEW
QA Contact: amar → layout.html-frames
Gecko's behavior is correct per http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#hidden-elements
Status: NEW → RESOLVED
Closed: 23 years ago12 years ago
Resolution: --- → INVALID
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.