Re: A proposal for addition to HTML 3.0: Frames

From: Bert Bos <bert@let.rug.nl>
Date: Thu, 21 Sep 95 06:47:48 EDT

I've been thinking about multi-pane layouts for document for some
time, so I was very interested to see Netscape's proposal for
frames. Unfortunately, it fell short of my expectations. The frames
solve part of a problem, while making it harder to solve the rest. So
I include two alternative proposals below.

1. Netscape's proposal introduces two new elements, one of which is
actually a copy of an already existing one, IMG, for which there is
already a better alternative: FIG. The proposals below don't need
extra elements.

2. Frames don't allow content in the same document in which the frames
are being defined. This extra indirection is often unneeded and makes
maintenance harder.

3. The possible layouts are resticted to a tabular layout. Although
framesets can be nested, the result will always be a set of rows or a
set of columns.

4. Framesets need to be defined with HTML. It is impossible to layout
another SGML file without creating an HTML galley file first.

5. The proposal mentions that results of forms or targets of
hyperlinks can be displayed in a frame, but it doesn't mention
how. HTML doesn't have a way of specifying how a target document is
displayed (nor should it).

6. The frames offer no obvious way for extension of the syntax, to
allow other kinds of layout, such as paged or non-visual layouts.



			  ------------------
			  COUNTER-PROPOSAL 1
			  ------------------

This proposal extents HTML with two new attributes. It fixes 4 of the
6 points above. It obviously cannot fix 4. Point 5 isn't addressed,
since it is better handled with style sheets (see proposal 2).

Displayed documents are divided into two classes: main documents and
transcluded documents. A transcluded document is one whose `pagemodel'
is ignored. As Terry Allen suggested, documents could have a property
that disallows transclusion. How a document can become a transcluded
document is not addressed here, but see proposal 2.

The HTML tag gets a new attribute:

    PAGEMODEL CDATA "grid 1 1 1"

    The value is a keyword with any number of parameters. The only
    allowed keyword is `grid', but others can be added if new kinds of
    layout become necessary.

    `grid' divides the available display into a regular grid. The
    first parameter is the number of columns. The number of rows will
    follow from evaluating the rest of the parameters. The other
    parameters are pairs of numbers, each defining a pane in terms of
    the number of columns and rows that it spans. The panes are packed
    tightly on the grid, from left to right and from top to
    bottom. See example below.

Some other elements get a DISPLAY attribute. I like to keep the number
of such elements small (preferring specification through style sheets
instead), so I suggest that the content model of HTML is changed to
(HEAD, (BODY|FORM)+) and that only BODY and FORM get the new
attribute:

    DISPLAY CDATA #IMPLIED

    The value of DISPLAY can be a keyword, or a keyword followed by
    parameters. Currently only `pane' is allowed, with a single number
    as parameter, but see proposal 2 below for other possibilities.

    A value of "pane 2" means that the content of the element occupies
    the 2nd pane of the pagemodel. If several elements are displayed
    in the same pane, the contents are concatenated.

Example. The document below is displayed in four panes,
approximately like this:

    +-------+---+
    |   1   |   |
    +---+---+ 2 |
    |   |   |   |
    | 3 +---+---+
    |   |   4   |
    +---+-------+

    <html pagemodel="grid 3  2 1  1 2  1 2  2 1">
      <head>...</head>
      <body display="pane 1">...</body>
      <body display="pane 2">...</body>
      <body display="pane 3">...</body>
      <body display="pane 4">...</body>
    </html>

The display area is divided into three columns. four panes are
defined, the first one is 2x1, the second one is 1x2 and fits to the
right of the first one, the third one is 1x2 and starts on the next
row, the last one doesn't fit on the same row and ends up on the third
row.

The grid therefore has 3 rows. Note that there remains an unoccupied
cell in the middle.

Indirection (transclusion) can be achieved by putting a FIG (or IMG)
inside one of the body parts.



			  ------------------
			  COUNTER-PROPOSAL 2
			  ------------------

This proposal uses style sheets in the CSS language. It is more
comprehensive than proposal 1 and it fixes all 6 problems mentioned
above. The two proposals can be combined.

Two new properties and a new keyword are added to CSS (level2):


    pagemodel

      value: grid <number> [<number> <number>]+
      initial: grid 1 1 1
      example: *: pagemodel = grid 3  2 1  1 2  1 2  2 1

    The pagemodel property defines the overal layout of the
    document. It is special, because it is only defined for the top
    level element and then only if the document is a main document (as
    opposed to a transcluded document, see link-effect below).

    The value is a keyword plus parameters. Currently, the only
    possible keyword is `grid'.

    `grid' divides the available display into a regular grid. The
    first parameter is the number of columns. The number of rows will
    follow from evaluating the rest of the parameters. The other
    parameters are pairs of numbers, each defining a pane in terms of
    the number of columns and rows that it spans. The panes are packed
    tightly on the grid, from left to right and from top to
    bottom. See the example below.


    link-effect

      value: replace | pane <number> | popup | unfold | window
      initial: replace
      example: FORM: link-effect = pane 2

    The property defines how the target of a hyperlink is displayed
    when it is activated. The property applies to all hyperlinks
    contained within the element. Note that it doesn't say what the
    hyperlink is or how it can be activated. The possible values are:

    replace: when a hyperlink is activated, the target becomes a main
      document, replacing the most recent one.

    pane <number>: the target document will be displayed in the
      indicated pane of the main document. The document becomes a
      transcluded document and its pagemodel is ignored.

    note: the target is displayed in a modal popup window. It is
      considered a transcluded document and thus its pagemodel is
      ignored.

    unfold: the target is displayed as a block of text replacing the
      source anchor. It is a transcluded document and its pagemodel is
      therefore ignored. The document is displayed within the margins
      that are in force at the position of the source anchor.

    window: a new window is opened (`cloned') with a new main
      document. This facility should be used sparingly, since it
      disrupts the user's interaction with the UA.

    For non-visual media, appropriate substitutes should be defined.


The CSS proposal (level 2) already includes a `display' property, that
defines where the contents of an element end up. The possible values
are extended with the following keyword:

    pane <number>: display the contents of this element in the
      indicated pane.

Example. The document below is displayed in four panes,
approximately like this:

    +-------+---+
    |   1   |   |
    +---+---+ 2 |
    |   |   |   |
    | 3 +---+---+
    |   |   4   |
    +---+-------+

stylesheet `1234.css' (this is supposed to be cascaded on top of an
appropriate default style):

    *: pagemodel = grid 3  2 1  1 2  1 2  2 1;
    one: display = pane 1;
    two: display = pane 2;
    three: display = pane 3;
    four: display = pane 4;

document:

    <!doctype html system [ <?stylesheet "default" "1234.css"> ]>
    <head>...</head>
    <body>
      <div class=one>...</div>
      <fig class=two src="f2.html">...</fig>
      <div class=three>...</div>
      <div class=four>...</div>
    </body>

See the explanation after the example in proposal 1. Note that the
contents of pane 2 come from an included document `f2.html'.


			  ------------------



Bert
-- 
                          Bert Bos                      Alfa-informatica
                 <bert@let.rug.nl>           Rijksuniversiteit Groningen
    <http://www.let.rug.nl/~bert/>     Postbus 716, NL-9700 AS GRONINGEN


Follow-ups