The CSS Standardization Process

栏目: IT技术 · 发布时间: 4年前

Cascading Style Sheets Levels, snapshots, modules…

The CSS standardization process

CSS is both a standard and a technology in development. Knowing which part of CSS is finished and which part you cannot use yet is a challenge. It has been like that since many years and is likely to stay that way for a couple more: the standard part is slowly growing, the part still in development has been growing as well, but should eventually diminish.

This article explains how the CSS working group itself keeps track. It may be useful next time you see a new publication on the W3C site and wonder how close to a standard it is.

Finding the latest state of CSS

For software makers, there is an easy way to know what parts of CSS should be implemented and what parts not yet. Since 2007, the working group publishes so called snapshots, which explain exactly that. Much of the text of this article is in fact taken from the2010 snapshot.

So far there have been five snapshots, the currently latest is called CSS Snapshot 2018. The intention is that new ones appear every one or two years, depending on how much of CSS becomes stable in that period. The most recent snapshot can always be found at this URL:

http://www.w3.org/TR/CSS/

Implementers interested in the experimental features, and everybody who wants to help develop CSS, may also find the CSS current work page useful: it shows the current status and a short description of all existing parts of CSS.

For users of CSS, the situation is unfortunately less clear. Even if some part of CSS becomes a standard (i.e., a W3C Recommendation ), it only means that that part has been correctly implemented in a certain number of implementations. It does not mean that all implementations of CSS support it. Trial and error, and fallback solutions, remain necessary.

Modules and snapshots

Originally, in 1994–1995, the plan was to create a single CSS specification, with comparable size but slightly different features than the current level 2 ( with template layout, run-in headers, columns, downloadable fonts and running headers and footers, but without absolute positioning ). It would be a ‘temporary’ style sheet language, good enough to avoid things like FONT tags and misuse of HTML tables for maybe up to ten years. The experience would help create a better, more powerful successor.

Things didn't work out that way. It quickly became clear that the browser makers at the time were not skilled enough yet in typography and structured text, and CSS had to be made a lot simpler if we wanted it to be implemented. That led to the split in level 1 and level 2. Later we also discovered that people didn't want to replace CSS and rather wanted to make it bigger.

The CSS working group chose to adopt a modular approach for CSS beyond level 2, where each module defines a part of CSS, rather than to write a single monolithic specification. This breaks the specification into more manageable chunks and allows more immediate, incremental improvement to CSS.

A separate document, the CSS snapshot, defines the current scope and state of CSS. It includes only modules that the working group considers stable and for which there is enough implementation experience to be sure of that stability.

Specifications listed in the snapshot are not completely frozen, though. They includeW3C Candidate Recommendations (see below).But even the listed W3C Recommendations (standards) may still receive errata.

Document statuses

Module and snapshot are two kinds of documents. The CSS working group uses those names as explained above, but other working groups may use them in different ways. On the other hand, to indicate the stability of each document, W3C has a vocabulary that all working groups share:

Working Draft (WD)
WDs are published during the process of drafting the specification. The purpose is to create a snapshot of the specification's current state and to solicit input from the W3C and the public. The specification is still known to be unstable, and is often incomplete.
Candidate Recommendation (CR)
By publishing a Candidate Recommendation, a working group is expressing that it considers the specification complete and that it has resolved all known issues. It is ready for testing in practice. A CR is a call for implementations.
Proposed Recommendation (PR)
To exit CR and enter this stage, the specification needs a comprehensive test suite and implementation reports proving that every feature is interoperably implemented in at least two shipping implementations. W3C Members are asked to review the specification one last time.
Recommendation (REC)
This is the final stage: a standard. At this point there should be no more changes, although it may of course happen that errata are found that eventually require a REC to be revised. A REC may eventually also become obsolete.

Two steps forward, one step back

In the CSS WG 's experience, the recommendation track is not linear. The experience is that many specifications enter CR twice, because implementation testing often uncovers significant problems in the specification and thus pushes it back to working draft. As a result, although the CSS WG has a clear idea of the stability of the CSS specifications, it is difficult for someone outside the working group to come to that same understanding based on a specification's official status. For that reason, a CSS Snapshot does not necessarily include all CR documents: the working group may already know that a certain CR will have to be revised.

Levels 1, 2, 3 and above

Cascading Style Sheets does not have versions in the traditional sense; instead it has levels. Each level of CSS builds on the previous, refining definitions and adding features. The feature set of each higher level is a superset of any lower level, and the behavior allowed for a given feature in a higher level is a subset of that allowed in the lower levels. A user agent conforming to a higher level of CSS is thus also conformant to all lower levels.

CSS Level 1
The CSS Working Group considers theCSS1 specification to be obsolete. CSS Level 1 is in practice defined as all the features of the CSS1 specification (properties, values, at-rules, etc), but using the syntax and definitions in the CSS 2.1 specification. CSS Style Attributes defines its inclusion in element-specific style attributes.
CSS level 2
Although the old CSS2 specification is technically a W3C Recommendation, it passed into the Recommendation stage before the W3C had defined the Candidate Recommendation stage. Over time, implementation experience and further review has brought to light many problems in the CSS2 specification, so, instead of expanding an already unwieldy errata list, the CSS working group chose to define CSS Level 2 Revision 1 (CSS 2.1). In case of any conflict between the two specifications, CSS 2.1 contains the definitive definition. Features in CSS2 that were dropped from CSS 2.1 should be considered to be at the Candidate Recommendation stage. But, note that many of these have been or will be pulled into a CSS Level 3 working draft, which will, once it reaches CR, obsolete the definitions in CSS2.
CSS level 3 and above
CSS Level 3 builds on level 2 module by module. Each module adds functionality to, and replaces part of, the CSS 2.1 specification. The working group intends that the CSS modules will not contradict the CSS 2.1 specification; only that they will add functionality and refine definitions. Modules develop at different speeds, depending on their complexity and the working group's priorities. For example, Selectors level 3 is already a Recommendation and there is even a draft of Selectors level 4, while the CSS table module level 3 is still an early draft.
New modules at level 1
When a new technology is added to CSS that is not an extension of something in an earlier CSS specification, it is published in a module that includes the indication ‘level 1’, e.g., Flexible box layout module level 1 , Grid layout module level 1 or Multi-column layout module level 1 . When such a module in turn is extended with new features, it becomes ‘level 2‘, then ‘level 3’, etc. E.g., when level 1 of Grid became a CR, work was started on ‘CSS grid layout module level 2’ .

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

程序员实用算法

程序员实用算法

Andrew Binstock、John Rex / 陈宗斌 / 机械工业出版社 / 2009-9 / 65.00元

《程序员实用算法》重点关注的是实用、立即可用的代码,并且广泛讨论了可移植性和特定于实现的细节。《程序员实用算法》作者介绍了一些有用但很少被讨论的算法,它们可用于语音查找、日期和时间例程(直到公元1年)、B树和索引文件、数据压缩、任意精度的算术、校验和与数据验证,并且还最全面地介绍了查找例程、排序算法和数据结构。 《程序员实用算法》结构清晰,示例丰富,可作为广大程序员的参考用书。一起来看看 《程序员实用算法》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具