Re: OBJECT, inheritance, and rendering

Todd Fahrner wrote:

> Let's suppose that OBJECT has a plain text file as its data source. Perhaps
> the parent of OBJECT is P. Assuming that OBJECT has no formatting specified
> in CSS, nor any presentational attributes in markup, what is the most
> reasonable (screen) rendering for the text? Should whitespace be honored, a
> lá PRE? Or should the object's content render like that of the parent
> element - P - wrapping to the same width? What if OBJECT's parent is PRE
> instead of P?

Well, if I load the plain text file directly into a browser window, it is
usually displayed as <PRE> text (I don't know of any browser which does this
differently), so it would be expected behaviour that the same happens within an
<OBJECT>, at least by default (see below).

The interesting question is rather: Will the HTML document's colors be
inherited? I think this should be defined somewhere (maybe in the CSS of the
surrounding HTML):

OBJECT {
  inherit-colors: yes;
  inherit-whitespace: no;
}

The file referred to by OBJECT would be displayed using the document's body's
colors, but using the default setting for P/PRE, that is <PRE> for a text file.

To set the values that can be inherited by the referenced file, I would suggest
setting the values for <OBJECT>:

OBJECT: {
  inherit-colors: yes;
  background-color: white;
}

> Now suppose OBJECT references an HTML file. Do the HTML, HEAD, or BODY
> elements in the included file implicitly terminate the P element from which
> it is called? Does the H1? The P?

I think it should not, because the HTML file in the <OBJECT> sits in its own
box, and should not be interfere with what it outside. It can inherit stylesheet
settings from the outer HTML file, however.

> Suppose I say in CSS that OBJECT should be red, and OBJECT's content is an
> HTML file that may or may not have its own stylesheet information concerning
> color (say, blue on BODY). How should the cascade resolve?

IMHO the inner HTML file's style information gains precedence, because the outer
stylesheet may not know about some classes the inner file uses. Thus, the text
will be blue.

CU
   Simon

Received on Wednesday, 29 July 1998 18:38:23 UTC