Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc. This module contains the features of CSS level 3 relating to DESCRIBE HERE. It includes and extends the functionality of CSS level 2 [CSS21], which builds on CSS level 1 [CSS1]. The main extensions compared to level 2 are SUMMARIZE HERE.
This is a public copy of the editors' draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don't cite this document other than as work in progress.
The (archived) public mailing list www-style@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “unknown-shortname” in the subject, preferably like this: “[unknown-shortname] …summary of comment…”
This document was produced by the CSS Working Group (part of the Style Activity).
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
The following features are at risk: …
This section is not normative.
This specification provides features to align lines and blocks to invisible grids in the document.
Alinging lines and blocks to grids gives the following benefits:
There are several types of objects in a document that can break the vertical rhythm. Examples include lines in different size of text, pictures, and tables.
Keep vertical rhythm through pictures and different size of text in a multi-column document.
This module defines following capabilities:
It is important to control these capabilities independently, so that align to grids can be turned off for tables for example, but can be turned back on for the following text to the original grids. For example, oftentimes, text in tables do not align to line grids. But text following the table should align to the same grids as the text before the table.
Explain, normatively, how this module affects the definition of CSS.
This module replaces and extends the SUMMARIZE HERE features defined in [CSS21] sections W.X and Y.Z.
Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.
All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]
Examples in this specification are introduced with the words “for
example” or are set apart from the normative text with
class="example", like this:
This is an example of an informative example.
Informative notes begin with the word “Note” and are set apart from
the normative text with class="note", like this:
Note, this is an informative note.
This specification follows the CSS property definition conventions from [CSS21]. Value types not defined in this specification are defined in CSS Level 2 Revision 1 [CSS21]. Other CSS modules may expand the definitions of these value types: for example [CSS3COLOR], when combined with this module, expands the definition of the <color> value type as used in this specification.
In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the inherit keyword as their property value. For readability it has not been repeated explicitly.
layout-grid-line’ property| Name: | layout-grid-line |
|---|---|
| Value: | none | auto | <length> | <percentage> |
| Initial: | none |
| Applies to: | block containers |
| Inherited: | no |
| Percentages: | N/A |
| Media: | visual |
| Computed value: | specified value |
TBD
layout-grid-mode’ property| Name: | layout-grid-mode |
|---|---|
| Value: | none | block | line |
| Initial: | none |
| Applies to: | block containers |
| Inherited: | yes |
| Percentages: | N/A |
| Media: | visual |
| Computed value: | specified value |
This property controls how lines and blocks are aligned to grids. Values have the following meanings:
none’
block’
line’
Handling margins and borders needs review
When this property is set to anything other than ‘none’, the object to align is vertically centered
within the grid row. If the computed height is larger than the grid space,
then the object is centered within the smallest number of grid rows
necessary for the object to fit in. The starting alignment point is moved
accordingly. This is illustrated below, where a represents the
numerical ‘layout-grid-line’ value, b and
c are half the difference between the computed line-heights and
either the layout-grid-line value or twice the value respectively.:
Layout of contents within line grid, where a represents the layout-grid-line value, and the alignment baseline is at the bottom (after-edge).
As for regular height computation, the ruby box is treated especially. In a similar fashion to the line-height determination process, only the ruby base element is considered for centering purpose, however the above and/or the after space should be sufficient to fit the ruby text above and/or after the base text within the grid-line space. If this is not the case, the grid-line size needs to be increased in multiple of grid rows until the whole ruby box fits. Is just ignoring ruby text enough? like rt { layout-grid-mode: ignore; } or nothing needed to be defined if line-stacking-ruby: auto does the work?
Note that in order for this property to have an effect, line grids must
be defined by the ‘layout-grid-line’ property.
When a different size of text like headings wraps, it is usually aligned to grids as a block and lines within the block do not align.
A line of large text wraps within line grids.
This effect can be achieved by the following code:
body { line-grid-mode: line; }
h1 { line-grid-mode: block; }
layout-grid’ propertyTBD
gd’ length unitThe existence of a grid in an element makes it possible and very useful to express various measurements in that element in terms of grid units. Grid units are used very frequently in East Asian typography, especially for the left, right, top and bottom element margins.
Therefore a new length unit is necessary: gd to enable the author to specify the various measurements in terms of the grid.
For example, consider the following style:
P { layout-grid: strict both 20pt 15pt; margin: 1gd 3gd 1gd 2gd }
This way, all P elements would effectively acquire a 15pt top margin, a 60pt right margin, a 15pt bottom margin and a 40pt left margin.
If no grid is specified, the gd unit should be treated the same as the em unit.
*gd’ and
‘*em’The ‘width’ and ‘height’ properties accept ‘*gd’ and ‘*em’
values. This syntax computes to ‘auto’,
and then the result will be round down to the largest multiple of the
specified unit that is equal to or less than the original computed value.
The half of the fraction is added to each margin of the direction; if it
is used for ‘height’, the half of
fraction is added to the top and bottom margins, and if for ‘width’, to the left and right margins.
body {
width: *em;
height: *gd;
margin: 3em 2gd 3em 3gd;
}
Conformance to CSS TEMPLATE Module is defined for three conformance classes:
A style sheet is conformant to CSS TEMPLATE Module if all of its declarations that use properties defined in this module have values that are valid according to the generic CSS grammar and the individual grammars of each property as given in this module.
A renderer is conformant to CSS TEMPLATE Module if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the properties defined by CSS TEMPLATE Module by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)
An authoring tool is conformant to CSS TEMPLATE Module if it writes syntactically correct style sheets, according to the generic CSS grammar and the individual grammars of each property in this module.
So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.
To avoid clashes with future CSS features, the CSS specifications reserve a prefixed syntax for proprietary property and value extensions to CSS. The CSS Working Group recommends that experimental implementations of features in CSS Working Drafts also use vendor-prefixed property or value names. This avoids any incompatibilities with future changes in the draft. Once a specification reaches the Candidate Recommendation stage, implementors should implement the non-prefixed syntax for any feature they consider to be correctly implemented according to spec.
[Change or remove the following CR exit criteria if the spec is not a module, but, e.g., a Note or a profile. This text was decided on 2008-06-04.]
For this specification to be advanced to Proposed Recommendation, there must be at least two independent, interoperable implementations of each feature. Each feature may be implemented by a different set of products, there is no requirement that all features be implemented by a single product. For the purposes of this criterion, we define the following terms:
The specification will remain Candidate Recommendation for at least six months.
[acknowledgments]
| Property | Values | Initial | Applies to | Inh. | Percentages | Media |
|---|---|---|---|---|---|---|
| layout-grid-line | none | auto | <length> | <percentage> | none | block containers | no | N/A | visual |
| layout-grid-mode | none | block | line | none | block containers | yes | N/A | visual |