- From: Braden N. McDaniel <braden@shadow.net>
- Date: Wed, 29 Jul 1998 16:23:48 -0700
- To: "'Simon Richter'" <geier@psi5.com>, "'Todd Fahrner'" <fahrner@pobox.com>
- Cc: <www-style@w3.org>, <www-html@w3.org>
> -----Original Message----- > From: www-style-request@w3.org [mailto:www-style-request@w3.org]On > Behalf Of Simon Richter > Sent: Wednesday, July 29, 1998 12:22 PM > To: Todd Fahrner > Cc: www-style@w3.org; www-html@w3.org > Subject: 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; > } I don't think we need this. Already, if I had the style IMG { background-color: blue } ... What would be the expected behavior using an image with an alpha channel? <IMG SRC="myimage.png" ALT="My Image"> Wouldn't you expect the transparent portions of the image to show through blue? I would. Therefore I'd also expect this code to render the same way: <OBJECT DATA="myimage.png" TYPE="image/png" STYLE="background-color: blue">My Image</OBJECT> It seems reasonable to extend this to text documents, and probably other media that do not inherently specify a background color. I suggest a stickier situation is this: <OBJECT DATA="mytext.txt" TYPE="text/plain" STYLE="color: red" HEIGHT="100%" WIDTH="100%">My Text </OBJECT> Obviously the (fallback) contents of the OBJECT element should be rendered in red. But what about the referenced text file? Should the text for it be rendered in red? Let's not think about this problem just for text files, but for *any* monochromatic inclusion via object; I think they should all be treated the same way. > > 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. This, I submit, would be a mistake. AFAICT, there is no inheritance rule to deal with this. Importantly, in a browser that supports CSS, *every* document (including, presumably, those included via OBJECT) has a default style sheet (by virtue of there being default values for the CSS properties). There is nothing in the specs to indicate that this default style sheet should be *replaced* by an inherited style sheet from an "outer document," but that is exactly the behavior you seem to be suggesting. > > 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. In a browser that supports CSS, doesn't an HTML file *always* have its own style sheet, by virtue of the presence of defaults on the CSS properties? So the default style sheet has precendence, and (taking !important declarations out of consideration for the moment) replaces the styles in the outer document. It seems to me the two behaviors you've described here are contradictory. Braden
Received on Wednesday, 29 July 1998 19:17:12 UTC