- From: Chris Lilley <chris@w3.org>
- Date: Sun, 06 Feb 2000 16:50:02 +0100
- To: Matthew Brealey <thelawnet@yahoo.com>
- CC: www-style@w3.org
Matthew Brealey wrote: > > There is, in my opinion, a need to better specify the end of elements > whose closing tags have been omitted when their contents have display: > block. I don't think so. However, your posting clearly demonstrates a need to differentiate between block elements in DTD design, and block formatting of the content of those elements. In brief; style sheet changes do not affect the content model of elements; there is a single correct parsing ofa valid HTML document instance according to the SGML specification, and the style sheet acts on the parsed document not on its source. Bearing these points in mind,the problem that you are discussing simply goes away. > For example, > <p style="background: red"> > A P element > <span style="display: block"> > A SPAN element that is behaving as a block element > </span> > Is this in the P element? > </p> very clearly yes, regardless of what the stylesheet does after the document is parsed. > Browsers seem to give all the text is given the red backround, which I > find odd in view of: > > <q cite="http://www.w3.org/TR/REC-HTML401/struct/text.html#h-9.3.1> > It cannot contain block-level elements (including P itself). > </q> > > The HTML definition of block-level elements specifically mentions the fact > that elements can have their behaviour changed by style sheets, so one > would assume that this definition also prevents the inclusion of > block-level elements that have been made so by style sheets. It is that particular presumption which is incorrect, and which then leads to the rest of your demonstration of how that would, if correct, be a problem. However, it does seem that the HTML spec is using loose language, and that others are likely to be confused as well. > is that it means that one cannot format a P element without having access > to the DTD, in particular '- O'. Furthermore, display: block does not > completely describe the behaviour of a P element. Considering a processing model where stylesheets are applied to parsed dcuments will, I believe, make this clearer. > In HTML, this is not especially serious, but in other languages it may be: Other markup languages are likely to be defined in XML, and thus the possibility of implicit closing of elements does not arise due to the well-formedness rules. > I am inclined to think that HTML is right (and that does not need to be > changed) and the browsers wrong; it is important to determine a correct > and consistent approach because whatever approach is used must also be > used for other markup languages such as XML. Exactly, itmust also be used for XML; and thus, parsing cannot depend on the style sheet. > If what I say is correct, HTML is right and the (display: block > supporting) browsers wrong; if I am wrong, the browsers are right and HTML > is wrong. Yes (the latter) -- Chris
Received on Monday, 7 February 2000 19:37:27 UTC